From 5a9d094f3ea924d4fec88ff3cba9af5de5252e4e Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Tue, 8 Jan 2019 17:14:24 +0100 Subject: [PATCH 1/3] shell: Use MetaDisplay input focus API Replaces use of (now removed) MetaX11Display focus API (which happened to work for wayland too). https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/378 --- src/shell-app.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/shell-app.c b/src/shell-app.c index 10efa9135f..752316051e 100644 --- a/src/shell-app.c +++ b/src/shell-app.c @@ -1151,11 +1151,10 @@ _shell_app_handle_startup_sequence (ShellApp *app, if (starting && shell_app_get_state (app) == SHELL_APP_STATE_STOPPED) { MetaDisplay *display = shell_global_get_display (shell_global_get ()); - MetaX11Display *x11_display = meta_display_get_x11_display (display); shell_app_state_transition (app, SHELL_APP_STATE_STARTING); - meta_x11_display_focus_the_no_focus_window (x11_display, - meta_startup_sequence_get_timestamp (sequence)); + meta_display_unset_input_focus (display, + meta_startup_sequence_get_timestamp (sequence)); app->started_on_workspace = meta_startup_sequence_get_workspace (sequence); } -- GitLab From 771b1a0788198bfb9e82fd07c43d81413913cbfe Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 31 Jan 2019 12:02:39 +0100 Subject: [PATCH 2/3] shell: Do not set XFixes input region on wayland compositors This is just needed on the X11 compositor, wayland compositors are known for handling their own input. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/378 --- js/ui/layout.js | 3 +-- src/shell-global.c | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/js/ui/layout.js b/js/ui/layout.js index b98827a3ca..6f6677d642 100644 --- a/js/ui/layout.js +++ b/js/ui/layout.js @@ -1072,8 +1072,7 @@ var LayoutManager = GObject.registerClass({ } } - if (!Meta.is_wayland_compositor()) - global.set_stage_input_region(rects); + global.set_stage_input_region(rects); this._isPopupWindowVisible = isPopupMenuVisible; let workspaceManager = global.workspace_manager; diff --git a/src/shell-global.c b/src/shell-global.c index 4295162a86..4ad23fdac0 100644 --- a/src/shell-global.c +++ b/src/shell-global.c @@ -642,6 +642,9 @@ shell_global_set_stage_input_region (ShellGlobal *global, g_return_if_fail (SHELL_IS_GLOBAL (global)); + if (meta_is_wayland_compositor ()) + return; + nrects = g_slist_length (rectangles); rects = g_new (XRectangle, nrects); for (r = rectangles, i = 0; r; r = r->next, i++) -- GitLab From dd5d7d3b70779584a9cf023bac5ce8f3893a11d4 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 31 Jan 2019 12:03:34 +0100 Subject: [PATCH 3/3] shell: Only initialize global->xdisplay on X11 compositors This is just used to set up things that are relevant to X11 compositors (XDND, XFixes input region). We can live with it unset on the wayland compositor cases. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/378 --- src/shell-global.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/shell-global.c b/src/shell-global.c index 4ad23fdac0..e696a324c8 100644 --- a/src/shell-global.c +++ b/src/shell-global.c @@ -61,8 +61,6 @@ struct _ShellGlobal { MetaDisplay *meta_display; MetaWorkspaceManager *workspace_manager; - GdkDisplay *gdk_display; - MetaX11Display *x11_display; Display *xdisplay; char *session_mode; @@ -849,10 +847,6 @@ _shell_global_set_plugin (ShellGlobal *global, display = meta_plugin_get_display (plugin); global->meta_display = display; global->workspace_manager = meta_display_get_workspace_manager (display); - global->x11_display = meta_display_get_x11_display (display); - global->xdisplay = meta_x11_display_get_xdisplay (global->x11_display); - - global->gdk_display = gdk_x11_lookup_xdisplay (global->xdisplay); global->stage = CLUTTER_STAGE (meta_get_stage_for_display (display)); @@ -862,6 +856,8 @@ _shell_global_set_plugin (ShellGlobal *global, } else { + MetaX11Display *x11_display = meta_display_get_x11_display (display); + global->xdisplay = meta_x11_display_get_xdisplay (x11_display); global->stage_xwindow = clutter_x11_get_stage_window (global->stage); } -- GitLab