From bc9db1f7824aca9592acc5b6352540426ab92efac27d67396458c444db65db00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Lie?= Date: Fri, 26 Aug 2016 12:00:22 +0000 Subject: [PATCH] Accepting request 422494 from home:zhangxiaofei:branches:GNOME:Factory SLE sync - Add mutter-bsc984738-grab-display.patch (bsc#984738, bgo#769387). - Drop mutter-grab-display.patch, it has been fixed by upstream differently. - Update to GNOME 3.20 Fate#318572 - Remove upstream patches: mutter-bnc879109-no-monitors-crash.patch - Refresh mutter-grab-display.patch, mutter-bell.patch, relax-some-constraints-on-CSD-windows-in-sle-classic.patch - Update mutter-bell.patch so it works on all cases (bnc#889218) - Add relax-some-constraints-on-CSD-windows-in-sle-classic.patch: CSD (Client Side Decoration) windows have invisible box wrapping around them, which leads to some positioning issues as in this bug report. Relax some constraints on window positioning for CSD windows s.t. they can be placed at the very top of the monitor. This fix works nicely for "sle-classic" as there is no top bar any more, and is NOT applied in other GNOME sessions for reasons stated in bgo#719772 (bnc#883491). - Add mutter-bnc879109-no-monitors-crash.patch: Fixes a crash in Mutter when there are no usable monitors, such as when a laptop is booted with the lid closed while on a docking station, with the intent of plugging an external monitor later (bnc#879109). - Added support for gnome-patch-translation (2 strings). - Update mutter-grab-display.patch to fix (bnc#873763) OBS-URL: https://build.opensuse.org/request/show/422494 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/mutter?expand=0&rev=203 --- mutter-bell.patch | 107 ++++++++++ mutter-bsc984738-grab-display.patch | 195 ++++++++++++++++++ mutter.changes | 77 ++++++- mutter.spec | 9 + ...raints-on-CSD-windows-in-sle-classic.patch | 45 ++++ 5 files changed, 432 insertions(+), 1 deletion(-) create mode 100644 mutter-bell.patch create mode 100644 mutter-bsc984738-grab-display.patch create mode 100644 relax-some-constraints-on-CSD-windows-in-sle-classic.patch diff --git a/mutter-bell.patch b/mutter-bell.patch new file mode 100644 index 0000000..882e4d5 --- /dev/null +++ b/mutter-bell.patch @@ -0,0 +1,107 @@ +Index: mutter-3.20.0/src/meta/prefs.h +=================================================================== +--- mutter-3.20.0.orig/src/meta/prefs.h ++++ mutter-3.20.0/src/meta/prefs.h +@@ -89,6 +89,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, +@@ -399,6 +400,7 @@ MetaKeyBindingAction meta_prefs_get_keyb + + gboolean meta_prefs_get_visual_bell (void); + gboolean meta_prefs_bell_is_audible (void); ++gboolean meta_prefs_bell_force_through_server (void); + GDesktopVisualBellType meta_prefs_get_visual_bell_type (void); + + #endif +Index: mutter-3.20.0/src/core/prefs.c +=================================================================== +--- mutter-3.20.0.orig/src/core/prefs.c ++++ mutter-3.20.0/src/core/prefs.c +@@ -93,6 +93,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 char *cursor_theme = NULL; +@@ -353,6 +354,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, +@@ -1813,6 +1821,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"; + +@@ -2077,6 +2088,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.20.0/src/core/bell.c +=================================================================== +--- mutter-3.20.0.orig/src/core/bell.c ++++ mutter-3.20.0/src/core/bell.c +@@ -220,6 +220,12 @@ meta_bell_notify (MetaDisplay *display, + if (meta_prefs_get_visual_bell ()) + bell_visual_notify (display, window); + ++ if (meta_prefs_bell_force_through_server ()) ++ { ++ XkbForceBell (display->xdisplay, 100); ++ return TRUE; ++ } ++ + if (meta_prefs_bell_is_audible ()) + return bell_audible_notify (display, window); + +Index: mutter-3.20.0/data/org.gnome.mutter.gschema.xml.in +=================================================================== +--- mutter-3.20.0.orig/data/org.gnome.mutter.gschema.xml.in ++++ mutter-3.20.0/data/org.gnome.mutter.gschema.xml.in +@@ -102,6 +102,16 @@ + + + ++ ++ false ++ <_summary>Force the System Bell through the X server only. ++ <_description> ++ Force the System Bell through the X server only for systems that ++ do not want to go through the sound card - for example that don't ++ have speakers. ++ ++ ++ + + + diff --git a/mutter-bsc984738-grab-display.patch b/mutter-bsc984738-grab-display.patch new file mode 100644 index 0000000..2b052c1 --- /dev/null +++ b/mutter-bsc984738-grab-display.patch @@ -0,0 +1,195 @@ +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; + ++ 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, + meta_quit (META_EXIT_SUCCESS); + } + ++/* Grab/ungrab routines taken from fvwm. ++ * Calling this function will cause X to ignore all other clients until ++ * you ungrab. This may not be quite as bad as it sounds, yet there is ++ * agreement that avoiding server grabs except when they are clearly needed ++ * is a good thing. ++ * ++ * If you do use such grabs, please clearly explain the necessity for their ++ * usage in a comment. Try to keep their scope extremely limited. In ++ * particular, try to avoid emitting any signals or notifications while ++ * a grab is active (if the signal receiver tries to block on an X request ++ * from another client at this point, you will have a deadlock). ++ */ ++void ++meta_display_grab (MetaDisplay *display) ++{ ++ if (display->server_grab_count == 0) ++ { ++ XGrabServer (display->xdisplay); ++ } ++ display->server_grab_count += 1; ++ meta_verbose ("Grabbing display, grab count now %d\n", ++ display->server_grab_count); ++} ++ ++void ++meta_display_ungrab (MetaDisplay *display) ++{ ++ if (display->server_grab_count == 0) ++ meta_bug ("Ungrabbed non-grabbed server\n"); ++ ++ display->server_grab_count -= 1; ++ if (display->server_grab_count == 0) ++ { ++ /* FIXME we want to purge all pending "queued" stuff ++ * at this point, such as window hide/show ++ */ ++ XUngrabServer (display->xdisplay); ++ XFlush (display->xdisplay); ++ } ++ ++ meta_verbose ("Ungrabbing display, grab count now %d\n", ++ display->server_grab_count); ++} ++ + /** + * 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); + + serial = XNextRequest (display->xdisplay); + +@@ -1529,8 +1574,7 @@ request_xserver_input_focus_change (MetaDisplay *display, + display->atom__MUTTER_FOCUS_SET, + XA_STRING, 8, PropModeAppend, NULL, 0); + +- 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, + { + MetaKeyBindingManager *keys = &display->key_binding_manager; + ++ if (display->server_grab_count > 0) ++ return; ++ + /* 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, + { + MetaKeyBindingManager *keys = &display->key_binding_manager; + ++ if (display->server_grab_count > 0) ++ return; ++ + if (keys->window_grab_modifiers == 0) + return; + +@@ -1041,6 +1047,9 @@ meta_display_grab_focus_window_button (MetaDisplay *display, + { + MetaKeyBindingManager *keys = &display->key_binding_manager; + ++ if (display->server_grab_count > 0) ++ return; ++ + /* Grab button 1 for activating unfocused windows */ + meta_verbose ("Grabbing unfocused window buttons for %s\n", window->desc); + +@@ -1080,6 +1089,9 @@ meta_display_ungrab_focus_window_button (MetaDisplay *display, + { + MetaKeyBindingManager *keys = &display->key_binding_manager; + ++ if (display->server_grab_count > 0) ++ return; ++ + meta_verbose ("Ungrabbing unfocused window buttons for %s\n", 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; + ++ if (display->server_grab_count > 0) ++ return; ++ + if (window->all_keys_grabbed) + return; + +@@ -1348,6 +1363,9 @@ meta_window_ungrab_keys (MetaWindow *window) + MetaDisplay *display = window->display; + MetaKeyBindingManager *keys = &display->key_binding_manager; + ++ if (display->server_grab_count > 0) ++ return; ++ + 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) + + 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_window_x11_update_shape_region (window); + meta_window_x11_update_input_region (window); ++ ++ meta_display_ungrab (display); ++ ++ /* Perform operations prevented by grab */ ++ if (window->frame) ++ meta_display_grab_window_buttons (display, window->frame->xwindow); ++ meta_window_grab_keys (window); + } + + static void diff --git a/mutter.changes b/mutter.changes index 4bd1e67..4e86e79 100644 --- a/mutter.changes +++ b/mutter.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat Jul 30 03:45:15 CEST 2016 - hpj@suse.com + +- Add mutter-bsc984738-grab-display.patch (bsc#984738, bgo#769387). + ------------------------------------------------------------------- Wed Jun 29 09:14:06 UTC 2016 - zaitor@opensuse.org @@ -31,6 +36,12 @@ Wed May 11 08:03:31 UTC 2016 - zaitor@opensuse.org - Conditionally apply translations-update-upstream BuildRequires and macro for non-openSUSE only. +------------------------------------------------------------------- +Mon May 2 10:57:13 CEST 2016 - fcrozat@suse.com + +- Drop mutter-grab-display.patch, it has been fixed by upstream + differently. + ------------------------------------------------------------------- Wed Apr 13 17:48:40 UTC 2016 - zaitor@opensuse.org @@ -42,6 +53,14 @@ Wed Apr 13 17:48:40 UTC 2016 - zaitor@opensuse.org + Misc. bug fixes and cleanups: bgo#762828, bgo#764807. + Updated translations. +------------------------------------------------------------------- +Wed Apr 13 06:46:07 UTC 2016 - idonmez@suse.com + +- Update to GNOME 3.20 Fate#318572 +- Remove upstream patches: mutter-bnc879109-no-monitors-crash.patch +- Refresh mutter-grab-display.patch, mutter-bell.patch, + relax-some-constraints-on-CSD-windows-in-sle-classic.patch + ------------------------------------------------------------------- Wed Mar 23 08:14:33 UTC 2016 - dimstar@opensuse.org @@ -596,6 +615,11 @@ Wed Aug 20 07:50:33 UTC 2014 - dimstar@opensuse.org pkgconfig(xkbcommon), pkgconfig(xkbcommon-x11) and pkgconfig(xcb-randr) BuildRequires: new dependencies. +------------------------------------------------------------------- +Thu Aug 14 08:35:16 UTC 2014 - idonmez@suse.com + +- Update mutter-bell.patch so it works on all cases (bnc#889218) + ------------------------------------------------------------------- Wed Jul 23 16:13:10 UTC 2014 - dimstar@opensuse.org @@ -653,6 +677,27 @@ Sat Jul 12 19:01:40 UTC 2014 - dimstar@opensuse.org - Add BuildRequires for session startup support using systemd: + pkgconfig(libdrm) and pkgconfig(libsystemd). +------------------------------------------------------------------- +Wed Jul 9 11:53:15 UTC 2014 - cxiong@suse.com + +- Add relax-some-constraints-on-CSD-windows-in-sle-classic.patch: + CSD (Client Side Decoration) windows have invisible box wrapping + around them, which leads to some positioning issues as in this + bug report. Relax some constraints on window positioning for CSD + windows s.t. they can be placed at the very top of the monitor. + This fix works nicely for "sle-classic" as there is no top bar + any more, and is NOT applied in other GNOME sessions for reasons + stated in bgo#719772 (bnc#883491). + +------------------------------------------------------------------- +Sat May 31 13:05:37 CDT 2014 - federico@suse.com + +- Add mutter-bnc879109-no-monitors-crash.patch: + Fixes a crash in Mutter when there are no usable monitors, such + as when a laptop is booted with the lid closed while on a docking + station, with the intent of plugging an external monitor later + (bnc#879109). + ------------------------------------------------------------------- Sat May 17 10:33:34 UTC 2014 - zaitor@opensuse.org @@ -663,6 +708,17 @@ Sat May 17 10:33:34 UTC 2014 - zaitor@opensuse.org + Misc. bugs fixed: bgo#728423, bgo#729732. + Updated translations. +------------------------------------------------------------------- +Wed May 7 18:54:54 CEST 2014 - sbrabec@suse.cz + +- Added support for gnome-patch-translation (2 strings). + +------------------------------------------------------------------- +Sun Apr 27 23:49:47 UTC 2014 - dliang@suse.com + +- Update mutter-grab-display.patch to fix (bnc#873763) + remove the duplicated trap-pop. + ------------------------------------------------------------------- Wed Apr 16 06:59:50 UTC 2014 - dimstar@opensuse.org @@ -678,6 +734,13 @@ Sat Apr 5 13:32:23 UTC 2014 - dimstar@opensuse.org package (in order to not conflict between mutter and mutter-wayland). +------------------------------------------------------------------- +Fri Mar 28 08:40:54 UTC 2014 - dliang@suse.com + +- Add mutter-grab-display.patch (bnc#870285) + The oracle installer cannot display correctly. + The bug was introduced in 3.10.4 and is now fixed in upstream. + ------------------------------------------------------------------- Wed Mar 26 19:10:09 UTC 2014 - zaitor@opensuse.org @@ -789,6 +852,18 @@ Thu Feb 20 11:59:14 UTC 2014 - zaitor@opensuse.org + Bugs fixed: bgo#720630, bgo#723468, bgo#724258, bgo#724364. + Updated translations. +------------------------------------------------------------------- +Fri Feb 14 11:03:34 UTC 2014 - fcrozat@suse.com + +- Update mutter-bell.patch: correctly get gsetting from the right + schema [FATE#316042] + +------------------------------------------------------------------- +Wed Feb 5 08:44:05 UTC 2014 - idonmez@suse.com + +- Add mutter-bell.patch to make audible bell work out of the box. + Implements FATE#316042 + ------------------------------------------------------------------- Sat Jan 18 12:22:59 UTC 2014 - zaitor@opensuse.org @@ -1737,7 +1812,7 @@ Sun Feb 13 16:53:09 CET 2011 - vuntz@opensuse.org Fri Feb 11 12:31:50 UTC 2011 - fcrozat@novell.com - Update to version 2.91.6: - + Add meta_screen_override_window_layout() to let a plugin set + + Add meta_screen_override_window_layout() to let a plugin set the workspace layout + Add a 'size-changed' signal to MetaWindowActor + Add meta_window_actor_is_destroyed() diff --git a/mutter.spec b/mutter.spec index b417b55..b6d39fb 100644 --- a/mutter.spec +++ b/mutter.spec @@ -30,6 +30,12 @@ License: GPL-2.0+ Group: System/GUI/GNOME Url: http://www.gnome.org Source: http://download.gnome.org/sources/mutter/3.20/%{name}-%{version}.tar.xz +# PATCH-FEATURE-SLE mutter-bell.patch FATE#316042 bnc#889218 idonmez@suse.com -- make audible bell work out of the box. +Patch1: mutter-bell.patch +# PATCH-FIX-SLE relax-some-constraints-on-CSD-windows-in-sle-classic.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. +Patch2: relax-some-constraints-on-CSD-windows-in-sle-classic.patch +# PATCH-FIX-UPSTREAM mutter-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. +Patch3: mutter-bsc984738-grab-display.patch BuildRequires: fdupes BuildRequires: gobject-introspection-devel >= 0.9.5 BuildRequires: intltool @@ -140,7 +146,10 @@ to develop applications that require these. %setup -q %if !0%{?is_opensuse} translation-update-upstream +%patch1 -p1 +%patch2 -p1 %endif +%patch3 -p1 %build %configure \ diff --git a/relax-some-constraints-on-CSD-windows-in-sle-classic.patch b/relax-some-constraints-on-CSD-windows-in-sle-classic.patch new file mode 100644 index 0000000..dea3124 --- /dev/null +++ b/relax-some-constraints-on-CSD-windows-in-sle-classic.patch @@ -0,0 +1,45 @@ +Index: mutter-3.20.0/src/core/constraints.c +=================================================================== +--- mutter-3.20.0.orig/src/core/constraints.c ++++ mutter-3.20.0/src/core/constraints.c +@@ -1241,6 +1241,12 @@ constrain_to_single_monitor (MetaWindow + } + + static gboolean ++constraint_is_sle_classic(void){ ++ char * session_mode = (char *) g_getenv ("GNOME_SHELL_SESSION_MODE"); ++ return g_strcmp0("sle-classic", session_mode) == 0; ++} ++ ++static gboolean + constrain_fully_onscreen (MetaWindow *window, + ConstraintInfo *info, + ConstraintPriority priority, +@@ -1256,6 +1262,11 @@ constrain_fully_onscreen (MetaWindow + if (window->type == META_WINDOW_DESKTOP || + window->type == META_WINDOW_DOCK || + window->fullscreen || ++ /* in SLE Classic, there is no top bar and to avoid issues like ++ * bnc#883491, remove some constraints on CSD windows, which tends to have ++ * invisible wrapper box. Do the same for "constrain_titlebar_visible". ++ */ ++ (constraint_is_sle_classic() && !window->decorated) || + !window->require_fully_onscreen || + info->is_user_action) + return TRUE; +@@ -1292,10 +1303,11 @@ constrain_titlebar_visible (MetaWindow + * is only meant for normal windows (e.g. we don't want docks to be shoved + * "onscreen" by their own strut). + */ +- if (window->type == META_WINDOW_DESKTOP || +- window->type == META_WINDOW_DOCK || +- window->fullscreen || +- !window->require_titlebar_visible || ++ if (window->type == META_WINDOW_DESKTOP || ++ window->type == META_WINDOW_DOCK || ++ window->fullscreen || ++ (constraint_is_sle_classic() && !window->decorated) || ++ !window->require_titlebar_visible || + unconstrained_user_action) + return TRUE; +