diff --git a/mutter-bsc1052058-NET_RESTACK_WINDOW-Respect-sibling.patch b/mutter-bsc1052058-NET_RESTACK_WINDOW-Respect-sibling.patch new file mode 100644 index 0000000..2bc9be2 --- /dev/null +++ b/mutter-bsc1052058-NET_RESTACK_WINDOW-Respect-sibling.patch @@ -0,0 +1,202 @@ +From e3d59832c56dbc6acb4301836bc54c467889d515 Mon Sep 17 00:00:00 2001 +From: Vasilis Liaskovitis +Date: Fri, 29 Sep 2017 16:57:22 +0200 +Subject: [PATCH] x11/window: Implement _NET_RESTACK_WINDOW and + XConfigureRequestEvent sibling + +Implement _NET_RESTACK_WINDOW, based on metacity commit 0b5a50c8. + +Also respect "above" field (sibling) of XConfigureRequestEvent. When it is +set, perform a stack operation relative to that sibling. + +https://bugzilla.gnome.org/show_bug.cgi?id=786363 +https://bugzilla.gnome.org/show_bug.cgi?id=786365 + +Index: mutter-3.26.0/src/core/window-private.h +=================================================================== +--- mutter-3.26.0.orig/src/core/window-private.h ++++ mutter-3.26.0/src/core/window-private.h +@@ -682,6 +682,9 @@ void meta_window_frame_size_changed (Met + void meta_window_stack_just_below (MetaWindow *window, + MetaWindow *below_this_one); + ++void meta_window_stack_just_above (MetaWindow *window, ++ MetaWindow *above_this_one); ++ + void meta_window_set_user_time (MetaWindow *window, + guint32 timestamp); + +Index: mutter-3.26.0/src/core/window.c +=================================================================== +--- mutter-3.26.0.orig/src/core/window.c ++++ mutter-3.26.0/src/core/window.c +@@ -6646,6 +6646,30 @@ meta_window_stack_just_below (MetaWindow + } + } + ++void ++meta_window_stack_just_above (MetaWindow *window, ++ MetaWindow *above_this_one) ++{ ++ g_return_if_fail (window != NULL); ++ g_return_if_fail (above_this_one != NULL); ++ ++ if (window->stack_position < above_this_one->stack_position) ++ { ++ meta_topic (META_DEBUG_STACK, ++ "Setting stack position of window %s to %d (making it above window %s).\n", ++ window->desc, ++ above_this_one->stack_position, ++ above_this_one->desc); ++ meta_window_set_stack_position (window, above_this_one->stack_position); ++ } ++ else ++ { ++ meta_topic (META_DEBUG_STACK, ++ "Window %s was already above window %s.\n", ++ window->desc, above_this_one->desc); ++ } ++} ++ + /** + * meta_window_get_user_time: + * @window: a #MetaWindow +Index: mutter-3.26.0/src/x11/atomnames.h +=================================================================== +--- mutter-3.26.0.orig/src/x11/atomnames.h ++++ mutter-3.26.0/src/x11/atomnames.h +@@ -176,6 +176,7 @@ item(_NET_WM_OPAQUE_REGION) + item(_NET_WM_FRAME_DRAWN) + item(_NET_WM_FRAME_TIMINGS) + item(_NET_WM_WINDOW_OPACITY) ++item(_NET_RESTACK_WINDOW) + + /* eof atomnames.h */ + +Index: mutter-3.26.0/src/x11/window-x11.c +=================================================================== +--- mutter-3.26.0.orig/src/x11/window-x11.c ++++ mutter-3.26.0/src/x11/window-x11.c +@@ -2092,6 +2092,32 @@ meta_window_move_resize_request (MetaWin + } + } + ++static void ++restack_window (MetaWindow *window, ++ MetaWindow *sibling, ++ int direction) ++{ ++ switch (direction) ++ { ++ case Above: ++ if (sibling) ++ meta_window_stack_just_above (window, sibling); ++ else ++ meta_window_raise (window); ++ break; ++ case Below: ++ if (sibling) ++ meta_window_stack_just_below (window, sibling); ++ else ++ meta_window_lower (window); ++ break; ++ case TopIf: ++ case BottomIf: ++ case Opposite: ++ break; ++ } ++} ++ + gboolean + meta_window_x11_configure_request (MetaWindow *window, + XEvent *event) +@@ -2125,10 +2151,7 @@ meta_window_x11_configure_request (MetaW + * the stack looks). + * + * I'm pretty sure no interesting client uses TopIf, BottomIf, or +- * Opposite anyway, so the only possible missing thing is +- * Above/Below with a sibling set. For now we just pretend there's +- * never a sibling set and always do the full raise/lower instead of +- * the raise-just-above/below-sibling. ++ * Opposite anyway. + */ + if (event->xconfigurerequest.value_mask & CWStackMode) + { +@@ -2160,19 +2183,23 @@ meta_window_x11_configure_request (MetaW + } + else + { +- switch (event->xconfigurerequest.detail) ++ MetaWindow *sibling = NULL; ++ /* Handle Above/Below with a sibling set */ ++ if (event->xconfigurerequest.above != None) + { +- case Above: +- meta_window_raise (window); +- break; +- case Below: +- meta_window_lower (window); +- break; +- case TopIf: +- case BottomIf: +- case Opposite: +- break; ++ MetaDisplay *display; ++ ++ display = meta_window_get_display (window); ++ sibling = meta_display_lookup_x_window (display, ++ event->xconfigurerequest.above); ++ if (sibling == NULL) ++ return TRUE; ++ ++ meta_topic (META_DEBUG_STACK, ++ "xconfigure stacking request from window %s sibling %s stackmode %d\n", ++ window->desc, sibling->desc, event->xconfigurerequest.detail); + } ++ restack_window (window, sibling, event->xconfigurerequest.detail); + } + } + +@@ -2245,6 +2272,30 @@ query_pressed_buttons (MetaWindow *windo + return button; + } + ++static void ++handle_net_restack_window (MetaDisplay *display, ++ XEvent *event) ++{ ++ MetaWindow *window, *sibling = NULL; ++ ++ /* Ignore if this does not come from a pager, see the WM spec ++ */ ++ if (event->xclient.data.l[0] != 2) ++ return; ++ ++ window = meta_display_lookup_x_window (display, ++ event->xclient.window); ++ ++ if (window) ++ { ++ if (event->xclient.data.l[1]) ++ sibling = meta_display_lookup_x_window (display, ++ event->xclient.data.l[1]); ++ ++ restack_window (window, sibling, event->xclient.data.l[2]); ++ } ++} ++ + gboolean + meta_window_x11_client_message (MetaWindow *window, + XEvent *event) +@@ -2728,6 +2779,11 @@ meta_window_x11_client_message (MetaWind + + meta_window_show_menu (window, META_WINDOW_MENU_WM, x, y); + } ++ else if (event->xclient.message_type == ++ display->atom__NET_RESTACK_WINDOW) ++ { ++ handle_net_restack_window (display, event); ++ } + + return FALSE; + } diff --git a/mutter.changes b/mutter.changes index 74c023d..1d42428 100644 --- a/mutter.changes +++ b/mutter.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Mon Oct 2 11:57:00 CEST 2017 - vliaskovitis@suse.com + +- Add mutter-bsc1052058-NET_RESTACK_WINDOW-Respect-sibling.patch: + Implement _NET_RESTACK_WINDOW and respect sibling field of + XConfigureRequestEvent. This way X11 window stack operations work + as expected. + (bsc#1052058, bgo#786363, bgo#786365) + ------------------------------------------------------------------- Mon Sep 25 21:10:56 UTC 2017 - zaitor@opensuse.org diff --git a/mutter.spec b/mutter.spec index cf3fe54..844a08c 100644 --- a/mutter.spec +++ b/mutter.spec @@ -38,6 +38,8 @@ Patch4: mutter-fix-kinetic-scrolling.patch Patch5: mutter-monitor-config-manager-rotation-fix.patch # PATCH-FIX-UPSTREAM mutter-fix-hidpi-scaling-x11.patch bgo#788049 zaitor@opensuse.org -- Fix hidpi scaling regression when using X11 Patch6: mutter-fix-hidpi-scaling-x11.patch +# PATCH-FIX-UPSTREAM mutter-bsc1052058-NET_RESTACK_WINDOW-Respect-sibling.patch bsc#1052058 bgo#786363 bgo#786365 vliaskovitis@suse.com --Implement NET_RESTACK_WINDOW, respect XConfigureRequestEvent sibling +Patch7: mutter-bsc1052058-NET_RESTACK_WINDOW-Respect-sibling.patch # SLE only patches start at 1000 # PATCH-FEATURE-SLE mutter-SLE-bell.patch FATE#316042 bnc#889218 idonmez@suse.com -- make audible bell work out of the box. @@ -153,6 +155,7 @@ applications that want to make use of the mutter library. %patch4 -p1 %patch5 -p1 %patch6 -p1 +%patch7 -p1 # SLE only patches and translations. %if !0%{?is_opensuse}