wayland: Only try and process pointer events when focussed
When combining Clutter with GTK+ we can receive events for surfaces which in the client side we do not have focussed.
This commit is contained in:
parent
e8e6ae8189
commit
3625f17857
@ -645,6 +645,8 @@ pointer_handle_leave (void *data,
|
|||||||
return;
|
return;
|
||||||
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
|
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
|
||||||
return;
|
return;
|
||||||
|
if (!device->pointer_focus)
|
||||||
|
return;
|
||||||
|
|
||||||
_gdk_wayland_display_update_serial (wayland_display, serial);
|
_gdk_wayland_display_update_serial (wayland_display, serial);
|
||||||
|
|
||||||
@ -689,6 +691,9 @@ pointer_handle_motion (void *data,
|
|||||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
|
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
|
||||||
GdkEvent *event;
|
GdkEvent *event;
|
||||||
|
|
||||||
|
if (!device->pointer_focus)
|
||||||
|
return;
|
||||||
|
|
||||||
event = gdk_event_new (GDK_NOTHING);
|
event = gdk_event_new (GDK_NOTHING);
|
||||||
|
|
||||||
device->time = time;
|
device->time = time;
|
||||||
@ -729,6 +734,9 @@ pointer_handle_button (void *data,
|
|||||||
GdkWaylandDisplay *wayland_display =
|
GdkWaylandDisplay *wayland_display =
|
||||||
GDK_WAYLAND_DISPLAY (device->display);
|
GDK_WAYLAND_DISPLAY (device->display);
|
||||||
|
|
||||||
|
if (!device->pointer_focus)
|
||||||
|
return;
|
||||||
|
|
||||||
_gdk_wayland_display_update_serial (wayland_display, serial);
|
_gdk_wayland_display_update_serial (wayland_display, serial);
|
||||||
|
|
||||||
switch (button) {
|
switch (button) {
|
||||||
@ -784,6 +792,9 @@ pointer_handle_axis (void *data,
|
|||||||
GdkEvent *event;
|
GdkEvent *event;
|
||||||
gdouble delta_x, delta_y;
|
gdouble delta_x, delta_y;
|
||||||
|
|
||||||
|
if (!device->pointer_focus)
|
||||||
|
return;
|
||||||
|
|
||||||
/* get the delta and convert it into the expected range */
|
/* get the delta and convert it into the expected range */
|
||||||
switch (axis) {
|
switch (axis) {
|
||||||
case WL_POINTER_AXIS_VERTICAL_SCROLL:
|
case WL_POINTER_AXIS_VERTICAL_SCROLL:
|
||||||
|
Loading…
Reference in New Issue
Block a user