From f21312e2fd3793ff7566d9a301e6927b6840697f Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Tue, 11 Mar 2014 17:22:08 -0400 Subject: [PATCH] meta-weston-launch: Redraw and update the cursor when switching back --- src/core/meta-cursor-tracker-private.h | 3 +++ src/core/meta-cursor-tracker.c | 9 +++++++++ src/wayland/meta-weston-launch.c | 11 +++++++++++ 3 files changed, 23 insertions(+) diff --git a/src/core/meta-cursor-tracker-private.h b/src/core/meta-cursor-tracker-private.h index b089f0f80..deaa5acd1 100644 --- a/src/core/meta-cursor-tracker-private.h +++ b/src/core/meta-cursor-tracker-private.h @@ -43,4 +43,7 @@ void meta_cursor_tracker_update_position (MetaCursorTracker *tracker, int new_x, int new_y); void meta_cursor_tracker_paint (MetaCursorTracker *tracker); + +void meta_cursor_tracker_force_update (MetaCursorTracker *tracker); + #endif diff --git a/src/core/meta-cursor-tracker.c b/src/core/meta-cursor-tracker.c index 347544bc2..e98f2e72a 100644 --- a/src/core/meta-cursor-tracker.c +++ b/src/core/meta-cursor-tracker.c @@ -1147,3 +1147,12 @@ meta_cursor_tracker_set_pointer_visible (MetaCursorTracker *tracker, tracker->screen->xroot); } } + +void +meta_cursor_tracker_force_update (MetaCursorTracker *tracker) +{ + g_assert (meta_is_wayland_compositor ()); + + update_hw_cursor (tracker); + sync_cursor (tracker); +} diff --git a/src/wayland/meta-weston-launch.c b/src/wayland/meta-weston-launch.c index c70a71967..a33ed4957 100644 --- a/src/wayland/meta-weston-launch.c +++ b/src/wayland/meta-weston-launch.c @@ -232,6 +232,17 @@ meta_launcher_enter (MetaLauncher *launcher) cogl_kms_display_queue_modes_reset (cogl_display); clutter_evdev_reclaim_devices (); + + { + MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default (); + + /* When we mode-switch back, we need to immediately queue a redraw + * in case nothing else queued one for us, and force the cursor to + * update. */ + + clutter_actor_queue_redraw (compositor->stage); + meta_cursor_tracker_force_update (compositor->seat->cursor_tracker); + } } static void