From 6930e53f143ecb144870eb1f54d8fe5996c51258 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <fourdan@xfce.org>
Date: Sun, 12 Apr 2020 19:59:15 +0200
Subject: [PATCH] transients: Do no search for parent in lower layers

Bug: 15891

When raising a transient window we would automatically raise its parent
windows.

However, if the transient and parent are not placed on the same layer,
we might raise the parent from a lower layer.

To avoid that issue, limit the scope of search to the same or higher
layers.

Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
(cherry picked from commit 3d6e0472e9a5ec310ff11294ae2c07dfd4a1f538)
---
 src/transients.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/transients.c b/src/transients.c
index 8dab4c0a7..6a61f4a0d 100644
--- a/src/transients.c
+++ b/src/transients.c
@@ -347,6 +347,11 @@ clientGetTransientFor (Client * c)
             continue;
         }
 
+        if (c->win_layer > c2->win_layer)
+        {
+            break;
+        }
+
         if (clientIsDirectTransient (c) && clientIsTransientFor (c, c2))
         {
             parents = g_list_append (parents, c2);
-- 
GitLab