wayland: Update internal wayland state unconditionally
Things like idle times and the cursor position need to be updated even if there's a mutter grab in effect. https://bugzilla.gnome.org/show_bug.cgi?id=712247
This commit is contained in:
parent
ae44bff0b1
commit
63b9110f93
5 changed files with 43 additions and 15 deletions
|
@ -2044,6 +2044,15 @@ meta_display_handle_event (MetaDisplay *display,
|
||||||
{
|
{
|
||||||
MetaWindow *window;
|
MetaWindow *window;
|
||||||
gboolean frame_was_receiver;
|
gboolean frame_was_receiver;
|
||||||
|
#ifdef HAVE_WAYLAND
|
||||||
|
MetaWaylandCompositor *compositor;
|
||||||
|
|
||||||
|
if (meta_is_wayland_compositor ())
|
||||||
|
{
|
||||||
|
compositor = meta_wayland_compositor_get_default ();
|
||||||
|
meta_wayland_compositor_update (compositor, event);
|
||||||
|
}
|
||||||
|
#endif /* HAVE_WAYLAND */
|
||||||
|
|
||||||
window = get_window_for_actor (event->any.source, &frame_was_receiver);
|
window = get_window_for_actor (event->any.source, &frame_was_receiver);
|
||||||
|
|
||||||
|
@ -2288,9 +2297,6 @@ meta_display_handle_event (MetaDisplay *display,
|
||||||
#ifdef HAVE_WAYLAND
|
#ifdef HAVE_WAYLAND
|
||||||
if (meta_is_wayland_compositor () && (display->grab_op == META_GRAB_OP_NONE))
|
if (meta_is_wayland_compositor () && (display->grab_op == META_GRAB_OP_NONE))
|
||||||
{
|
{
|
||||||
MetaWaylandCompositor *compositor;
|
|
||||||
compositor = meta_wayland_compositor_get_default ();
|
|
||||||
|
|
||||||
if (meta_wayland_compositor_handle_event (compositor, event))
|
if (meta_wayland_compositor_handle_event (compositor, event))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,5 +107,7 @@ MetaWaylandBuffer * meta_wayland_buffer_from_resource (struct wl_resou
|
||||||
void meta_wayland_buffer_reference (MetaWaylandBufferReference *ref,
|
void meta_wayland_buffer_reference (MetaWaylandBufferReference *ref,
|
||||||
MetaWaylandBuffer *buffer);
|
MetaWaylandBuffer *buffer);
|
||||||
|
|
||||||
|
void meta_wayland_compositor_update (MetaWaylandCompositor *compositor,
|
||||||
|
const ClutterEvent *event);
|
||||||
|
|
||||||
#endif /* META_WAYLAND_PRIVATE_H */
|
#endif /* META_WAYLAND_PRIVATE_H */
|
||||||
|
|
|
@ -257,11 +257,6 @@ notify_motion (MetaWaylandSeat *seat,
|
||||||
const ClutterEvent *event)
|
const ClutterEvent *event)
|
||||||
{
|
{
|
||||||
MetaWaylandPointer *pointer = &seat->pointer;
|
MetaWaylandPointer *pointer = &seat->pointer;
|
||||||
float x, y;
|
|
||||||
|
|
||||||
clutter_event_get_coords (event, &x, &y);
|
|
||||||
pointer->x = wl_fixed_from_double (x);
|
|
||||||
pointer->y = wl_fixed_from_double (y);
|
|
||||||
|
|
||||||
meta_wayland_seat_repick (seat, event);
|
meta_wayland_seat_repick (seat, event);
|
||||||
|
|
||||||
|
@ -363,10 +358,16 @@ count_buttons (const ClutterEvent *event)
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
void
|
||||||
meta_wayland_seat_handle_event (MetaWaylandSeat *seat,
|
meta_wayland_seat_update_pointer (MetaWaylandSeat *seat,
|
||||||
const ClutterEvent *event)
|
const ClutterEvent *event)
|
||||||
{
|
{
|
||||||
|
float x, y;
|
||||||
|
|
||||||
|
clutter_event_get_coords (event, &x, &y);
|
||||||
|
seat->pointer.x = wl_fixed_from_double (x);
|
||||||
|
seat->pointer.y = wl_fixed_from_double (y);
|
||||||
|
|
||||||
seat->pointer.button_count = count_buttons (event);
|
seat->pointer.button_count = count_buttons (event);
|
||||||
|
|
||||||
if (seat->cursor_tracker)
|
if (seat->cursor_tracker)
|
||||||
|
@ -381,7 +382,12 @@ meta_wayland_seat_handle_event (MetaWaylandSeat *seat,
|
||||||
meta_cursor_tracker_queue_redraw (seat->cursor_tracker,
|
meta_cursor_tracker_queue_redraw (seat->cursor_tracker,
|
||||||
CLUTTER_ACTOR (event->any.stage));
|
CLUTTER_ACTOR (event->any.stage));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
meta_wayland_seat_handle_event (MetaWaylandSeat *seat,
|
||||||
|
const ClutterEvent *event)
|
||||||
|
{
|
||||||
switch (event->type)
|
switch (event->type)
|
||||||
{
|
{
|
||||||
case CLUTTER_MOTION:
|
case CLUTTER_MOTION:
|
||||||
|
|
|
@ -77,6 +77,10 @@ MetaWaylandSeat *
|
||||||
meta_wayland_seat_new (struct wl_display *display,
|
meta_wayland_seat_new (struct wl_display *display,
|
||||||
gboolean is_native);
|
gboolean is_native);
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_wayland_seat_update_pointer (MetaWaylandSeat *seat,
|
||||||
|
const ClutterEvent *event);
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_wayland_seat_handle_event (MetaWaylandSeat *seat,
|
meta_wayland_seat_handle_event (MetaWaylandSeat *seat,
|
||||||
const ClutterEvent *event);
|
const ClutterEvent *event);
|
||||||
|
|
|
@ -533,8 +533,9 @@ stage_destroy_cb (void)
|
||||||
meta_quit (META_EXIT_SUCCESS);
|
meta_quit (META_EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
void
|
||||||
reset_idletimes (const ClutterEvent *event)
|
meta_wayland_compositor_update (MetaWaylandCompositor *compositor,
|
||||||
|
const ClutterEvent *event)
|
||||||
{
|
{
|
||||||
ClutterInputDevice *device, *source_device;
|
ClutterInputDevice *device, *source_device;
|
||||||
MetaIdleMonitor *core_monitor, *device_monitor;
|
MetaIdleMonitor *core_monitor, *device_monitor;
|
||||||
|
@ -559,14 +560,23 @@ reset_idletimes (const ClutterEvent *event)
|
||||||
device_monitor = meta_idle_monitor_get_for_device (device_id);
|
device_monitor = meta_idle_monitor_get_for_device (device_id);
|
||||||
meta_idle_monitor_reset_idletime (device_monitor);
|
meta_idle_monitor_reset_idletime (device_monitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch (event->type)
|
||||||
|
{
|
||||||
|
case CLUTTER_MOTION:
|
||||||
|
case CLUTTER_BUTTON_PRESS:
|
||||||
|
case CLUTTER_BUTTON_RELEASE:
|
||||||
|
case CLUTTER_SCROLL:
|
||||||
|
meta_wayland_seat_update_pointer (compositor->seat, event);
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_wayland_compositor_handle_event (MetaWaylandCompositor *compositor,
|
meta_wayland_compositor_handle_event (MetaWaylandCompositor *compositor,
|
||||||
const ClutterEvent *event)
|
const ClutterEvent *event)
|
||||||
{
|
{
|
||||||
reset_idletimes (event);
|
|
||||||
|
|
||||||
return meta_wayland_seat_handle_event (compositor->seat, event);
|
return meta_wayland_seat_handle_event (compositor->seat, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue