< prev index next >

modules/javafx.graphics/src/main/native-glass/gtk/glass_general.cpp

Print this page

        

*** 501,513 **** gboolean disableGrab = FALSE; static gboolean configure_transparent_window(GtkWidget *window); static void configure_opaque_window(GtkWidget *window); - static void grab_mouse_device(GdkDevice *device, DeviceGrabContext *context); - static void ungrab_mouse_device(GdkDevice *device); - gint glass_gdk_visual_get_depth (GdkVisual * visual) { // gdk_visual_get_depth is GTK 2.2 + return gdk_visual_get_depth(visual); } --- 501,510 ----
*** 522,549 **** #endif } gboolean glass_gdk_mouse_devices_grab(GdkWindow *gdkWindow) { - #ifdef GLASS_GTK3 - if (disableGrab) { - return TRUE; - } - DeviceGrabContext context; - GList *devices = gdk_device_manager_list_devices ( - gdk_display_get_device_manager( - gdk_display_get_default()), - GDK_DEVICE_TYPE_MASTER); - - context.window = gdkWindow; - context.grabbed = FALSE; - g_list_foreach(devices, (GFunc) grab_mouse_device, &context); - - return context.grabbed; - #else return glass_gdk_mouse_devices_grab_with_cursor(gdkWindow, NULL, TRUE); - #endif } gboolean glass_gdk_mouse_devices_grab_with_cursor(GdkWindow *gdkWindow, GdkCursor *cursor, gboolean owner_events) { if (disableGrab) { --- 519,529 ----
*** 563,581 **** return (status == GDK_GRAB_SUCCESS) ? TRUE : FALSE; } void glass_gdk_mouse_devices_ungrab() { - #ifdef GLASS_GTK3 - GList *devices = gdk_device_manager_list_devices( - gdk_display_get_device_manager( - gdk_display_get_default()), - GDK_DEVICE_TYPE_MASTER); - g_list_foreach(devices, (GFunc) ungrab_mouse_device, NULL); - #else gdk_pointer_ungrab(GDK_CURRENT_TIME); - #endif } void glass_gdk_master_pointer_grab(GdkWindow *window, GdkCursor *cursor) { if (disableGrab) { --- 543,553 ----
*** 750,802 **** configure_opaque_window(window); return FALSE; } - static void - grab_mouse_device(GdkDevice *device, DeviceGrabContext *context) { - GdkInputSource source = gdk_device_get_source(device); - if (source == GDK_SOURCE_MOUSE) { - #ifdef GLASS_GTK3 - GdkGrabStatus status = gdk_device_grab(device, - context->window, - GDK_OWNERSHIP_NONE, - TRUE, - GDK_ALL_EVENTS_MASK, - NULL, - GDK_CURRENT_TIME); - #else - GdkGrabStatus status = GDK_GRAB_SUCCESS; - /* FIXME reachable by 2? - GdkGrabStatus status = gdk_device_grab(device, - context->window, - GDK_OWNERSHIP_NONE, - TRUE, - GDK_ALL_EVENTS_MASK, - NULL, - GDK_CURRENT_TIME); - */ - #endif - if (status == GDK_GRAB_SUCCESS) { - context->grabbed = TRUE; - } - } - } - - static void - ungrab_mouse_device(GdkDevice *device) { - #ifdef GLASS_GTK3 - GdkInputSource source = gdk_device_get_source(device); - if (source == GDK_SOURCE_MOUSE) { - gdk_device_ungrab(device, GDK_CURRENT_TIME); - } - #else - (void) device; - // not used on the GTK2 path - #endif - } - GdkPixbuf * glass_pixbuf_from_window(GdkWindow *window, gint srcx, gint srcy, gint width, gint height) { --- 722,731 ----
< prev index next >