- gdk_pointer_grab( gtk_widget_get_window(m_widget), true,
- (GdkEventMask)
- (GDK_BUTTON_PRESS_MASK |
- GDK_BUTTON_RELEASE_MASK |
- GDK_POINTER_MOTION_HINT_MASK |
- GDK_POINTER_MOTION_MASK),
+ const GdkEventMask mask = GdkEventMask(
+ GDK_BUTTON_PRESS_MASK |
+ GDK_BUTTON_RELEASE_MASK |
+ GDK_POINTER_MOTION_HINT_MASK |
+ GDK_POINTER_MOTION_MASK);
+ GdkWindow* window = gtk_widget_get_window(m_widget);
+#ifdef __WXGTK3__
+ GdkDisplay* display = gdk_window_get_display(window);
+ GdkDeviceManager* manager = gdk_display_get_device_manager(display);
+ GdkDevice* device = gdk_device_manager_get_client_pointer(manager);
+ gdk_device_grab(device, window,
+ GDK_OWNERSHIP_NONE, false, mask, NULL, unsigned(GDK_CURRENT_TIME));
+#else
+ gdk_pointer_grab( window, true,
+ mask,