1c7749
From 55417eea4294210495eceebd6dd4b832f371f054 Mon Sep 17 00:00:00 2001
1c7749
From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= <verdre@v0yd.nl>
1c7749
Date: Sun, 14 Apr 2019 17:15:06 +0200
1c7749
Subject: [PATCH 1/5] display: Fix a possible bug in
1c7749
 meta_display_sync_wayland_focus
1c7749
1c7749
The check for the focus xwindow is called, but not used. Fix that by
1c7749
renaming the variable to reflect better what it does and actually using
1c7749
the return value of the check.
1c7749
1c7749
This was the original intention of the author in commit
1c7749
05899596d10918df5359d89baa82e6fedd0ae208 and got broken in commit
1c7749
8e7e1eeef59c4f74046e6783b6334c1432255c5a.
1c7749
1c7749
https://gitlab.gnome.org/GNOME/mutter/merge_requests/535
1c7749
---
1c7749
 src/core/display.c | 8 ++++----
1c7749
 1 file changed, 4 insertions(+), 4 deletions(-)
1c7749
1c7749
diff --git a/src/core/display.c b/src/core/display.c
1c7749
index 0de99edb2..4c8907f40 100644
1c7749
--- a/src/core/display.c
1c7749
+++ b/src/core/display.c
1c7749
@@ -1208,15 +1208,15 @@ meta_display_sync_wayland_input_focus (MetaDisplay *display)
1c7749
   MetaWindow *focus_window = NULL;
1c7749
   MetaBackend *backend = meta_get_backend ();
1c7749
   MetaStage *stage = META_STAGE (meta_backend_get_stage (backend));
1c7749
-  gboolean is_focus_xwindow = FALSE;
1c7749
+  gboolean is_no_focus_xwindow = FALSE;
1c7749
 
1c7749
   if (display->x11_display)
1c7749
-    meta_x11_display_xwindow_is_a_no_focus_window (display->x11_display,
1c7749
-                                                   display->x11_display->focus_xwindow);
1c7749
+    is_no_focus_xwindow = meta_x11_display_xwindow_is_a_no_focus_window (display->x11_display,
1c7749
+                                                                         display->x11_display->focus_xwindow);
1c7749
 
1c7749
   if (!meta_display_windows_are_interactable (display))
1c7749
     focus_window = NULL;
1c7749
-  else if (is_focus_xwindow)
1c7749
+  else if (is_no_focus_xwindow)
1c7749
     focus_window = NULL;
1c7749
   else if (display->focus_window && display->focus_window->surface)
1c7749
     focus_window = display->focus_window;
1c7749
-- 
1c7749
2.21.0
1c7749
1c7749
1c7749
From 17cc0a2a21c504b8631bf2ce0f508f611f9b1d3e Mon Sep 17 00:00:00 2001
1c7749
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
1c7749
Date: Mon, 27 May 2019 20:03:25 +0000
1c7749
Subject: [PATCH 2/5] renderer-x11-nested: Fix copy-and-paste error
1c7749
1c7749
The rounding added in commit c5471e5b8b1 mixed up some variables,
1c7749
whoops.
1c7749
1c7749
https://gitlab.gnome.org/GNOME/mutter/merge_requests/598
1c7749
---
1c7749
 src/backends/x11/nested/meta-renderer-x11-nested.c | 2 +-
1c7749
 1 file changed, 1 insertion(+), 1 deletion(-)
1c7749
1c7749
diff --git a/src/backends/x11/nested/meta-renderer-x11-nested.c b/src/backends/x11/nested/meta-renderer-x11-nested.c
1c7749
index 71a85a8c2..5000bf357 100644
1c7749
--- a/src/backends/x11/nested/meta-renderer-x11-nested.c
1c7749
+++ b/src/backends/x11/nested/meta-renderer-x11-nested.c
1c7749
@@ -203,7 +203,7 @@ meta_renderer_x11_nested_create_view (MetaRenderer       *renderer,
1c7749
       height = logical_monitor->rect.height;
1c7749
     }
1c7749
   width = roundf (width * view_scale);
1c7749
-  height = roundf (width * view_scale);
1c7749
+  height = roundf (height * view_scale);
1c7749
 
