mirror of
https://github.com/brl/mutter.git
synced 2024-12-26 04:42:14 +00:00
wayland: Check there is valid pointer or keyboard focus for events
This commit is contained in:
parent
de933213b7
commit
61dc824c91
@ -74,9 +74,14 @@ clutter_wayland_handle_motion (void *data,
|
||||
wl_fixed_t x, wl_fixed_t y)
|
||||
{
|
||||
ClutterInputDeviceWayland *device = data;
|
||||
ClutterStageCogl *stage_cogl = device->pointer_focus;
|
||||
ClutterStageCogl *stage_cogl;
|
||||
ClutterEvent *event;
|
||||
|
||||
if (!device->pointer_focus)
|
||||
return;
|
||||
|
||||
stage_cogl = device->pointer_focus;
|
||||
|
||||
event = clutter_event_new (CLUTTER_MOTION);
|
||||
event->motion.stage = stage_cogl->wrapper;
|
||||
event->motion.device = CLUTTER_INPUT_DEVICE (device);
|
||||
@ -98,10 +103,15 @@ clutter_wayland_handle_button (void *data,
|
||||
uint32_t button, uint32_t state)
|
||||
{
|
||||
ClutterInputDeviceWayland *device = data;
|
||||
ClutterStageCogl *stage_cogl = device->pointer_focus;
|
||||
ClutterStageCogl *stage_cogl;
|
||||
ClutterEvent *event;
|
||||
ClutterEventType type;
|
||||
|
||||
if (!device->pointer_focus)
|
||||
return;
|
||||
|
||||
stage_cogl = device->pointer_focus;
|
||||
|
||||
if (state)
|
||||
type = CLUTTER_BUTTON_PRESS;
|
||||
else
|
||||
@ -140,10 +150,14 @@ clutter_wayland_handle_axis (void *data,
|
||||
wl_fixed_t value)
|
||||
{
|
||||
ClutterInputDeviceWayland *device = data;
|
||||
ClutterStageCogl *stage_cogl = device->pointer_focus;
|
||||
ClutterStageCogl *stage_cogl;
|
||||
ClutterEvent *event;
|
||||
gdouble delta_x, delta_y;
|
||||
|
||||
if (!device->pointer_focus)
|
||||
return;
|
||||
|
||||
stage_cogl = device->pointer_focus;
|
||||
event = clutter_event_new (CLUTTER_SCROLL);
|
||||
event->scroll.time = _clutter_wayland_get_time();
|
||||
event->scroll.stage = stage_cogl->wrapper;
|
||||
@ -272,6 +286,8 @@ clutter_wayland_handle_key (void *data,
|
||||
ClutterStageCogl *stage_cogl = device->keyboard_focus;
|
||||
ClutterEvent *event;
|
||||
|
||||
if (!device->keyboard_focus)
|
||||
return;
|
||||
if (!device->xkb)
|
||||
return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user