This is an automated email from the git hooks/post-receive script. o l i v i e r p u s h e d a c o m m i t t o b r a n c h m a s t e r in repository xfce/xfwm4.
commit d9af18135348afa59f1a54362367a48eef81876f Author: Olivier Fourdan <four...@xfce.org> Date: Tue Jul 9 21:39:38 2019 +0200 stacking: Limit to direct transients when raising Bug: 15580 Following commit fa9517eae (“Raise all transients together”), xfwm4 would search for the deepest parent of a given transient and raise it to bring all related windows together. however, taking into account parents from the same group, it would raise the lowest window while the others from the same group aren't raised along with it, causing apparently random windows to be raised. Make sure we pick only direct transients when walking down the windows stack. Signed-off-by: Olivier Fourdan <four...@xfce.org> --- src/transients.c | 84 +++++++++++++++++++++++++++++++------------------------- src/transients.h | 5 ++-- 2 files changed, 49 insertions(+), 40 deletions(-) diff --git a/src/transients.c b/src/transients.c index 82946a1..8dab4c0 100644 --- a/src/transients.c +++ b/src/transients.c @@ -47,14 +47,33 @@ clientGetTransient (Client * c) } gboolean +clientIsDirectTransient (Client * c) +{ + g_return_val_if_fail (c != NULL, FALSE); + + TRACE ("client \"%s\" (0x%lx)", c->name, c->window); + + return ((c->transient_for != c->screen_info->xroot) && (c->transient_for != None) && (c->transient_for != c->window)); +} + +gboolean +clientIsTransientForGroup (Client * c) +{ + g_return_val_if_fail (c != NULL, FALSE); + + TRACE ("client \"%s\" (0x%lx)", c->name, c->window); + + return ((c->transient_for == c->screen_info->xroot) && (c->group_leader != None) && (c->group_leader != c->window)); +} + +gboolean clientIsTransient (Client * c) { g_return_val_if_fail (c != NULL, FALSE); TRACE ("client \"%s\" (0x%lx)", c->name, c->window); - return (((c->transient_for != c->screen_info->xroot) && (c->transient_for != None) && (c->transient_for != c->window)) || - ((c->transient_for == c->screen_info->xroot) && (c->group_leader != None) && (c->group_leader != c->window))); + return (clientIsDirectTransient(c) || clientIsTransientForGroup (c)); } gboolean @@ -68,8 +87,28 @@ clientIsModal (Client * c) if WM_TRANSIENT_FOR is not set or set to the root window the dialog is modal for its window group. */ return (FLAG_TEST (c->flags, CLIENT_FLAG_STATE_MODAL) && (c->type & WINDOW_REGULAR_FOCUSABLE) && - (((c->transient_for != c->screen_info->xroot) && (c->transient_for != None) && (c->transient_for != c->window)) || - ((c->group_leader != None) && (c->group_leader != c->window)))); + clientIsTransient (c)); +} + +gboolean +clientIsModalForGroup (Client * c) +{ + g_return_val_if_fail (c != NULL, FALSE); + + TRACE ("client \"%s\" (0x%lx)", c->name, c->window); + + return (FLAG_TEST (c->flags, CLIENT_FLAG_STATE_MODAL) && (c->type & WINDOW_REGULAR_FOCUSABLE) && + !clientIsTransient(c) && (c->group_leader != None)); +} + +gboolean +clientIsTransientOrModalForGroup (Client * c) +{ + g_return_val_if_fail (c != NULL, FALSE); + + TRACE ("client \"%s\" (0x%lx)", c->name, c->window); + + return (clientIsTransientForGroup(c) || clientIsModalForGroup(c)); } gboolean @@ -192,37 +231,6 @@ clientIsTransientOrModalFor (Client * c1, Client * c2) } gboolean -clientIsTransientForGroup (Client * c) -{ - g_return_val_if_fail (c != NULL, FALSE); - - TRACE ("client \"%s\" (0x%lx)", c->name, c->window); - - return ((c->transient_for == c->screen_info->xroot) && (c->group_leader != None)); -} - -gboolean -clientIsModalForGroup (Client * c) -{ - g_return_val_if_fail (c != NULL, FALSE); - - TRACE ("client \"%s\" (0x%lx)", c->name, c->window); - - return (FLAG_TEST (c->flags, CLIENT_FLAG_STATE_MODAL) && (c->type & WINDOW_REGULAR_FOCUSABLE) && - !clientIsTransient(c) && (c->group_leader != None)); -} - -gboolean -clientIsTransientOrModalForGroup (Client * c) -{ - g_return_val_if_fail (c != NULL, FALSE); - - TRACE ("client \"%s\" (0x%lx)", c->name, c->window); - - return (clientIsTransientForGroup(c) || clientIsModalForGroup(c)); -} - -gboolean clientIsValidTransientOrModal (Client * c) { g_return_val_if_fail (c != NULL, FALSE); @@ -315,7 +323,7 @@ clientGetModalFor (Client * c) return NULL; } -/* Find the deepest parent of that window */ +/* Find the deepest direct parent of that window */ Client * clientGetTransientFor (Client * c) { @@ -339,7 +347,7 @@ clientGetTransientFor (Client * c) continue; } - if (clientIsTransientFor (c, c2)) + if (clientIsDirectTransient (c) && clientIsTransientFor (c, c2)) { parents = g_list_append (parents, c2); first_parent = c2; @@ -349,7 +357,7 @@ clientGetTransientFor (Client * c) for (l2 = parents; l2; l2 = g_list_next (l2)) { Client *c3 = (Client *) l2->data; - if ((c3 != c2) && clientIsTransientFor (c3, c2)) + if ((c3 != c2) && clientIsDirectTransient (c3) && clientIsTransientFor (c3, c2)) { parents = g_list_append (parents, c2); first_parent = c2; diff --git a/src/transients.h b/src/transients.h index 029e25d..57029e3 100644 --- a/src/transients.h +++ b/src/transients.h @@ -31,8 +31,11 @@ #include "client.h" Client *clientGetTransient (Client *); +gboolean clientIsDirectTransient (Client *); +gboolean clientIsTransientForGroup (Client *); gboolean clientIsTransient (Client *); gboolean clientIsModal (Client *); +gboolean clientIsModalForGroup (Client *); gboolean clientIsTransientOrModal (Client *); gboolean clientIsValidTransientOrModal (Client *); gboolean clientSameGroup (Client *, @@ -49,8 +52,6 @@ gboolean clientIsModalFor (Client *, Client *); gboolean clientIsTransientOrModalFor (Client *, Client *); -gboolean clientIsTransientForGroup (Client *); -gboolean clientIsModalForGroup (Client *); gboolean clientIsTransientOrModalForGroup (Client *); gboolean clientTransientOrModalHasAncestor (Client *, guint); -- To stop receiving notification emails like this one, please contact the administrator of this repository. _______________________________________________ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits