aboutsummaryrefslogtreecommitdiff
path: root/src/AttentionNoticeHandler.cc
diff options
context:
space:
mode:
authormarkt <markt>2007-07-01 17:59:57 (GMT)
committermarkt <markt>2007-07-01 17:59:57 (GMT)
commit7783a8c84e57c4a58d270b9722800a031f50ed62 (patch)
tree2c6f8f4ff4aede78907466a6b15bfd25fdd3600c /src/AttentionNoticeHandler.cc
parent61b757d872778131aa773aadc9c59fdfb3fe2238 (diff)
downloadfluxbox-7783a8c84e57c4a58d270b9722800a031f50ed62.zip
fluxbox-7783a8c84e57c4a58d270b9722800a031f50ed62.tar.bz2
more fixes for _NET_WM_STATE_MODAL and _NET_WM_STATE_DEMANDS_ATTENTION
Diffstat (limited to 'src/AttentionNoticeHandler.cc')
-rw-r--r--src/AttentionNoticeHandler.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/AttentionNoticeHandler.cc b/src/AttentionNoticeHandler.cc
index a80934a..10a087c 100644
--- a/src/AttentionNoticeHandler.cc
+++ b/src/AttentionNoticeHandler.cc
@@ -95,15 +95,31 @@ void AttentionNoticeHandler::addAttention(WinClient &client) {
95 // attach signals that will make notice go away 95 // attach signals that will make notice go away
96 client.dieSig().attach(this); 96 client.dieSig().attach(this);
97 client.focusSig().attach(this); 97 client.focusSig().attach(this);
98
99 // update _NET_WM_STATE atom
100 if (client.fbwindow())
101 client.fbwindow()->stateSig().notify();
98} 102}
99 103
100void AttentionNoticeHandler::update(FbTk::Subject *subj) { 104void AttentionNoticeHandler::update(FbTk::Subject *subj) {
101 105
106 // we need to be able to get the window
107 if (typeid(*subj) != typeid(WinClient::WinClientSubj))
108 return;
109
102 // all signals results in destruction of the notice 110 // all signals results in destruction of the notice
103 111
104 WinClient::WinClientSubj *winsubj = 112 WinClient::WinClientSubj *winsubj =
105 static_cast<WinClient::WinClientSubj *>(subj); 113 static_cast<WinClient::WinClientSubj *>(subj);
106 delete m_attentions[&winsubj->winClient()]; 114 delete m_attentions[&winsubj->winClient()];
107 m_attentions.erase(&winsubj->winClient()); 115 m_attentions.erase(&winsubj->winClient());
116
117 // update _NET_WM_STATE atom
118 FluxboxWindow *fbwin = winsubj->winClient().fbwindow();
119 if (fbwin && winsubj != &winsubj->winClient().dieSig())
120 fbwin->stateSig().notify();
108} 121}
109 122
123bool AttentionNoticeHandler::isDemandingAttention(WinClient &client) {
124 return m_attentions.find(&client) != m_attentions.end();
125}