aboutsummaryrefslogtreecommitdiff
path: root/src/AttentionNoticeHandler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/AttentionNoticeHandler.cc')
-rw-r--r--src/AttentionNoticeHandler.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/AttentionNoticeHandler.cc b/src/AttentionNoticeHandler.cc
index fec3933..3f28695 100644
--- a/src/AttentionNoticeHandler.cc
+++ b/src/AttentionNoticeHandler.cc
@@ -23,7 +23,7 @@
23 23
24#include "AttentionNoticeHandler.hh" 24#include "AttentionNoticeHandler.hh"
25 25
26#include "Focusable.hh" 26#include "Window.hh"
27#include "Screen.hh" 27#include "Screen.hh"
28#include "STLUtil.hh" 28#include "STLUtil.hh"
29 29
@@ -94,12 +94,16 @@ void AttentionNoticeHandler::addAttention(Focusable &client) {
94 // attach signals that will make notice go away 94 // attach signals that will make notice go away
95 client.dieSig().attach(this); 95 client.dieSig().attach(this);
96 client.focusSig().attach(this); 96 client.focusSig().attach(this);
97
98 // update _NET_WM_STATE atom
99 if (client.fbwindow())
100 client.fbwindow()->stateSig().notify();
97} 101}
98 102
99void AttentionNoticeHandler::update(FbTk::Subject *subj) { 103void AttentionNoticeHandler::update(FbTk::Subject *subj) {
100 104
101 // we need to be able to get the window 105 // we need to be able to get the window
102 if (typeid(*subj) != typeid(Focusable::FocusSubject)) 106 if (!subj || typeid(*subj) != typeid(Focusable::FocusSubject))
103 return; 107 return;
104 108
105 // all signals results in destruction of the notice 109 // all signals results in destruction of the notice
@@ -109,5 +113,14 @@ void AttentionNoticeHandler::update(FbTk::Subject *subj) {
109 delete m_attentions[&winsubj->win()]; 113 delete m_attentions[&winsubj->win()];
110 m_attentions.erase(&winsubj->win()); 114 m_attentions.erase(&winsubj->win());
111 winsubj->win().setAttentionState(false); 115 winsubj->win().setAttentionState(false);
116
117 // update _NET_WM_STATE atom
118 FluxboxWindow *fbwin = winsubj->win().fbwindow();
119 if (fbwin && winsubj != &winsubj->win().dieSig())
120 fbwin->stateSig().notify();
121
112} 122}
113 123
124bool AttentionNoticeHandler::isDemandingAttention(Focusable &client) {
125 return m_attentions.find(&client) != m_attentions.end();
126}