From 589125672b684f18fbfb81dddb3a3fe45c857516 Mon Sep 17 00:00:00 2001 From: Mark Tiefenbruck Date: Sun, 28 Jun 2009 13:10:58 -0700 Subject: allow matching screen number in ClientPattern --- ChangeLog | 2 ++ src/ClientPattern.cc | 13 +++++++++++++ src/ClientPattern.hh | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ab151a3..30cef63 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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) 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): 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(); } 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: 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? -- cgit v0.11.2