Merge ~3v1n0/ubuntu/+source/mutter:ubuntu/bionic into ~ubuntu-desktop/ubuntu/+source/mutter:ubuntu/bionic

Proposed by Marco Trevisan (Treviño)
Status: Merged
Merged at revision: d512c1b736b6c18ef3f85407e554dfe03c0b0224
Proposed branch: ~3v1n0/ubuntu/+source/mutter:ubuntu/bionic
Merge into: ~ubuntu-desktop/ubuntu/+source/mutter:ubuntu/bionic
Diff against target: 98 lines (+70/-0)
3 files modified
debian/changelog (+1/-0)
debian/patches/series (+1/-0)
debian/patches/window-x11-Focus-a-window-in-the-active-workspace-as-take.patch (+68/-0)
Reviewer Review Type Date Requested Status
Ubuntu Desktop Pending
Review via email: mp+370304@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index a7cee5b..c2545c2 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -20,6 +20,7 @@ mutter (3.28.4-0ubuntu18.04.2) bionic; urgency=medium
6 d/p/window-x11-Don-t-double-check-for-unmanaging-windows.patch,
7 d/p/window-x11-Focus-the-default-window-with-delay-while-wait.patch,
8 d/p/window-x11-Use-any-focusable-window-as-fallback-delayed-f.patch,
9+ d/p/window-x11-Focus-a-window-in-the-active-workspace-as-take.patch,
10 d/p/workspace-Focus-only-ancestors-that-are-focusable.patch:
11 - Workspace: Take-Input windows focus fixes (LP: #1791574)
12 * debian/libmutter-2-0.symbols: Update with new symbols
13diff --git a/debian/patches/series b/debian/patches/series
14index 8165334..094e978 100644
15--- a/debian/patches/series
16+++ b/debian/patches/series
17@@ -20,6 +20,7 @@ window-x11-Don-t-double-check-for-unmanaging-windows.patch
18 window-x11-Accept-any-focusable-window-as-fallback-focus.patch
19 stack-Add-a-function-to-get-a-sorted-list-of-focus-candid.patch
20 window-x11-Use-any-focusable-window-as-fallback-delayed-f.patch
21+window-x11-Focus-a-window-in-the-active-workspace-as-take.patch
22 lp1763892-a-renderer-native-Add-hardware-presentation-timing.patch
23 lp1763892-b-renderer-native-Advertise-_FEATURE_SWAP_THROTTLE.patch
24 debian/synaptics-support.patch
25diff --git a/debian/patches/window-x11-Focus-a-window-in-the-active-workspace-as-take.patch b/debian/patches/window-x11-Focus-a-window-in-the-active-workspace-as-take.patch
26new file mode 100644
27index 0000000..7a12ac5
28--- /dev/null
29+++ b/debian/patches/window-x11-Focus-a-window-in-the-active-workspace-as-take.patch
30@@ -0,0 +1,68 @@
31+From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
32+Date: Wed, 17 Jul 2019 01:13:48 +0200
33+Subject: window-x11: Focus a window in the active workspace as take-focus
34+ fallback
35+
36+Starting with commit 2db94e2e we try to focus a fallback default focus window
37+if no take-focus window candidate gets the input focus when we request it and
38+we limit the focus candidates to the current window's workspace.
39+
40+However, if the window is unmanaging, the workspace might be unset, and we could
41+end up in deferencing a NULL pointer causing a crash.
42+
43+So, in case the window's workspace is unset, just use the currently active
44+workspace for the display.
45+
46+Closes https://gitlab.gnome.org/GNOME/mutter/issues/687
47+
48+https://gitlab.gnome.org/GNOME/mutter/merge_requests/688
49+
50+(cherry picked from commit 5ca0ef078d39548edda1a97e9066d44aa8f38108)
51+
52+Origin: https://gitlab.gnome.org/GNOME/mutter/merge_requests/688
53+Applied-Upstream: 3.28.5
54+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1791574
55+Bug-GNOME: https://gitlab.gnome.org/GNOME/mutter/issues/687
56+---
57+ src/x11/window-x11.c | 16 +++++++++++-----
58+ 1 file changed, 11 insertions(+), 5 deletions(-)
59+
60+diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c
61+index 60b121f..7ca51da 100644
62+--- a/src/x11/window-x11.c
63++++ b/src/x11/window-x11.c
64+@@ -834,15 +834,21 @@ meta_window_x11_maybe_focus_delayed (MetaWindow *window,
65+ }
66+
67+ static void
68+-maybe_focus_default_window (MetaWorkspace *workspace,
69+- MetaWindow *not_this_one,
70+- guint32 timestamp)
71++maybe_focus_default_window (MetaScreen *screen,
72++ MetaWindow *not_this_one,
73++ guint32 timestamp)
74+ {
75+- MetaStack *stack = workspace->screen->stack;
76++ MetaWorkspace *workspace;
77++ MetaStack *stack = screen->stack;
78+ g_autoptr (GList) focusable_windows = NULL;
79+ g_autoptr (GQueue) focus_candidates = NULL;
80+ GList *l;
81+
82++ if (not_this_one && not_this_one->workspace)
83++ workspace = not_this_one->workspace;
84++ else
85++ workspace = screen->active_workspace;
86++
87+ /* Go through all the focusable windows and try to focus them
88+ * in order, waiting for a delay. The first one that replies to
89+ * the request (in case of take focus windows) changing the display
90+@@ -936,7 +942,7 @@ meta_window_x11_focus (MetaWindow *window,
91+ meta_display_focus_the_no_focus_window (window->display,
92+ window->screen,
93+ timestamp);
94+- maybe_focus_default_window (window->workspace, window,
95++ maybe_focus_default_window (window->screen, window,
96+ timestamp);
97+ }
98+ }

Subscribers

People subscribed via source and target branches