for( int i=sizeof(xfont)/sizeof(xfont[0]); --i>=0; )
XFreeFont(display, this->*xfont[i]);
-// bug in X causes XRenderExtensionInfo to be damaged if this is done here
-// left to be done in XCloseDisplay by Xlib.
-#if defined(HAVE_XFT) && 0
+// past bug in X caused XRenderExtensionInfo to be damaged
+// if this is done here. left to be done in XCloseDisplay by Xlib.
+// works in more modern systems, and needed for leak testing.
+#if defined(HAVE_XFT) && defined(VALGRIND)
static void *BC_WindowBase::*xft_font[] = {
&BC_WindowBase::smallfont_xft,
&BC_WindowBase::mediumfont_xft,
get_atoms();
#ifndef SINGLE_THREAD
- clipboard = new BC_Clipboard(display_name);
+ clipboard = new BC_Clipboard(this);
clipboard->start_clipboard();
#endif
}
}
}
+
+ static int xsynch = -1;
+ if( xsynch < 0 ) {
+ const char *cp = getenv("CIN_XSYNCH");
+ xsynch = !cp ? 0 : atoi(cp);
+ }
+ if( xsynch > 0 )
+ XSynchronize(display, True);
+
return display;
}
// event_names[event->type] : "Unknown");
//}
- if( active_grab && active_grab->grab_event(event) ) {
+ if( active_grab ) {
unlock_window();
- return 0;
+ active_grab->lock_window("BC_WindowBase::dispatch_event 3");
+ result = active_grab->grab_event(event);
+ active_grab->unlock_window();
+ if( result ) return result;
+ lock_window("BC_WindowBase::dispatch_event 4");
}
-
switch(event->type) {
case ClientMessage:
// Clear the resize buffer
cursor_y = event->xcrossing.y;
dispatch_cursor_enter();
break;
+
default:
break;
}
#endif
}
+Atom BC_WindowBase::to_clipboard(const char *data, long len, int clipboard_num)
+{
+ return get_clipboard()->to_clipboard(this, data, len, clipboard_num);
+}
+
+long BC_WindowBase::from_clipboard(char *data, long maxlen, int clipboard_num)
+{
+ return get_clipboard()->from_clipboard(data, maxlen, clipboard_num);
+}
+
+long BC_WindowBase::clipboard_len(int clipboard_num)
+{
+ return get_clipboard()->clipboard_len(clipboard_num);
+}
+
+int BC_WindowBase::do_selection_clear(Window win)
+{
+ top_level->event_win = win;
+ return dispatch_selection_clear();
+}
+
+int BC_WindowBase::dispatch_selection_clear()
+{
+ int result = 0;
+ for( int i=0; i<subwindows->total && !result; ++i )
+ result = subwindows->values[i]->dispatch_selection_clear();
+ if( !result )
+ result = selection_clear_event();
+ return result;
+}
+
+
void BC_WindowBase::get_relative_cursor_xy(int &x, int &y, int lock_window)
{
int abs_x, abs_y, win_x, win_y;