Marco Trevisan (Treviño) has proposed merging 
~3v1n0/ubuntu/+source/mutter:ubuntu/bionic into 
~ubuntu-desktop/ubuntu/+source/mutter:ubuntu/bionic.

Requested reviews:
  Ubuntu Desktop (ubuntu-desktop)

For more details, see:
https://code.launchpad.net/~3v1n0/ubuntu/+source/mutter/+git/mutter/+merge/370304
-- 
Your team Ubuntu Desktop is requested to review the proposed merge of 
~3v1n0/ubuntu/+source/mutter:ubuntu/bionic into 
~ubuntu-desktop/ubuntu/+source/mutter:ubuntu/bionic.
diff --git a/debian/changelog b/debian/changelog
index a7cee5b..c2545c2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,6 +20,7 @@ mutter (3.28.4-0ubuntu18.04.2) bionic; urgency=medium
     d/p/window-x11-Don-t-double-check-for-unmanaging-windows.patch,
     d/p/window-x11-Focus-the-default-window-with-delay-while-wait.patch,
     d/p/window-x11-Use-any-focusable-window-as-fallback-delayed-f.patch,
+    d/p/window-x11-Focus-a-window-in-the-active-workspace-as-take.patch,
     d/p/workspace-Focus-only-ancestors-that-are-focusable.patch:
     - Workspace: Take-Input windows focus fixes (LP: #1791574)
   * debian/libmutter-2-0.symbols: Update with new symbols
diff --git a/debian/patches/series b/debian/patches/series
index 8165334..094e978 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -20,6 +20,7 @@ window-x11-Don-t-double-check-for-unmanaging-windows.patch
 window-x11-Accept-any-focusable-window-as-fallback-focus.patch
 stack-Add-a-function-to-get-a-sorted-list-of-focus-candid.patch
 window-x11-Use-any-focusable-window-as-fallback-delayed-f.patch
+window-x11-Focus-a-window-in-the-active-workspace-as-take.patch
 lp1763892-a-renderer-native-Add-hardware-presentation-timing.patch
 lp1763892-b-renderer-native-Advertise-_FEATURE_SWAP_THROTTLE.patch
 debian/synaptics-support.patch
diff --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
new file mode 100644
index 0000000..7a12ac5
--- /dev/null
+++ b/debian/patches/window-x11-Focus-a-window-in-the-active-workspace-as-take.patch
@@ -0,0 +1,68 @@
+From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <[email protected]>
+Date: Wed, 17 Jul 2019 01:13:48 +0200
+Subject: window-x11: Focus a window in the active workspace as take-focus
+ fallback
+
+Starting with commit 2db94e2e we try to focus a fallback default focus window
+if no take-focus window candidate gets the input focus when we request it and
+we limit the focus candidates to the current window's workspace.
+
+However, if the window is unmanaging, the workspace might be unset, and we could
+end up in deferencing a NULL pointer causing a crash.
+
+So, in case the window's workspace is unset, just use the currently active
+workspace for the display.
+
+Closes https://gitlab.gnome.org/GNOME/mutter/issues/687
+
+https://gitlab.gnome.org/GNOME/mutter/merge_requests/688
+
+(cherry picked from commit 5ca0ef078d39548edda1a97e9066d44aa8f38108)
+
+Origin: https://gitlab.gnome.org/GNOME/mutter/merge_requests/688
+Applied-Upstream: 3.28.5
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1791574
+Bug-GNOME: https://gitlab.gnome.org/GNOME/mutter/issues/687
+---
+ src/x11/window-x11.c | 16 +++++++++++-----
+ 1 file changed, 11 insertions(+), 5 deletions(-)
+
+diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c
+index 60b121f..7ca51da 100644
+--- a/src/x11/window-x11.c
++++ b/src/x11/window-x11.c
+@@ -834,15 +834,21 @@ meta_window_x11_maybe_focus_delayed (MetaWindow *window,
+ }
+ 
+ static void
+-maybe_focus_default_window (MetaWorkspace *workspace,
+-                            MetaWindow    *not_this_one,
+-                            guint32        timestamp)
++maybe_focus_default_window (MetaScreen *screen,
++                            MetaWindow *not_this_one,
++                            guint32     timestamp)
+ {
+-  MetaStack *stack = workspace->screen->stack;
++  MetaWorkspace *workspace;
++  MetaStack *stack = screen->stack;
+   g_autoptr (GList) focusable_windows = NULL;
+   g_autoptr (GQueue) focus_candidates = NULL;
+   GList *l;
+ 
++  if (not_this_one && not_this_one->workspace)
++    workspace = not_this_one->workspace;
++  else
++    workspace = screen->active_workspace;
++
+    /* Go through all the focusable windows and try to focus them
+     * in order, waiting for a delay. The first one that replies to
+     * the request (in case of take focus windows) changing the display
+@@ -936,7 +942,7 @@ meta_window_x11_focus (MetaWindow *window,
+                   meta_display_focus_the_no_focus_window (window->display,
+                                                           window->screen,
+                                                           timestamp);
+-                  maybe_focus_default_window (window->workspace, window,
++                  maybe_focus_default_window (window->screen, window,
+                                               timestamp);
+                 }
+             }
-- 
ubuntu-desktop mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-desktop

Reply via email to