add (urgent=yes|no) options to ClientPattern
Mark Tiefenbruck mark@fluxbox.org
5 files changed,
21 insertions(+),
4 deletions(-)
M
src/AttentionNoticeHandler.cc
→
src/AttentionNoticeHandler.cc
@@ -119,6 +119,11 @@ fbwin->stateSig().notify();
} -bool AttentionNoticeHandler::isDemandingAttention(Focusable &client) { - return m_attentions.find(&client) != m_attentions.end(); +bool AttentionNoticeHandler::isDemandingAttention(const Focusable &client) { + NoticeMap::iterator it = m_attentions.begin(), it_end = m_attentions.end(); + for (; it != it_end; ++it) { + if (it->first == &client) + return true; + } + return false; }
M
src/AttentionNoticeHandler.hh
→
src/AttentionNoticeHandler.hh
@@ -47,7 +47,7 @@ void addAttention(Focusable &client);
/// removes the client from the attention map void update(FbTk::Subject *subj); - bool isDemandingAttention(Focusable &client); + bool isDemandingAttention(const Focusable &client); private: NoticeMap m_attentions;
M
src/ClientPattern.cc
→
src/ClientPattern.cc
@@ -22,6 +22,7 @@ // DEALINGS IN THE SOFTWARE.
#include "ClientPattern.hh" +#include "fluxbox.hh" #include "FocusControl.hh" #include "Layer.hh" #include "Screen.hh"@@ -132,6 +133,8 @@ } else if (strcasecmp(memstr.c_str(), "head") == 0) {
prop = HEAD; } else if (strcasecmp(memstr.c_str(), "layer") == 0) { prop = LAYER; + } else if (strcasecmp(memstr.c_str(), "urgent") == 0) { + prop = URGENT; } else { prop = NAME; expr = match;@@ -244,6 +247,8 @@ break;
case LAYER: pat.append("layer="); break; + case URGENT: + pat.append("urgent="); } pat.append((*it)->orig);@@ -402,6 +407,10 @@ break;
} case LAYER: return fbwin ? ::Layer::getString(fbwin->layerNum()) : ""; + break; + case URGENT: + return Fluxbox::instance()->attentionHandler() + .isDemandingAttention(client) ? "yes" : "no"; break; } return client.getWMClassName();
M
src/ClientPattern.hh
→
src/ClientPattern.hh
@@ -53,7 +53,7 @@
enum WinProperty { TITLE, CLASS, NAME, ROLE, TRANSIENT, MAXIMIZED, MINIMIZED, SHADED, STUCK, FOCUSHIDDEN, ICONHIDDEN, - WORKSPACE, WORKSPACENAME, HEAD, LAYER + WORKSPACE, WORKSPACENAME, HEAD, LAYER, URGENT }; /// Does this client match this pattern?