diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c index 31e47d0b4b..2c14bc1321 100644 --- a/gdk/wayland/gdkdevice-wayland.c +++ b/gdk/wayland/gdkdevice-wayland.c @@ -37,8 +37,6 @@ #include #include -typedef struct _GdkWaylandDeviceData GdkWaylandDeviceData; - typedef struct _DataOffer DataOffer; typedef struct _GdkWaylandSelectionOffer GdkWaylandSelectionOffer; @@ -65,6 +63,7 @@ struct _GdkWaylandDeviceData double surface_x, surface_y; uint32_t time; uint32_t enter_serial; + uint32_t button_press_serial; GdkWindow *pointer_grab_window; uint32_t pointer_grab_time; guint32 repeat_timer; @@ -696,6 +695,8 @@ pointer_handle_button (void *data, } device->time = time; + if (state) + device->button_press_serial = serial; event = gdk_event_new (state ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE); event->button.window = g_object_ref (device->pointer_focus); @@ -1351,6 +1352,12 @@ _gdk_wayland_device_manager_new (GdkDisplay *display) NULL); } +uint32_t +_gdk_wayland_device_get_button_press_serial(GdkWaylandDeviceData *device) +{ + return device->button_press_serial; +} + gint gdk_wayland_device_get_selection_type_atoms (GdkDevice *gdk_device, GdkAtom **atoms_out) diff --git a/gdk/wayland/gdkprivate-wayland.h b/gdk/wayland/gdkprivate-wayland.h index 5ed4ce4616..4dcc80cbfc 100644 --- a/gdk/wayland/gdkprivate-wayland.h +++ b/gdk/wayland/gdkprivate-wayland.h @@ -138,7 +138,10 @@ void _gdk_wayland_device_manager_add_seat (GdkDeviceManager *device void _gdk_wayland_device_manager_remove_seat (GdkDeviceManager *device_manager, guint32 id); +typedef struct _GdkWaylandDeviceData GdkWaylandDeviceData; + GdkKeymap *_gdk_wayland_device_get_keymap (GdkDevice *device); +uint32_t _gdk_wayland_device_get_button_press_serial(GdkWaylandDeviceData *device); void _gdk_wayland_display_deliver_event (GdkDisplay *display, GdkEvent *event); GSource *_gdk_wayland_display_event_source_new (GdkDisplay *display); diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c index 8f824edbb7..fbf873d17e 100644 --- a/gdk/wayland/gdkwindow-wayland.c +++ b/gdk/wayland/gdkwindow-wayland.c @@ -563,8 +563,6 @@ gdk_wayland_window_map (GdkWindow *window) { GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); GdkWindowImplWayland *parent; - GdkWaylandDisplay *wayland_display = - GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)); GdkWindow *transient_for; if (!impl->mapped && !impl->use_custom_surface) @@ -591,6 +589,7 @@ gdk_wayland_window_map (GdkWindow *window) { struct wl_seat *grab_input_seat = NULL; GdkWindowImplWayland *tmp_impl; + GdkWaylandDeviceData *device; parent = GDK_WINDOW_IMPL_WAYLAND (transient_for->impl); @@ -616,10 +615,10 @@ gdk_wayland_window_map (GdkWindow *window) impl->hint == GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU || impl->hint == GDK_WINDOW_TYPE_HINT_COMBO)) { - + device = wl_seat_get_user_data(grab_input_seat); wl_shell_surface_set_popup (impl->shell_surface, grab_input_seat, - _gdk_wayland_display_get_serial (wayland_display), + _gdk_wayland_device_get_button_press_serial(device), parent->surface, window->x, window->y, 0); }