aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/AttentionNoticeHandler.cc9
-rw-r--r--src/AttentionNoticeHandler.hh2
-rw-r--r--src/ClientPattern.cc9
-rw-r--r--src/ClientPattern.hh2
4 files changed, 18 insertions, 4 deletions
diff --git a/src/AttentionNoticeHandler.cc b/src/AttentionNoticeHandler.cc
index 999b9d4..26dd4b5 100644
--- a/src/AttentionNoticeHandler.cc
+++ b/src/AttentionNoticeHandler.cc
@@ -119,6 +119,11 @@ void AttentionNoticeHandler::update(FbTk::Subject *subj) {
119 119
120} 120}
121 121
122bool AttentionNoticeHandler::isDemandingAttention(Focusable &client) { 122bool AttentionNoticeHandler::isDemandingAttention(const Focusable &client) {
123 return m_attentions.find(&client) != m_attentions.end(); 123 NoticeMap::iterator it = m_attentions.begin(), it_end = m_attentions.end();
124 for (; it != it_end; ++it) {
125 if (it->first == &client)
126 return true;
127 }
128 return false;
124} 129}
diff --git a/src/AttentionNoticeHandler.hh b/src/AttentionNoticeHandler.hh
index a2ebb23..3a98b09 100644
--- a/src/AttentionNoticeHandler.hh
+++ b/src/AttentionNoticeHandler.hh
@@ -47,7 +47,7 @@ public:
47 /// removes the client from the attention map 47 /// removes the client from the attention map
48 void update(FbTk::Subject *subj); 48 void update(FbTk::Subject *subj);
49 49
50 bool isDemandingAttention(Focusable &client); 50 bool isDemandingAttention(const Focusable &client);
51 51
52private: 52private:
53 NoticeMap m_attentions; 53 NoticeMap m_attentions;
diff --git a/src/ClientPattern.cc b/src/ClientPattern.cc
index d037bb4..c08a574 100644
--- a/src/ClientPattern.cc
+++ b/src/ClientPattern.cc
@@ -22,6 +22,7 @@
22 22
23#include "ClientPattern.hh" 23#include "ClientPattern.hh"
24 24
25#include "fluxbox.hh"
25#include "FocusControl.hh" 26#include "FocusControl.hh"
26#include "Layer.hh" 27#include "Layer.hh"
27#include "Screen.hh" 28#include "Screen.hh"
@@ -132,6 +133,8 @@ ClientPattern::ClientPattern(const char *str, bool default_no_transient):
132 prop = HEAD; 133 prop = HEAD;
133 } else if (strcasecmp(memstr.c_str(), "layer") == 0) { 134 } else if (strcasecmp(memstr.c_str(), "layer") == 0) {
134 prop = LAYER; 135 prop = LAYER;
136 } else if (strcasecmp(memstr.c_str(), "urgent") == 0) {
137 prop = URGENT;
135 } else { 138 } else {
136 prop = NAME; 139 prop = NAME;
137 expr = match; 140 expr = match;
@@ -244,6 +247,8 @@ string ClientPattern::toString() const {
244 case LAYER: 247 case LAYER:
245 pat.append("layer="); 248 pat.append("layer=");
246 break; 249 break;
250 case URGENT:
251 pat.append("urgent=");
247 } 252 }
248 253
249 pat.append((*it)->orig); 254 pat.append((*it)->orig);
@@ -403,6 +408,10 @@ string ClientPattern::getProperty(WinProperty prop, const Focusable &client) {
403 case LAYER: 408 case LAYER:
404 return fbwin ? ::Layer::getString(fbwin->layerNum()) : ""; 409 return fbwin ? ::Layer::getString(fbwin->layerNum()) : "";
405 break; 410 break;
411 case URGENT:
412 return Fluxbox::instance()->attentionHandler()
413 .isDemandingAttention(client) ? "yes" : "no";
414 break;
406 } 415 }
407 return client.getWMClassName(); 416 return client.getWMClassName();
408} 417}
diff --git a/src/ClientPattern.hh b/src/ClientPattern.hh
index 1e08f35..1fd2722 100644
--- a/src/ClientPattern.hh
+++ b/src/ClientPattern.hh
@@ -53,7 +53,7 @@ public:
53 enum WinProperty { 53 enum WinProperty {
54 TITLE, CLASS, NAME, ROLE, TRANSIENT, 54 TITLE, CLASS, NAME, ROLE, TRANSIENT,
55 MAXIMIZED, MINIMIZED, SHADED, STUCK, FOCUSHIDDEN, ICONHIDDEN, 55 MAXIMIZED, MINIMIZED, SHADED, STUCK, FOCUSHIDDEN, ICONHIDDEN,
56 WORKSPACE, WORKSPACENAME, HEAD, LAYER 56 WORKSPACE, WORKSPACENAME, HEAD, LAYER, URGENT
57 }; 57 };
58 58
59 /// Does this client match this pattern? 59 /// Does this client match this pattern?