From 4e4b24e7a87ac4f331d9e4447e9bfddaf9e64c55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 6 Mar 2017 16:26:50 +0800 Subject: [PATCH] backends/x11: Fallback to the first logical monitor when out of focus When running nested, the pointer can be outside of the stage, meaning outside of any logical monitor. Handle this when getting the current logical monitor by falling back to the first logical monitor when the pointer coordinate is outside of any logical monitor. https://bugzilla.gnome.org/show_bug.cgi?id=779001 --- src/backends/x11/meta-backend-x11.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backends/x11/meta-backend-x11.c b/src/backends/x11/meta-backend-x11.c index 0306232e0..83d30d892 100644 --- a/src/backends/x11/meta-backend-x11.c +++ b/src/backends/x11/meta-backend-x11.c @@ -535,6 +535,9 @@ meta_backend_x11_get_current_logical_monitor (MetaBackend *backend) logical_monitor = meta_monitor_manager_get_logical_monitor_at (monitor_manager, x, y); + if (!logical_monitor && monitor_manager->logical_monitors) + logical_monitor = monitor_manager->logical_monitors->data; + priv->cached_current_logical_monitor = logical_monitor; return priv->cached_current_logical_monitor; }