From 528d97b5975313816ee4ebc42d2f2ba5fa0905fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Fri, 30 Mar 2012 16:24:39 +0200 Subject: [PATCH] canReceiveFocus() should check no_focusable first The function canReceiveFocus should check if the window is no_focusable first. If the window is not focusable but is miniaturized, the window is shown in the switchpanel. How to reproduce the problem: - Open an application - Open the window properties, advanced options - Set that the application can not get the focus and save - Test the switchpanel (Alt+Tab) the window doesn't appear - Minimize the window - Test the switchpanel (Alt+Tab), the window appears - If the window is selected (restored), and test again the switchpanel, the window doesn't appear! --- src/switchpanel.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/switchpanel.c b/src/switchpanel.c index 8f9eec1f..23972a12 100644 --- a/src/switchpanel.c +++ b/src/switchpanel.c @@ -83,14 +83,16 @@ static int canReceiveFocus(WWindow * wwin) wGetHeadForWindow(wwin) != wGetHeadForPointerLocation(wwin->screen_ptr)) return 0; + if (WFLAGP(wwin, no_focusable)) + return 0; + if (!wwin->flags.mapped) { if (!wwin->flags.shaded && !wwin->flags.miniaturized && !wwin->flags.hidden) return 0; else return -1; } - if (WFLAGP(wwin, no_focusable)) - return 0; + return 1; }