Skip to content

Commit

Permalink
Clear urgency and stop flashing when focusing a client.
Browse files Browse the repository at this point in the history
  • Loading branch information
gijsbers committed Apr 25, 2024
1 parent 2dadb9b commit f59682c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/atasks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@ void TaskButton::setFlash(bool flashing) {
fFlashOn = true;
fFlashStart = monotime();
fFlashTimer->setTimer(focusRequestFlashInterval, this, true);
} else {
//fFlashTimer->stopTimer();
} else if (fFlashTimer) {
fFlashTimer->stopTimer();
}

if (fShown == false)
Expand Down
7 changes: 7 additions & 0 deletions src/wmclient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1284,6 +1284,13 @@ Pixmap YFrameClient::iconMaskHint() const {
return wmHint(IconMaskHint) ? fHints->icon_mask : None;
}

void YFrameClient::clearUrgency() {
if (urgencyHint()) {
fHints->flags &= ~XUrgencyHint;
XSetWMHints(xapp->display(), handle(), fHints);
}
}

bool YFrameClient::isDockApp() const {
return isDockAppIcon() || isDockAppWindow();
}
Expand Down
1 change: 1 addition & 0 deletions src/wmclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ class YFrameClient: public YDndWindow
Pixmap iconPixmapHint() const;
Pixmap iconMaskHint() const;
bool urgencyHint() const { return wmHint(XUrgencyHint); }
void clearUrgency();
bool isDockApp() const;
bool isDockAppIcon() const;
bool isDockAppWindow() const;
Expand Down
6 changes: 3 additions & 3 deletions src/wmframe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3825,9 +3825,9 @@ void YFrameWindow::updateNetWMFullscreenMonitors(int t, int b, int l, int r) {
}
}

void YFrameWindow::setWmUrgency(bool wmUrgency) {
if ( !frameOption(foIgnoreUrgent) || !wmUrgency) {
if (wmUrgency != hasState(WinStateUrgent)) {
void YFrameWindow::setWmUrgency(bool urgency) {
if ( !urgency || !frameOption(foIgnoreUrgent)) {
if (urgency != hasState(WinStateUrgent)) {
fWinState ^= WinStateUrgent;
client()->setStateHint(getState());
updateTaskBar();
Expand Down
2 changes: 2 additions & 0 deletions src/wmmgr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1075,6 +1075,8 @@ void YWindowManager::setFocus(YFrameWindow *f, bool canWarp, bool reorder) {
switchFocusTo(f, reorder);

f->setWmUrgency(false);
if (c)
c->clearUrgency();
}
#ifdef DEBUG
if (w == desktop) {
Expand Down

0 comments on commit f59682c

Please sign in to comment.