diff --git a/src/wmframe.cc b/src/wmframe.cc index ac5cecba4..d2ce2f4cd 100644 --- a/src/wmframe.cc +++ b/src/wmframe.cc @@ -1700,18 +1700,21 @@ YFrameClient* YFrameWindow::transient() const { } void YFrameWindow::minimizeTransients() { + YArray trans; for (YFrameClient* t = transient(); t; t = t->nextTransient()) { YFrameWindow* w = t->getFrame(); if (w) { - MSG(("> isMinimized: %d\n", w->isMinimized())); if (w->isMinimized()) { w->fWinState |= WinStateWasMinimized; - } else { + } + else if (find(trans, w) < 0 && w != this) { w->fWinState &= ~WinStateWasMinimized; - w->wmMinimize(); + trans += w; } } } + for (YFrameWindow* w : trans) + w->wmMinimize(); } void YFrameWindow::restoreMinimizedTransients() { @@ -1725,18 +1728,21 @@ void YFrameWindow::restoreMinimizedTransients() { } void YFrameWindow::hideTransients() { + YArray trans; for (YFrameClient* t = transient(); t; t = t->nextTransient()) { YFrameWindow* w = t->getFrame(); if (w) { - MSG(("> isHidden: %d\n", w->isHidden())); if (w->isHidden()) { w->fWinState |= WinStateWasHidden; - } else { + } + else if (find(trans, w) < 0 && w != this) { w->fWinState&= ~WinStateWasHidden; - w->wmHide(); + trans += w; } } } + for (YFrameWindow* w : trans) + w->wmHide(); } void YFrameWindow::restoreHiddenTransients() { @@ -1850,8 +1856,13 @@ void YFrameWindow::wmRaise() { if (canRaise()) { doRaise(); manager->restackWindows(); - if (focused() && container()->buttoned()) - container()->releaseButtons(); + if (focused()) { + if (container()->buttoned()) { + container()->releaseButtons(); + } + } else { + manager->focusOverlap(); + } } } diff --git a/src/wmmgr.h b/src/wmmgr.h index 3179075cd..7254177a2 100644 --- a/src/wmmgr.h +++ b/src/wmmgr.h @@ -261,6 +261,7 @@ class YWindowManager: void actionWindows(YAction action); void toggleDesktop(); void cascadeWindows(); + void focusOverlap(); bool haveClients(); void setupRootProxy(); @@ -342,7 +343,6 @@ class YWindowManager: bool handleWMKey(const XKeyEvent &key, KeySym k, unsigned vm); void setWmState(WMState newWmState); void refresh(); - void focusOverlap(); IApp *app; YActionListener *wmActionListener;