X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fbcwindowbase.C;h=1f1d0d30c151581dfbe51cc2ff90ec67ab71e1e0;hp=5d177c930d22693fe631a1a3727a6ee15bd1dcd0;hb=a2ebbc5e88800bd740652a32285f8145a1acfdc6;hpb=dcdf2f77cc47ca7c543f27ddb03c4814015d974b diff --git a/cinelerra-5.1/guicast/bcwindowbase.C b/cinelerra-5.1/guicast/bcwindowbase.C index 5d177c93..1f1d0d30 100644 --- a/cinelerra-5.1/guicast/bcwindowbase.C +++ b/cinelerra-5.1/guicast/bcwindowbase.C @@ -149,7 +149,11 @@ BC_WindowBase::~BC_WindowBase() //printf("delete glx=%08x, win=%08x %s\n", (unsigned)glx_win, (unsigned)win, title); #ifdef HAVE_GL if( get_resources()->get_synchronous() && glx_win != 0 ) { + if( window_type == MAIN_WINDOW ) + unlock_window(); get_resources()->get_synchronous()->delete_window(this); + if( window_type == MAIN_WINDOW ) + lock_window("BC_WindowBase::delete_window"); } #endif XDestroyWindow(top_level->display, win); @@ -456,8 +460,16 @@ int BC_WindowBase::create_window(BC_WindowBase *parent_window, const char *title vis = get_glx_visual(display); if( !vis ) #endif + { + int mask = VisualDepthMask | VisualClassMask; + static XVisualInfo vinfo = { .depth = 24, .c_class = DirectColor, }; + int nitems = 0; + XVisualInfo *vis_info = XGetVisualInfo(display, mask, &vinfo, &nitems); + vis = vis_info && nitems>0 ? vis_info[0].visual : 0; + if( vis_info ) XFree(vis_info); + } + if( !vis ) vis = DefaultVisual(display, screen); - default_depth = DefaultDepth(display, screen); client_byte_order = (*(const u_int32_t*)"a ") & 0x00000001; @@ -4056,6 +4068,11 @@ int BC_WindowBase::resize_window(int w, int h) size_hints.max_width = w; size_hints.min_height = h; size_hints.max_height = h; + if( this->x > -BC_INFINITY && this->x < BC_INFINITY ) { + size_hints.flags |= PPosition; + size_hints.x = this->x; + size_hints.y = this->y; + } XSetNormalHints(top_level->display, win, &size_hints); } XResizeWindow(top_level->display, win, w, h);