aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2009-06-28 20:10:58 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2009-06-28 20:10:58 (GMT)
commit589125672b684f18fbfb81dddb3a3fe45c857516 (patch)
treeb58b68e89b0987bbe37b8d411533afdfdd39847b
parentbb05494751e978b3e5edd1a54f7402a898762b9f (diff)
downloadfluxbox_pavel-589125672b684f18fbfb81dddb3a3fe45c857516.zip
fluxbox_pavel-589125672b684f18fbfb81dddb3a3fe45c857516.tar.bz2
allow matching screen number in ClientPattern
-rw-r--r--ChangeLog2
-rw-r--r--src/ClientPattern.cc13
-rw-r--r--src/ClientPattern.hh2
3 files changed, 16 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ab151a3..30cef63 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
1 (Format: Year/Month/Day) 1 (Format: Year/Month/Day)
2Changes for 1.1.2 2Changes for 1.1.2
3*09/06/28: 3*09/06/28:
4 * Allow matching screen number in ClientPattern (thanks Peter Hercek)
5 ClientPattern.cc
4 * Hide the menu when you click on a window (Mark) 6 * Hide the menu when you click on a window (Mark)
5 Window.cc 7 Window.cc
6 * Make Raise/LowerLayer commands accept integer argument, defualt 2 (Mark) 8 * Make Raise/LowerLayer commands accept integer argument, defualt 2 (Mark)
diff --git a/src/ClientPattern.cc b/src/ClientPattern.cc
index 72bf161..84f421a 100644
--- a/src/ClientPattern.cc
+++ b/src/ClientPattern.cc
@@ -134,6 +134,8 @@ ClientPattern::ClientPattern(const char *str):
134 prop = LAYER; 134 prop = LAYER;
135 } else if (strcasecmp(memstr.c_str(), "urgent") == 0) { 135 } else if (strcasecmp(memstr.c_str(), "urgent") == 0) {
136 prop = URGENT; 136 prop = URGENT;
137 } else if (strcasecmp(memstr.c_str(), "screen") == 0) {
138 prop = SCREEN;
137 } else { 139 } else {
138 prop = NAME; 140 prop = NAME;
139 expr = match; 141 expr = match;
@@ -245,6 +247,10 @@ string ClientPattern::toString() const {
245 break; 247 break;
246 case URGENT: 248 case URGENT:
247 pat.append("urgent="); 249 pat.append("urgent=");
250 break;
251 case SCREEN:
252 pat.append("screen=");
253 break;
248 } 254 }
249 255
250 pat.append((*it)->orig); 256 pat.append((*it)->orig);
@@ -407,6 +413,13 @@ string ClientPattern::getProperty(WinProperty prop, const Focusable &client) {
407 return Fluxbox::instance()->attentionHandler() 413 return Fluxbox::instance()->attentionHandler()
408 .isDemandingAttention(client) ? "yes" : "no"; 414 .isDemandingAttention(client) ? "yes" : "no";
409 break; 415 break;
416 case SCREEN: {
417 int screenId = client.screen().screenNumber();
418 char tmpstr[32];
419 sprintf(tmpstr, "%d", screenId);
420 return std::string(tmpstr);
421 break;
422 }
410 } 423 }
411 return client.getWMClassName(); 424 return client.getWMClassName();
412} 425}
diff --git a/src/ClientPattern.hh b/src/ClientPattern.hh
index 4e25cb5..153b7c0 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, URGENT 56 WORKSPACE, WORKSPACENAME, HEAD, LAYER, URGENT, SCREEN
57 }; 57 };
58 58
59 /// Does this client match this pattern? 59 /// Does this client match this pattern?