1c7749
   fake_onscreen = create_offscreen (cogl_context, width, height);
1c7749
 
1c7749
-- 
1c7749
2.21.0
1c7749
1c7749
1c7749
From a58fabbb0e3173359d3374b931815c21ce65032d Mon Sep 17 00:00:00 2001
1c7749
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
1c7749
Date: Mon, 27 May 2019 19:59:53 +0000
1c7749
Subject: [PATCH 3/5] input-mapper: Remove unnecessary return value
1c7749
1c7749
Since commit ae6d9e35bd, there is a fallback to META_MATCH_IS_BUILTIN,
1c7749
so the condition for returning FALSE is never met.
1c7749
1c7749
https://gitlab.gnome.org/GNOME/mutter/merge_requests/598
1c7749
---
1c7749
 src/backends/meta-input-mapper.c | 15 +++------------
1c7749
 1 file changed, 3 insertions(+), 12 deletions(-)
1c7749
1c7749
diff --git a/src/backends/meta-input-mapper.c b/src/backends/meta-input-mapper.c
1c7749
index acc9b1618..fc4f3bd59 100644
1c7749
--- a/src/backends/meta-input-mapper.c
1c7749
+++ b/src/backends/meta-input-mapper.c
1c7749
@@ -353,7 +353,7 @@ find_builtin_output (MetaInputMapper  *mapper,
1c7749
   return panel != NULL;
1c7749
 }
1c7749
 
1c7749
-static gboolean
1c7749
+static void
1c7749
 guess_candidates (MetaInputMapper     *mapper,
1c7749
                   MetaMapperInputInfo *input,
1c7749
                   DeviceCandidates    *info)
1c7749
@@ -387,15 +387,7 @@ guess_candidates (MetaInputMapper     *mapper,
1c7749
       find_builtin_output (mapper, &info->candidates[META_MATCH_IS_BUILTIN]);
1c7749
     }
1c7749
 
1c7749
-  if (best < N_OUTPUT_MATCHES)
1c7749
-    {
1c7749
-      info->best = best;
1c7749
-      return TRUE;
1c7749
-    }
1c7749
-  else
1c7749
-    {
1c7749
-      return FALSE;
1c7749
-    }
1c7749
+  info->best = best;
1c7749
 }
1c7749
 
1c7749
 static void
1c7749
@@ -408,8 +400,7 @@ mapping_helper_add (MappingHelper       *helper,
1c7749
 
1c7749
   info.input = input;
1c7749
 
1c7749
-  if (!guess_candidates (mapper, input, &info))
1c7749
-    return;
1c7749
+  guess_candidates (mapper, input, &info;;
1c7749
 
1c7749
   for (i = 0; i < helper->device_maps->len; i++)
1c7749
     {
1c7749
-- 
1c7749
2.21.0
1c7749
1c7749
1c7749
From 4eb025cf36a9118cc496ae9143ee2eb510b6228c Mon Sep 17 00:00:00 2001
1c7749
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
1c7749
Date: Mon, 27 May 2019 20:22:50 +0000
1c7749
Subject: [PATCH 4/5] workspace-manager: Remove unnecessary assignment
1c7749
1c7749
The initialization to -1 is never used, instead the variables are
1c7749
re-initialized to 0 before the loop that uses them.
1c7749
1c7749
https://gitlab.gnome.org/GNOME/mutter/merge_requests/598
1c7749
---
1c7749
 src/core/meta-workspace-manager.c | 2 --
1c7749
 1 file changed, 2 deletions(-)
1c7749
1c7749
diff --git a/src/core/meta-workspace-manager.c b/src/core/meta-workspace-manager.c
1c7749
index af7344709..8e1f03fe8 100644
1c7749
--- a/src/core/meta-workspace-manager.c
1c7749
+++ b/src/core/meta-workspace-manager.c
1c7749
@@ -600,8 +600,6 @@ meta_workspace_manager_calc_workspace_layout (MetaWorkspaceManager *workspace_ma
1c7749
 
1c7749
   grid = g_new (int, grid_area);
1c7749
 
1c7749
-  current_row = -1;
1c7749
-  current_col = -1;
1c7749
   i = 0;
1c7749
 
1c7749
   switch (workspace_manager->starting_corner)
1c7749
-- 
1c7749
2.21.0
1c7749
1c7749
1c7749
From a854a337ac8807f310ac2c474f9be290089f79f3 Mon Sep 17 00:00:00 2001
1c7749
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
1c7749
Date: Mon, 27 May 2019 20:43:21 +0000
1c7749
Subject: [PATCH 5/5] x11-display: Simplify bell handling
1c7749
1c7749
Since commit 956ab4bd made libcanberra mandatory, we never use
1c7749
the system bell for handling the `audible-bell` setting. So
1c7749
instead of reacting to settings changes with the exact same call
1c7749
to XkbChangeEnabledControls(), just call it once when initializing.
1c7749
1c7749
https://gitlab.gnome.org/GNOME/mutter/merge_requests/598
1c7749
---
1c7749
 src/x11/meta-x11-display.c | 39 +++++++-------------------------------
1c7749
 1 file changed, 7 insertions(+), 32 deletions(-)
1c7749
1c7749
diff --git a/src/x11/meta-x11-display.c b/src/x11/meta-x11-display.c
1c7749
index 8ce12b994..065ffcdda 100644
1c7749
--- a/src/x11/meta-x11-display.c
1c7749
+++ b/src/x11/meta-x11-display.c
1c7749
@@ -463,6 +463,13 @@ init_x11_bell (MetaX11Display *x11_display)
1c7749
                                    &mask);
1c7749
         }
1c7749
     }
1c7749
+
1c7749
+  /* We are playing sounds using libcanberra support, we handle the
1c7749
+   * bell whether its an audible bell or a visible bell */
1c7749
+  XkbChangeEnabledControls (x11_display->xdisplay,
1c7749
+                            XkbUseCoreKbd,
1c7749
+                            XkbAudibleBellMask,
1c7749
+                            0);
1c7749
 }
