backend: Init pointer position with clutter_seat_init_pointer_position()

Also fix a function name and remove an unused struct field.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3070>
This commit is contained in:
Jonas Ådahl 2023-06-12 16:23:11 +02:00 committed by Marge Bot
parent 060c4c2dfc
commit af078264fa

View File

@ -154,8 +154,6 @@ struct _MetaBackendPrivate
GList *gpus; GList *gpus;
GList *hw_cursor_inhibitors; GList *hw_cursor_inhibitors;
gboolean is_pointer_position_initialized;
guint device_update_idle_id; guint device_update_idle_id;
ClutterInputDevice *current_device; ClutterInputDevice *current_device;
@ -267,7 +265,7 @@ meta_backend_sync_screen_size (MetaBackend *backend)
} }
static void static void
reset_pointer_position (MetaBackend *backend) init_pointer_position (MetaBackend *backend)
{ {
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend); MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
MetaMonitorManager *monitor_manager = priv->monitor_manager; MetaMonitorManager *monitor_manager = priv->monitor_manager;
@ -279,9 +277,9 @@ reset_pointer_position (MetaBackend *backend)
/* Move the pointer out of the way to avoid hovering over reactive /* Move the pointer out of the way to avoid hovering over reactive
* elements (e.g. users list at login) causing undesired behaviour. */ * elements (e.g. users list at login) causing undesired behaviour. */
clutter_seat_warp_pointer (seat, clutter_seat_init_pointer_position (seat,
primary->rect.x + primary->rect.width * 0.9, primary->rect.x + primary->rect.width * 0.9,
primary->rect.y + primary->rect.height * 0.9); primary->rect.y + primary->rect.height * 0.9);
} }
static gboolean static gboolean
@ -574,10 +572,7 @@ meta_backend_real_post_init (MetaBackend *backend)
#endif /* HAVE_REMOTE_DESKTOP */ #endif /* HAVE_REMOTE_DESKTOP */
if (!meta_monitor_manager_is_headless (priv->monitor_manager)) if (!meta_monitor_manager_is_headless (priv->monitor_manager))
{ init_pointer_position (backend);
reset_pointer_position (backend);
priv->is_pointer_position_initialized = TRUE;
}
meta_monitor_manager_post_init (priv->monitor_manager); meta_monitor_manager_post_init (priv->monitor_manager);