allow matching screen number in ClientPattern

This commit is contained in:
Mark Tiefenbruck 2009-06-28 13:10:58 -07:00
parent bb05494751
commit 589125672b
3 changed files with 16 additions and 1 deletions

View file

@ -1,6 +1,8 @@
(Format: Year/Month/Day)
Changes for 1.1.2
*09/06/28:
* Allow matching screen number in ClientPattern (thanks Peter Hercek)
ClientPattern.cc
* Hide the menu when you click on a window (Mark)
Window.cc
* Make Raise/LowerLayer commands accept integer argument, defualt 2 (Mark)

View file

@ -134,6 +134,8 @@ ClientPattern::ClientPattern(const char *str):
prop = LAYER;
} else if (strcasecmp(memstr.c_str(), "urgent") == 0) {
prop = URGENT;
} else if (strcasecmp(memstr.c_str(), "screen") == 0) {
prop = SCREEN;
} else {
prop = NAME;
expr = match;
@ -245,6 +247,10 @@ string ClientPattern::toString() const {
break;
case URGENT:
pat.append("urgent=");
break;
case SCREEN:
pat.append("screen=");
break;
}
pat.append((*it)->orig);
@ -407,6 +413,13 @@ string ClientPattern::getProperty(WinProperty prop, const Focusable &client) {
return Fluxbox::instance()->attentionHandler()
.isDemandingAttention(client) ? "yes" : "no";
break;
case SCREEN: {
int screenId = client.screen().screenNumber();
char tmpstr[32];
sprintf(tmpstr, "%d", screenId);
return std::string(tmpstr);
break;
}
}
return client.getWMClassName();
}

View file

@ -53,7 +53,7 @@ public:
enum WinProperty {
TITLE, CLASS, NAME, ROLE, TRANSIENT,
MAXIMIZED, MINIMIZED, SHADED, STUCK, FOCUSHIDDEN, ICONHIDDEN,
WORKSPACE, WORKSPACENAME, HEAD, LAYER, URGENT
WORKSPACE, WORKSPACENAME, HEAD, LAYER, URGENT, SCREEN
};
/// Does this client match this pattern?