projects
/
goodguy
/
history.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add file size toggle icons, ff_lut3d icon, fullscrn clk2play fix, timebar endpt curso...
[goodguy/history.git]
/
cinelerra-5.1
/
guicast
/
bcwindowbase.C
diff --git
a/cinelerra-5.1/guicast/bcwindowbase.C
b/cinelerra-5.1/guicast/bcwindowbase.C
index 54a147966c96618fc4c96ceffe6739c73170baf8..6f45933f714b85bf548054dde862b291c3b96941 100644
(file)
--- a/
cinelerra-5.1/guicast/bcwindowbase.C
+++ b/
cinelerra-5.1/guicast/bcwindowbase.C
@@
-85,9
+85,8
@@
Window XGroupLeader = 0;
Mutex BC_KeyboardHandlerLock::keyboard_listener_mutex("keyboard_listener",0);
ArrayList<BC_KeyboardHandler*> BC_KeyboardHandler::listeners;
Mutex BC_KeyboardHandlerLock::keyboard_listener_mutex("keyboard_listener",0);
ArrayList<BC_KeyboardHandler*> BC_KeyboardHandler::listeners;
-BC_WindowBase::BC_WindowBase(
int opts
)
+BC_WindowBase::BC_WindowBase()
{
{
- this->options = opts;
//printf("BC_WindowBase::BC_WindowBase 1\n");
BC_WindowBase::initialize();
}
//printf("BC_WindowBase::BC_WindowBase 1\n");
BC_WindowBase::initialize();
}
@@
-147,13
+146,13
@@
BC_WindowBase::~BC_WindowBase()
delete pixmap;
delete pixmap;
+//printf("delete glx=%08x, win=%08x %s\n", (unsigned)glx_win, (unsigned)win, title);
#ifdef HAVE_GL
#ifdef HAVE_GL
- if( get_resources()->get_synchronous() &&
- (top_level->options & GLX_WINDOW) && glx_win != 0 )
+ if( get_resources()->get_synchronous() && glx_win != 0 ) {
get_resources()->get_synchronous()->delete_window(this);
get_resources()->get_synchronous()->delete_window(this);
- else
+ }
#endif
#endif
-
XDestroyWindow(top_level->display, win);
+ XDestroyWindow(top_level->display, win);
if(bg_pixmap && !shared_bg_pixmap) delete bg_pixmap;
if(icon_pixmap) delete icon_pixmap;
if(bg_pixmap && !shared_bg_pixmap) delete bg_pixmap;
if(icon_pixmap) delete icon_pixmap;
@@
-213,28
+212,15
@@
BC_WindowBase::~BC_WindowBase()
XvUngrabPort(display, xvideo_port_id, CurrentTime);
unlock_window();
XvUngrabPort(display, xvideo_port_id, CurrentTime);
unlock_window();
-// Can't close display if another thread is waiting for events.
-// Synchronous thread must delete display it owns a GLX_WINDOW
// Must be last reference to display.
// Must be last reference to display.
-#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"));
- get_resources()->get_synchronous()->delete_display(this);
- }
- else
-#endif
- {
// _XftDisplayInfo needs a lock.
// _XftDisplayInfo needs a lock.
-
get_resources()->create_window_lock->lock("BC_WindowBase::~BC_WindowBase");
-
XCloseDisplay(display);
-
get_resources()->create_window_lock->unlock();
- }
+ get_resources()->create_window_lock->lock("BC_WindowBase::~BC_WindowBase");
+ XCloseDisplay(display);
+ get_resources()->create_window_lock->unlock();
+
// clipboard uses a different display connection
clipboard->stop_clipboard();
delete clipboard;
// clipboard uses a different display connection
clipboard->stop_clipboard();
delete clipboard;
-#endif // SINGLE_THREAD
}
resize_history.remove_all_objects();
}
resize_history.remove_all_objects();
@@
-2352,6
+2338,9
@@
void BC_WindowBase::init_xft()
{
#ifdef HAVE_XFT
if( !get_resources()->use_xft ) return;
{
#ifdef HAVE_XFT
if( !get_resources()->use_xft ) return;
+// apparently, xft is not reentrant, more than this is needed
+static Mutex xft_init_lock("BC_WindowBase::xft_init_lock", 0);
+xft_init_lock.lock("BC_WindowBase::init_xft");
if(!(smallfont_xft =
(resources.small_font_xft[0] == '-' ?
XftFontOpenXlfd(display, screen, resources.small_font_xft) :
if(!(smallfont_xft =
(resources.small_font_xft[0] == '-' ?
XftFontOpenXlfd(display, screen, resources.small_font_xft) :
@@
-2421,6
+2410,7
@@
void BC_WindowBase::init_xft()
}
// _XftDisplayInfo needs a lock.
XftDefaultHasRender(display);
}
// _XftDisplayInfo needs a lock.
XftDefaultHasRender(display);
+xft_init_lock.unlock();
#endif // HAVE_XFT
}
#endif // HAVE_XFT
}
@@
-3371,6
+3361,14
@@
int BC_WindowBase::ungrab(BC_WindowBase *window)
this->grab_active = 0;
return 1;
}
this->grab_active = 0;
return 1;
}
+int BC_WindowBase::grab_event_count()
+{
+ int result = 0;
+#ifndef SINGLE_THREAD
+ result = grab_active->get_event_count();
+#endif
+ return result;
+}
int BC_WindowBase::grab_buttons()
{
XSync(top_level->display, False);
int BC_WindowBase::grab_buttons()
{
XSync(top_level->display, False);
@@
-3850,12
+3848,9
@@
int BC_WindowBase::get_cursor_over_window()
int ret = XQueryPointer(display, win,
&root_return, &child_return, &abs_x, &abs_y,
&win_x, &win_y, &temp_mask);
int ret = XQueryPointer(display, win,
&root_return, &child_return, &abs_x, &abs_y,
&win_x, &win_y, &temp_mask);
-//printf("BC_WindowBase::get_cursor_over_window %d %s 0x%x %d 0x%x\n",
-// __LINE__, title, win, ret, child_return);
-
- int result = !ret || child_return == None ? 0 :
- match_window(child_return);
- return result;
+ if( ret && win != root_return && child_return != None )
+ ret = match_window(child_return);
+ return ret;
}
int BC_WindowBase::cursor_above()
}
int BC_WindowBase::cursor_above()
@@
-4258,6
+4253,7
@@
int BC_WindowBase::load_defaults(BC_Hash *defaults)
resources->filebox_columnwidth[1] = defaults->get("FILEBOX_WIDTH1", resources->filebox_columnwidth[1]);
resources->filebox_columnwidth[2] = defaults->get("FILEBOX_WIDTH2", resources->filebox_columnwidth[2]);
resources->filebox_columnwidth[3] = defaults->get("FILEBOX_WIDTH3", resources->filebox_columnwidth[3]);
resources->filebox_columnwidth[1] = defaults->get("FILEBOX_WIDTH1", resources->filebox_columnwidth[1]);
resources->filebox_columnwidth[2] = defaults->get("FILEBOX_WIDTH2", resources->filebox_columnwidth[2]);
resources->filebox_columnwidth[3] = defaults->get("FILEBOX_WIDTH3", resources->filebox_columnwidth[3]);
+ resources->filebox_size_format = defaults->get("FILEBOX_SIZE_FORMAT", get_resources()->filebox_size_format);
defaults->get("FILEBOX_FILTER", resources->filebox_filter);
return 0;
}
defaults->get("FILEBOX_FILTER", resources->filebox_filter);
return 0;
}
@@
-4285,6
+4281,7
@@
int BC_WindowBase::save_defaults(BC_Hash *defaults)
defaults->update("FILEBOX_WIDTH2", resources->filebox_columnwidth[2]);
defaults->update("FILEBOX_WIDTH3", resources->filebox_columnwidth[3]);
defaults->update("FILEBOX_FILTER", resources->filebox_filter);
defaults->update("FILEBOX_WIDTH2", resources->filebox_columnwidth[2]);
defaults->update("FILEBOX_WIDTH3", resources->filebox_columnwidth[3]);
defaults->update("FILEBOX_FILTER", resources->filebox_filter);
+ defaults->update("FILEBOX_SIZE_FORMAT", get_resources()->filebox_size_format);
return 0;
}
return 0;
}