summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Sanchez Prada <mario@endlessm.com>2018-04-16 21:01:12 +0100
committerRay Strode <halfline@gmail.com>2018-04-18 19:14:26 +0000
commita95cbd0acae15d8c3aeb23da583e4ece60110d87 (patch)
treec1aa422f62dabc01567429f8af75f34d17b6ec63
parent6df2b7af556bf01f8d564b86c66c293678ab6b90 (diff)
downloadmutter-a95cbd0acae15d8c3aeb23da583e4ece60110d87.tar.gz
backends: Don't center the pointer on initialization
Centering the pointer at startup causes undesired behaviour if it ends up hovering over reactive elements, that might react to that positioning, causing confusion. This is the case of the login dialog when a list of different users is shown, as centering the pointer at startup in that case will get the user in the center of the screen pre-selected, which is not the expected behaviour (i.e. pre-selecting the first one). Fix this by simply moving the pointer out of the way, close to the bottom-right corner, during initialization. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/157
-rw-r--r--src/backends/meta-backend.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c
index 1c44b9c7f..a5d3c9a6c 100644
--- a/src/backends/meta-backend.c
+++ b/src/backends/meta-backend.c
@@ -479,7 +479,18 @@ meta_backend_real_post_init (MetaBackend *backend)
if (!meta_monitor_manager_is_headless (priv->monitor_manager))
{
- center_pointer (backend);
+ MetaMonitorManager *monitor_manager = priv->monitor_manager;
+ MetaLogicalMonitor *primary;
+
+ primary =
+ meta_monitor_manager_get_primary_logical_monitor (monitor_manager);
+
+ /* Move the pointer out of the way to avoid hovering over reactive
+ * elements (e.g. users list at login) causing undesired behaviour. */
+ meta_backend_warp_pointer (backend,
+ primary->rect.x + primary->rect.width * 0.9,
+ primary->rect.y + primary->rect.height * 0.9);
+
priv->is_pointer_position_initialized = TRUE;
}
}