When an app hides its window but doesn't exit (e.g. apps that "minimize"
to the system tray), the highlighting was not being removed.

When alt-tabbing, the tabbed-to app's icon was not getting highlighted.

Signed-off-by: Brad Jorsch <[email protected]>
---
 src/actions.c |    2 +-
 src/window.c  |   11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/src/actions.c b/src/actions.c
index 2c61cd5..f4516f5 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -211,8 +211,8 @@ void wSetFocusTo(WScreen *scr, WWindow *wwin)
 
                if (wwin->flags.mapped)
                        wAppMenuMap(napp->menu, wwin);
-               wApplicationActivate(napp);
        }
+       if (napp) wApplicationActivate(napp);
 
        XFlush(dpy);
        old_scr = scr;
diff --git a/src/window.c b/src/window.c
index 564e57b..6c538da 100644
--- a/src/window.c
+++ b/src/window.c
@@ -56,6 +56,8 @@
 #include "defaults.h"
 #include "workspace.h"
 #include "xinerama.h"
+#include "appmenu.h"
+#include "appicon.h"
 
 #ifdef MWM_HINTS
 # include "motif.h"
@@ -1654,6 +1656,15 @@ void wUnmanageWindow(WWindow *wwin, Bool restore, Bool 
destroyed)
                }
                wSetFocusTo(scr, newFocusedWindow);
        }
+
+       /* Close menu and unhighlight */
+       WApplication *oapp = wApplicationOf(wwin->main_window);
+       WApplication *napp = scr->focused_window ? 
wApplicationOf(scr->focused_window->main_window) : NULL;
+       if (oapp && oapp != napp) {
+               wAppMenuUnmap(oapp->menu);
+               wApplicationDeactivate(oapp);
+       }
+
        wWindowDestroy(wwin);
        XFlush(dpy);
 }
-- 
1.7.1


-- 
To unsubscribe, send mail to [email protected].

Reply via email to