all repos — fluxbox @ a84fe20c49198c1ef74616e51152a5e1363fab41

custom fork of the fluxbox windowmanager

add (urgent=yes|no) options to ClientPattern
Mark Tiefenbruck mark@fluxbox.org
commit

a84fe20c49198c1ef74616e51152a5e1363fab41

parent

6509fe0cacf25f30fb6fce9df9569d14f00f0a8f

M ChangeLogChangeLog

@@ -1,5 +1,8 @@

(Format: Year/Month/Day) Changes for 1.1 +*08/06/08: + * Add (urgent=yes|no) option to client patterns (Mark) + ClientPattern.cc/hh *08/06/06: * Allow window menu items in ordinary menus (Mark) MenuCreator.cc/hh
M src/AttentionNoticeHandler.ccsrc/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.hhsrc/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.ccsrc/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.hhsrc/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?