diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2019-05-24 15:02:39 +0200 |
---|---|---|
committer | Olivier Fourdan <ofourdan@redhat.com> | 2019-06-06 13:04:50 +0200 |
commit | 1d76eace1ea5736c9c30069f8b45443cb5254a27 (patch) | |
tree | 719451f0c9a8ffcef3f2b01e26728b7f8463331d | |
parent | c1303bd642e57d53ccbc8f6eb450c2a45bf4d3ef (diff) | |
download | mutter-1d76eace1ea5736c9c30069f8b45443cb5254a27.tar.gz |
clutter: Hook up pointer accessibility
When using evdev (for Wayland), the backend receives all device events
and queue them for clutter.
Hook up the pointer accessibility handlers in clutter's main processing
queue, so that we get better accuracy for pointer location.
We need to avoid doing this on X11 though because X11 relies on the raw
events for this to work reliably, so the same is already done in the
X11 backend when using X11.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/512
-rw-r--r-- | clutter/clutter/clutter-main.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/clutter/clutter/clutter-main.c b/clutter/clutter/clutter-main.c index fbae4d995..66bc88de0 100644 --- a/clutter/clutter/clutter-main.c +++ b/clutter/clutter/clutter-main.c @@ -58,6 +58,7 @@ #include "clutter-device-manager-private.h" #include "clutter-event-private.h" #include "clutter-feature.h" +#include "clutter-input-pointer-a11y-private.h" #include "clutter-main.h" #include "clutter-master-clock.h" #include "clutter-mutter.h" @@ -2261,6 +2262,21 @@ _clutter_process_event_details (ClutterActor *stage, break; case CLUTTER_MOTION: +#ifdef CLUTTER_WINDOWING_X11 + if (!clutter_check_windowing_backend (CLUTTER_WINDOWING_X11)) + { + if (_clutter_is_input_pointer_a11y_enabled (device)) + { + ClutterInputDevice *core_pointer; + gfloat x, y; + + clutter_event_get_coords (event, &x, &y); + core_pointer = clutter_device_manager_get_core_device (device->device_manager, + CLUTTER_POINTER_DEVICE); + _clutter_input_pointer_a11y_on_motion_event (core_pointer, x, y); + } + } +#endif /* CLUTTER_WINDOWING_X11 */ /* only the stage gets motion events if they are enabled */ if (!clutter_stage_get_motion_events_enabled (CLUTTER_STAGE (stage)) && event->any.source == NULL) @@ -2299,6 +2315,22 @@ _clutter_process_event_details (ClutterActor *stage, /* fallthrough from motion */ case CLUTTER_BUTTON_PRESS: case CLUTTER_BUTTON_RELEASE: +#ifdef CLUTTER_WINDOWING_X11 + if (!clutter_check_windowing_backend (CLUTTER_WINDOWING_X11)) + { + if (_clutter_is_input_pointer_a11y_enabled (device) && (event->type != CLUTTER_MOTION)) + { + ClutterInputDevice *core_pointer; + + core_pointer = clutter_device_manager_get_core_device (device->device_manager, + CLUTTER_POINTER_DEVICE); + + _clutter_input_pointer_a11y_on_button_event (core_pointer, + event->button.button, + event->type == CLUTTER_BUTTON_PRESS); + } + } +#endif /* CLUTTER_WINDOWING_X11 */ case CLUTTER_SCROLL: case CLUTTER_TOUCHPAD_PINCH: case CLUTTER_TOUCHPAD_SWIPE: |