Skip to content

Commit

Permalink
When raising a frame, check if the focused frame needs to bind the mo…
Browse files Browse the repository at this point in the history
…use buttons, if it is overlapped.

When minimizing or hiding transients, check against transients being tabs in the same frame.
  • Loading branch information
gijsbers committed Jul 21, 2024
1 parent 45b67d7 commit 46e93f2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
27 changes: 19 additions & 8 deletions src/wmframe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1700,18 +1700,21 @@ YFrameClient* YFrameWindow::transient() const {
}

void YFrameWindow::minimizeTransients() {
YArray<YFrameWindow*> 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() {
Expand All @@ -1725,18 +1728,21 @@ void YFrameWindow::restoreMinimizedTransients() {
}

void YFrameWindow::hideTransients() {
YArray<YFrameWindow*> 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() {
Expand Down Expand Up @@ -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();
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/wmmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ class YWindowManager:
void actionWindows(YAction action);
void toggleDesktop();
void cascadeWindows();
void focusOverlap();

bool haveClients();
void setupRootProxy();
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 46e93f2

Please sign in to comment.