1c7749
 
1c7749
 /*
1c7749
@@ -480,32 +487,6 @@ shutdown_x11_bell (MetaX11Display *x11_display)
1c7749
                             XkbAudibleBellMask);
1c7749
 }
1c7749
 
1c7749
-/*
1c7749
- * Turns the bell to audible or visual. This tells X what to do, but
1c7749
- * not Mutter; you will need to set the "visual bell" pref for that.
1c7749
- */
1c7749
-static void
1c7749
-set_x11_bell_is_audible (MetaX11Display *x11_display,
1c7749
-                         gboolean is_audible)
1c7749
-{
1c7749
-  /* When we are playing sounds using libcanberra support, we handle the
1c7749
-   * bell whether its an audible bell or a visible bell */
1c7749
-  gboolean enable_system_bell = FALSE;
1c7749
-
1c7749
-  XkbChangeEnabledControls (x11_display->xdisplay,
1c7749
-                            XkbUseCoreKbd,
1c7749
-                            XkbAudibleBellMask,
1c7749
-                            enable_system_bell ? XkbAudibleBellMask : 0);
1c7749
-}
1c7749
-
1c7749
-static void
1c7749
-on_is_audible_changed (MetaBell       *bell,
1c7749
-                       gboolean        is_audible,
1c7749
-                       MetaX11Display *x11_display)
1c7749
-{
1c7749
-  set_x11_bell_is_audible (x11_display, is_audible);
1c7749
-}
1c7749
-
1c7749
 static void
1c7749
 set_desktop_geometry_hint (MetaX11Display *x11_display)
1c7749
 {
1c7749
@@ -1320,12 +1301,6 @@ meta_x11_display_new (MetaDisplay *display, GError **error)
1c7749
 
1c7749
   init_x11_bell (x11_display);
1c7749
 
1c7749
-  g_signal_connect_object (display->bell, "is-audible-changed",
1c7749
-                           G_CALLBACK (on_is_audible_changed),
1c7749
-                           x11_display, 0);
1c7749
-
1c7749
-  set_x11_bell_is_audible (x11_display, meta_prefs_bell_is_audible ());
1c7749
-
1c7749
   meta_x11_startup_notification_init (x11_display);
1c7749
 
1c7749
   return x11_display;
1c7749
-- 
1c7749
2.21.0
1c7749