Accepting request 887992 from GNOME:Factory

- Rebase mutter-SLE-bsc984738-grab-display.patch and
  mutter-SLE-bell.patch. (forwarded request 887904 from AZhou)

OBS-URL: https://build.opensuse.org/request/show/887992
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mutter?expand=0&rev=162
This commit is contained in:
Dominique Leuenberger 2021-04-24 21:07:11 +00:00 committed by Git OBS Bridge
commit 383c21d040
4 changed files with 186 additions and 183 deletions

View File

@ -1,110 +1,7 @@
Index: mutter-3.34.1+24/src/meta/prefs.h
===================================================================
--- mutter-3.34.1+24.orig/src/meta/prefs.h
+++ mutter-3.34.1+24/src/meta/prefs.h
@@ -91,6 +91,7 @@ typedef enum
META_PREF_WORKSPACE_NAMES,
META_PREF_VISUAL_BELL,
META_PREF_AUDIBLE_BELL,
+ META_PREF_AUDIBLE_BELL_FORCE_THROUGH_SERVER,
META_PREF_VISUAL_BELL_TYPE,
META_PREF_GNOME_ACCESSIBILITY,
META_PREF_GNOME_ANIMATIONS,
@@ -479,6 +480,9 @@ META_EXPORT
gboolean meta_prefs_bell_is_audible (void);
META_EXPORT
+gboolean meta_prefs_bell_force_through_server (void);
+
+META_EXPORT
GDesktopVisualBellType meta_prefs_get_visual_bell_type (void);
#endif
Index: mutter-3.34.1+24/src/core/prefs.c
===================================================================
--- mutter-3.34.1+24.orig/src/core/prefs.c
+++ mutter-3.34.1+24/src/core/prefs.c
@@ -99,6 +99,7 @@ static gboolean auto_raise_delay = 500;
static gboolean focus_change_on_pointer_rest = FALSE;
static gboolean bell_is_visible = FALSE;
static gboolean bell_is_audible = TRUE;
+static gboolean bell_force_through_server = FALSE;
static gboolean gnome_accessibility = FALSE;
static gboolean gnome_animations = TRUE;
static gboolean locate_pointer_is_enabled = FALSE;
@@ -346,6 +347,13 @@ static MetaBoolPreference preferences_bo
&bell_is_audible, /* FIXME: change the name: it's confusing */
},
{
+ { "audible-bell-force-through-server",
+ SCHEMA_MUTTER,
+ META_PREF_AUDIBLE_BELL_FORCE_THROUGH_SERVER,
+ },
+ &bell_force_through_server,
+ },
+ {
{ KEY_GNOME_ACCESSIBILITY,
SCHEMA_INTERFACE,
META_PREF_GNOME_ACCESSIBILITY,
@@ -1654,6 +1662,9 @@ meta_preference_to_string (MetaPreferenc
case META_PREF_AUDIBLE_BELL:
return "AUDIBLE_BELL";
+ case META_PREF_AUDIBLE_BELL_FORCE_THROUGH_SERVER:
+ return "AUDIBLE_BELL_FORCE_THROUGH_SERVER";
+
case META_PREF_VISUAL_BELL_TYPE:
return "VISUAL_BELL_TYPE";
@@ -1929,6 +1940,12 @@ meta_prefs_bell_is_audible (void)
return bell_is_audible;
}
+gboolean
+meta_prefs_bell_force_through_server (void)
+{
+ return bell_force_through_server;
+}
+
GDesktopVisualBellType
meta_prefs_get_visual_bell_type (void)
{
Index: mutter-3.34.1+24/src/core/bell.c
===================================================================
--- mutter-3.34.1+24.orig/src/core/bell.c
+++ mutter-3.34.1+24/src/core/bell.c
@@ -54,6 +54,11 @@
#include "core/window-private.h"
#include "meta/compositor.h"
+#include "meta/display.h"
+#include "meta/meta-x11-display.h"
+#include <X11/Xlib.h>
+#include <X11/XKBlib.h>
+
G_DEFINE_TYPE (MetaBell, meta_bell, G_TYPE_OBJECT)
enum
@@ -202,6 +207,14 @@ meta_bell_notify (MetaDisplay *display,
if (meta_prefs_get_visual_bell ())
bell_visual_notify (display, window);
+ if (meta_prefs_bell_force_through_server ())
+ {
+ MetaX11Display *x11_display = meta_display_get_x11_display (display);
+ Display *xdisplay = meta_x11_display_get_xdisplay (x11_display);
+ XkbForceBell (xdisplay, 100);
+ return TRUE;
+ }
+
if (meta_prefs_bell_is_audible ())
return bell_audible_notify (display, window);
Index: mutter-3.34.1+24/data/org.gnome.mutter.gschema.xml.in
===================================================================
--- mutter-3.34.1+24.orig/data/org.gnome.mutter.gschema.xml.in
+++ mutter-3.34.1+24/data/org.gnome.mutter.gschema.xml.in
@@ -137,6 +137,16 @@
diff --unified --recursive --text --new-file --color mutter-40.0.old/data/org.gnome.mutter.gschema.xml.in mutter-40.0.new/data/org.gnome.mutter.gschema.xml.in
--- mutter-40.0.old/data/org.gnome.mutter.gschema.xml.in 2021-04-23 08:52:33.870911873 +0800
+++ mutter-40.0.new/data/org.gnome.mutter.gschema.xml.in 2021-04-23 08:53:11.404056017 +0800
@@ -156,6 +156,16 @@
</description>
</key>
@ -121,3 +18,102 @@ Index: mutter-3.34.1+24/data/org.gnome.mutter.gschema.xml.in
<child name="keybindings" schema="org.gnome.mutter.keybindings"/>
</schema>
diff --unified --recursive --text --new-file --color mutter-40.0.old/src/core/bell.c mutter-40.0.new/src/core/bell.c
--- mutter-40.0.old/src/core/bell.c 2021-04-23 08:52:33.877578506 +0800
+++ mutter-40.0.new/src/core/bell.c 2021-04-23 08:53:11.404056017 +0800
@@ -54,6 +54,11 @@
#include "core/window-private.h"
#include "meta/compositor.h"
+#include "meta/display.h"
+#include "meta/meta-x11-display.h"
+#include <X11/Xlib.h>
+#include <X11/XKBlib.h>
+
G_DEFINE_TYPE (MetaBell, meta_bell, G_TYPE_OBJECT)
enum
@@ -202,6 +207,14 @@
if (meta_prefs_get_visual_bell ())
bell_visual_notify (display, window);
+ if (meta_prefs_bell_force_through_server ())
+ {
+ MetaX11Display *x11_display = meta_display_get_x11_display (display);
+ Display *xdisplay = meta_x11_display_get_xdisplay (x11_display);
+ XkbForceBell (xdisplay, 100);
+ return TRUE;
+ }
+
if (meta_prefs_bell_is_audible ())
return bell_audible_notify (display, window);
diff --unified --recursive --text --new-file --color mutter-40.0.old/src/core/prefs.c mutter-40.0.new/src/core/prefs.c
--- mutter-40.0.old/src/core/prefs.c 2021-04-23 08:52:33.877578506 +0800
+++ mutter-40.0.new/src/core/prefs.c 2021-04-23 08:53:11.404056017 +0800
@@ -98,6 +98,7 @@
static gboolean focus_change_on_pointer_rest = FALSE;
static gboolean bell_is_visible = FALSE;
static gboolean bell_is_audible = TRUE;
+static gboolean bell_force_through_server = FALSE;
static gboolean gnome_accessibility = FALSE;
static gboolean gnome_animations = TRUE;
static gboolean locate_pointer_is_enabled = FALSE;
@@ -352,6 +353,13 @@
&bell_is_audible, /* FIXME: change the name: it's confusing */
},
{
+ { "audible-bell-force-through-server",
+ SCHEMA_MUTTER,
+ META_PREF_AUDIBLE_BELL_FORCE_THROUGH_SERVER,
+ },
+ &bell_force_through_server,
+ },
+ {
{ KEY_GNOME_ACCESSIBILITY,
SCHEMA_INTERFACE,
META_PREF_GNOME_ACCESSIBILITY,
@@ -1714,6 +1722,9 @@
case META_PREF_AUDIBLE_BELL:
return "AUDIBLE_BELL";
+ case META_PREF_AUDIBLE_BELL_FORCE_THROUGH_SERVER:
+ return "AUDIBLE_BELL_FORCE_THROUGH_SERVER";
+
case META_PREF_VISUAL_BELL_TYPE:
return "VISUAL_BELL_TYPE";
@@ -1992,6 +2003,12 @@
return bell_is_audible;
}
+gboolean
+meta_prefs_bell_force_through_server (void)
+{
+ return bell_force_through_server;
+}
+
GDesktopVisualBellType
meta_prefs_get_visual_bell_type (void)
{
diff --unified --recursive --text --new-file --color mutter-40.0.old/src/meta/prefs.h mutter-40.0.new/src/meta/prefs.h
--- mutter-40.0.old/src/meta/prefs.h 2021-04-23 08:52:33.877578506 +0800
+++ mutter-40.0.new/src/meta/prefs.h 2021-04-23 08:53:11.404056017 +0800
@@ -91,6 +91,7 @@
META_PREF_WORKSPACE_NAMES,
META_PREF_VISUAL_BELL,
META_PREF_AUDIBLE_BELL,
+ META_PREF_AUDIBLE_BELL_FORCE_THROUGH_SERVER,
META_PREF_VISUAL_BELL_TYPE,
META_PREF_GNOME_ACCESSIBILITY,
META_PREF_GNOME_ANIMATIONS,
@@ -480,6 +481,9 @@
gboolean meta_prefs_bell_is_audible (void);
META_EXPORT
+gboolean meta_prefs_bell_force_through_server (void);
+
+META_EXPORT
GDesktopVisualBellType meta_prefs_get_visual_bell_type (void);
META_EXPORT

View File

@ -1,38 +1,16 @@
diff --git a/src/core/display-private.h b/src/core/display-private.h
index 531c6f7..aaa90ec 100644
--- a/src/core/display-private.h
+++ b/src/core/display-private.h
@@ -174,6 +174,8 @@ struct _MetaDisplay
GHashTable *stamps;
GHashTable *wayland_windows;
diff --unified --recursive --text --new-file --color mutter-40.0.old/src/core/display.c mutter-40.0.new/src/core/display.c
--- mutter-40.0.old/src/core/display.c 2021-04-23 08:52:33.877578506 +0800
+++ mutter-40.0.new/src/core/display.c 2021-04-23 09:07:24.330113775 +0800
@@ -827,6 +827,8 @@
display->check_fullscreen_later = 0;
display->work_area_later = 0;
+ int server_grab_count;
+
/* serials of leave/unmap events that may
* correspond to an enter event we should
* ignore
@@ -322,6 +324,8 @@ struct _MetaDisplayClass
gboolean meta_display_open (void);
void meta_display_close (MetaDisplay *display,
guint32 timestamp);
+void meta_display_grab (MetaDisplay *display);
+void meta_display_ungrab (MetaDisplay *display);
void meta_display_unmanage_windows_for_screen (MetaDisplay *display,
MetaScreen *screen,
diff --git a/src/core/display.c b/src/core/display.c
index 4c7a00e..87e3307 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -585,6 +585,7 @@ meta_display_open (void)
display->focus_serial = 0;
display->server_focus_window = None;
display->server_focus_serial = 0;
+ display->server_grab_count = 0;
+
display->mouse_mode = TRUE; /* Only relevant for mouse or sloppy focus */
display->allow_terminal_deactivation = TRUE; /* Only relevant for when a
@@ -1130,6 +1131,50 @@ meta_display_close (MetaDisplay *display,
terminal has the focus */
@@ -1140,6 +1142,50 @@
meta_quit (META_EXIT_SUCCESS);
}
@ -53,7 +31,7 @@ index 4c7a00e..87e3307 100644
+{
+ if (display->server_grab_count == 0)
+ {
+ XGrabServer (display->xdisplay);
+ XGrabServer (display->x11_display->xdisplay);
+ }
+ display->server_grab_count += 1;
+ meta_verbose ("Grabbing display, grab count now %d\n",
@ -72,8 +50,8 @@ index 4c7a00e..87e3307 100644
+ /* FIXME we want to purge all pending "queued" stuff
+ * at this point, such as window hide/show
+ */
+ XUngrabServer (display->xdisplay);
+ XFlush (display->xdisplay);
+ XUngrabServer (display->x11_display->xdisplay);
+ XFlush (display->x11_display->xdisplay);
+ }
+
+ meta_verbose ("Ungrabbing display, grab count now %d\n",
@ -83,30 +61,31 @@ index 4c7a00e..87e3307 100644
/**
* meta_display_for_x_display:
* @xdisplay: An X display
@@ -1516,7 +1561,7 @@ request_xserver_input_focus_change (MetaDisplay *display,
* we know which is which by making two requests that the server will
* process at the same time.
*/
- XGrabServer (display->xdisplay);
+ meta_display_grab (display);
diff --unified --recursive --text --new-file --color mutter-40.0.old/src/core/display-private.h mutter-40.0.new/src/core/display-private.h
--- mutter-40.0.old/src/core/display-private.h 2021-04-23 08:52:33.877578506 +0800
+++ mutter-40.0.new/src/core/display-private.h 2021-04-23 09:07:24.330113775 +0800
@@ -144,6 +144,8 @@
GHashTable *stamps;
GHashTable *wayland_windows;
serial = XNextRequest (display->xdisplay);
+ int server_grab_count;
+
/* serials of leave/unmap events that may
* correspond to an enter event we should
* ignore
@@ -261,6 +263,8 @@
)
@@ -1529,8 +1574,7 @@ request_xserver_input_focus_change (MetaDisplay *display,
display->atom__MUTTER_FOCUS_SET,
XA_STRING, 8, PropModeAppend, NULL, 0);
gboolean meta_display_open (void);
+void meta_display_grab (MetaDisplay *display);
+void meta_display_ungrab (MetaDisplay *display);
- XUngrabServer (display->xdisplay);
- XFlush (display->xdisplay);
+ meta_display_ungrab (display);
meta_display_update_focus_window (display,
meta_window,
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index ed34aea..a989200 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -979,6 +979,9 @@ meta_display_grab_window_buttons (MetaDisplay *display,
void meta_display_manage_all_xwindows (MetaDisplay *display);
void meta_display_unmanage_windows (MetaDisplay *display,
diff --unified --recursive --text --new-file --color mutter-40.0.old/src/core/keybindings.c mutter-40.0.new/src/core/keybindings.c
--- mutter-40.0.old/src/core/keybindings.c 2021-04-23 08:52:33.877578506 +0800
+++ mutter-40.0.new/src/core/keybindings.c 2021-04-23 09:11:57.619333618 +0800
@@ -1253,6 +1253,9 @@
{
MetaKeyBindingManager *keys = &display->key_binding_manager;
@ -116,7 +95,7 @@ index ed34aea..a989200 100644
/* Grab Alt + button1 for moving window.
* Grab Alt + button2 for resizing window.
* Grab Alt + button3 for popping up window menu.
@@ -1015,6 +1018,9 @@ meta_display_ungrab_window_buttons (MetaDisplay *display,
@@ -1289,6 +1292,9 @@
{
MetaKeyBindingManager *keys = &display->key_binding_manager;
@ -126,7 +105,7 @@ index ed34aea..a989200 100644
if (keys->window_grab_modifiers == 0)
return;
@@ -1041,6 +1047,9 @@ meta_display_grab_focus_window_button (MetaDisplay *display,
@@ -1319,6 +1325,9 @@
{
MetaKeyBindingManager *keys = &display->key_binding_manager;
@ -134,29 +113,30 @@ index ed34aea..a989200 100644
+ return;
+
/* Grab button 1 for activating unfocused windows */
meta_verbose ("Grabbing unfocused window buttons for %s\n", window->desc);
meta_verbose ("Grabbing unfocused window buttons for %s", window->desc);
@@ -1080,6 +1089,9 @@ meta_display_ungrab_focus_window_button (MetaDisplay *display,
@@ -1343,6 +1352,9 @@
{
MetaKeyBindingManager *keys = &display->key_binding_manager;
+ if (display->server_grab_count > 0)
+ return;
+
meta_verbose ("Ungrabbing unfocused window buttons for %s\n", window->desc);
meta_verbose ("Ungrabbing unfocused window buttons for %s", window->desc);
if (!window->have_focus_click_grab)
@@ -1309,6 +1321,9 @@ meta_window_grab_keys (MetaWindow *window)
MetaDisplay *display = window->display;
MetaKeyBindingManager *keys = &display->key_binding_manager;
@@ -1588,6 +1600,10 @@
if (meta_is_wayland_compositor ())
return;
+
+ if (display->server_grab_count > 0)
+ return;
+
if (window->all_keys_grabbed)
return;
@@ -1348,6 +1363,9 @@ meta_window_ungrab_keys (MetaWindow *window)
@@ -1627,6 +1643,9 @@
MetaDisplay *display = window->display;
MetaKeyBindingManager *keys = &display->key_binding_manager;
@ -166,20 +146,41 @@ index ed34aea..a989200 100644
if (window->grab_on_frame &&
window->frame != NULL)
change_window_keygrabs (keys, window->frame->xwindow, FALSE);
diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c
index 3d47f0d..5ea1213 100644
--- a/src/x11/window-x11.c
+++ b/src/x11/window-x11.c
@@ -507,6 +507,8 @@ meta_window_x11_manage (MetaWindow *window)
diff --unified --recursive --text --new-file --color mutter-40.0.old/src/x11/meta-x11-display.c mutter-40.0.new/src/x11/meta-x11-display.c
--- mutter-40.0.old/src/x11/meta-x11-display.c 2021-04-23 08:52:33.884245138 +0800
+++ mutter-40.0.new/src/x11/meta-x11-display.c 2021-04-23 09:07:24.330113775 +0800
@@ -1945,7 +1945,7 @@
* we know which is which by making two requests that the server will
* process at the same time.
*/
- XGrabServer (x11_display->xdisplay);
+ meta_display_grab(x11_display->display);
XSetInputFocus (x11_display->xdisplay,
xwindow,
@@ -1957,8 +1957,7 @@
x11_display->atom__MUTTER_FOCUS_SET,
XA_STRING, 8, PropModeAppend, NULL, 0);
- XUngrabServer (x11_display->xdisplay);
- XFlush (x11_display->xdisplay);
+ meta_display_ungrab(x11_display->display);
meta_x11_error_trap_pop (x11_display);
}
diff --unified --recursive --text --new-file --color mutter-40.0.old/src/x11/window-x11.c mutter-40.0.new/src/x11/window-x11.c
--- mutter-40.0.old/src/x11/window-x11.c 2021-04-23 08:52:33.884245138 +0800
+++ mutter-40.0.new/src/x11/window-x11.c 2021-04-23 09:07:24.330113775 +0800
@@ -522,6 +522,8 @@
meta_icon_cache_init (&priv->icon_cache);
+ meta_display_grab (display);
+
meta_display_register_x_window (display, &window->xwindow, window);
/* assign the window to its group, or create a new group if needed */
@@ -565,6 +567,13 @@ meta_window_x11_manage (MetaWindow *window)
meta_x11_display_register_x_window (display->x11_display,
&window->xwindow,
window);
@@ -582,6 +584,13 @@
meta_window_x11_update_shape_region (window);
meta_window_x11_update_input_region (window);

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Apr 23 00:47:06 UTC 2021 - Alynx Zhou <alynx.zhou@suse.com>
- Rebase mutter-SLE-bsc984738-grab-display.patch and
mutter-SLE-bell.patch.
-------------------------------------------------------------------
Sat Mar 20 16:46:58 UTC 2021 - Dominique Leuenberger <dimstar@opensuse.org>

View File

@ -41,7 +41,7 @@ Patch4: mutter-disable-cvt-s390x.patch
Patch1000: mutter-SLE-bell.patch
# PATCH-FIX-SLE mutter-SLE-relax-some-constraints-on-CSD-windows.patch bnc#883491 cxiong@suse.com -- Relax some constraints on window positioning for CSD windows s.t. they can be placed at the very top of the monitor.
Patch1001: mutter-SLE-relax-some-constraints-on-CSD-windows.patch
# PATCH-NEEDS-REBASE mutter-SLE-bsc984738-grab-display.patch bsc#984738 bgo#769387 hpj@suse.com -- Revert a upstream commit to avoid X11 race condition that results in wrong dialog sizes.
# PATCH-FIX-SLE mutter-SLE-bsc984738-grab-display.patch bsc#984738 bgo#769387 hpj@suse.com -- Revert a upstream commit to avoid X11 race condition that results in wrong dialog sizes.
Patch1002: mutter-SLE-bsc984738-grab-display.patch
BuildRequires: Mesa-libGLESv3-devel
@ -163,7 +163,7 @@ translation-update-upstream po mutter
%if 0%{?sle_version}
%patch1000 -p1
%patch1001 -p1
# %patch1002 -p1
%patch1002 -p1
%endif
%build