From 76b511375ae0919becde6e0a428a507e00558a55 Mon Sep 17 00:00:00 2001 From: Maarten Maathuis Date: Fri, 21 Nov 2008 19:48:08 +0100 Subject: [PATCH] magnifier: try harder to find parent of dialog Signed-off-by: Maarten Maathuis Signed-off-by: Julien Danjou --- layouts/magnifier.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/layouts/magnifier.c b/layouts/magnifier.c index 9d36f3553..4fba8f522 100644 --- a/layouts/magnifier.c +++ b/layouts/magnifier.c @@ -41,9 +41,11 @@ layout_magnifier(int screen) focus = globalconf.screens[screen].client_focus; - /* When the client is not tiled and it has a parent, focus on that parent. */ + /* Find parent of this window, if it has one. */ if (!IS_TILED(focus, screen) && focus && focus->transient_for) - focus = focus->transient_for; + do { + focus = focus->transient_for; + } while (focus->transient_for != NULL); /* If focused window is not tiled, take the first one which is tiled. */ if(!IS_TILED(focus, screen))