X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.0%2Fguicast%2Fbcwindowbase.C;h=602934b1967aad840bfde338492e0812c1546273;hb=39d4e483b6daeb2d0eb2a6eec5b2e96552e22c5b;hp=0845dcbb1603531a6bef899a562cd5662315b4d4;hpb=9755040e9ae6889aa0d1627d0e209496d1e000e6;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.0/guicast/bcwindowbase.C b/cinelerra-5.0/guicast/bcwindowbase.C index 0845dcbb..602934b1 100644 --- a/cinelerra-5.0/guicast/bcwindowbase.C +++ b/cinelerra-5.0/guicast/bcwindowbase.C @@ -140,8 +140,10 @@ BC_WindowBase::~BC_WindowBase() if( !glx_win ) { // NVIDIA library threading problem, XCloseDisplay SEGVs without this sync_lock("BC_WindowBase::~BC_WindowBase:XDestroyWindow"); + lock_window("BC_WindowBase::~BC_WindowBase:XDestroyWindow"); glXMakeContextCurrent(top_level->display, 0, 0, 0); XDestroyWindow(top_level->display, win); + unlock_window(); sync_unlock(); } else @@ -202,8 +204,8 @@ BC_WindowBase::~BC_WindowBase() #ifndef SINGLE_THREAD #ifdef HAVE_GL if( (options & GLX_DISPLAY) != 0 && get_resources()->get_synchronous() ) { - printf("BC_WindowBase::~BC_WindowBase window deleted but opengl deletion is not\n" - "implemented for BC_Pixmap.\n"); + printf(_("BC_WindowBase::~BC_WindowBase window deleted but opengl deletion is not\n" + "implemented for BC_Pixmap.\n")); get_resources()->get_synchronous()->delete_display(this); } else @@ -408,7 +410,7 @@ int BC_WindowBase::create_window(BC_WindowBase *parent_window, else this->display_name[0] = 0; - strcpy(this->title, _(title)); + put_title(_(title)); if(bg_pixmap) shared_bg_pixmap = 1; subwindows = new BC_SubWindowList; @@ -657,7 +659,7 @@ Display* BC_WindowBase::init_display(const char *display_name) printf("BC_WindowBase::init_display: cannot connect to X server %s\n", display_name); if(getenv("DISPLAY") == NULL) { - printf("'DISPLAY' environment variable not set.\n"); + printf(_("'DISPLAY' environment variable not set.\n")); exit(1); } else { @@ -3994,15 +3996,30 @@ void BC_WindowBase::set_background(VFrame *bitmap) draw_background(0, 0, w, h); } +void BC_WindowBase::put_title(const char *text) +{ + if( BC_Resources::locale_utf8 ) { + char *bp=this->title, *ep = bp+sizeof(this->title)-1; + for( const char *cp=text; *cp!=0 && bptitle, text); +} + void BC_WindowBase::set_title(const char *text) { - XTextProperty titleprop; - char *txlist[2]; + put_title(_(text)); - strcpy(this->title, _(text)); + char *txlist[2]; txlist[0] = this->title; txlist[1] = 0; + XTextProperty titleprop; XmbTextListToTextProperty(top_level->display, txlist, 1, XStdICCTextStyle, &titleprop); XSetWMName(top_level->display, top_level->win, &titleprop); @@ -4182,6 +4199,15 @@ void BC_WindowBase::translate_coordinates(Window src_w, } } +void BC_WindowBase::get_root_coordinates(int x, int y, int *abs_x, int *abs_y) +{ + translate_coordinates(win, top_level->rootwin, x, y, abs_x, abs_y); +} + +void BC_WindowBase::get_win_coordinates(int abs_x, int abs_y, int *x, int *y) +{ + translate_coordinates(top_level->rootwin, win, abs_x, abs_y, x, y); +}