kathenas / rpms / mutter

Forked from rpms/mutter 5 years ago
Clone

Blame SOURCES/covscan-fixes.patch

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