aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ClientPattern.hh2
-rw-r--r--src/FocusableList.cc8
-rw-r--r--src/Remember.cc10
-rw-r--r--src/WorkspaceCmd.cc3
4 files changed, 19 insertions, 4 deletions
diff --git a/src/ClientPattern.hh b/src/ClientPattern.hh
index 611adeb..4e25cb5 100644
--- a/src/ClientPattern.hh
+++ b/src/ClientPattern.hh
@@ -74,6 +74,8 @@ public:
74 bool addTerm(const std::string &str, WinProperty prop, bool negate = false); 74 bool addTerm(const std::string &str, WinProperty prop, bool negate = false);
75 75
76 void addMatch() { ++m_nummatches; } 76 void addMatch() { ++m_nummatches; }
77 void removeMatch() { --m_nummatches; }
78 void resetMatches() { m_nummatches = 0; }
77 79
78 // whether this pattern has identical matching criteria 80 // whether this pattern has identical matching criteria
79 bool operator ==(const ClientPattern &pat) const; 81 bool operator ==(const ClientPattern &pat) const;
diff --git a/src/FocusableList.cc b/src/FocusableList.cc
index d15e10a..98492b8 100644
--- a/src/FocusableList.cc
+++ b/src/FocusableList.cc
@@ -156,10 +156,12 @@ void FocusableList::checkUpdate(Focusable &win) {
156 if (contains(win)) { 156 if (contains(win)) {
157 if (!m_pat->match(win)) { 157 if (!m_pat->match(win)) {
158 m_list.remove(&win); 158 m_list.remove(&win);
159 m_pat->removeMatch();
159 m_removesig.notify(&win); 160 m_removesig.notify(&win);
160 } 161 }
161 } else if (m_pat->match(win)) { 162 } else if (m_pat->match(win)) {
162 insertFromParent(win); 163 insertFromParent(win);
164 m_pat->addMatch();
163 m_addsig.notify(&win); 165 m_addsig.notify(&win);
164 } 166 }
165} 167}
@@ -194,9 +196,10 @@ void FocusableList::addMatching() {
194 const Focusables list = m_parent->clientList(); 196 const Focusables list = m_parent->clientList();
195 Focusables::const_iterator it = list.begin(), it_end = list.end(); 197 Focusables::const_iterator it = list.begin(), it_end = list.end();
196 for (; it != it_end; ++it) { 198 for (; it != it_end; ++it) {
197 if (m_pat->match(**it)) 199 if (m_pat->match(**it)) {
198 pushBack(**it); 200 pushBack(**it);
199 else // we still want to watch it, in case it changes to match 201 m_pat->addMatch();
202 } else // we still want to watch it, in case it changes to match
200 attachSignals(**it); 203 attachSignals(**it);
201 } 204 }
202} 205}
@@ -279,6 +282,7 @@ void FocusableList::reset() {
279 detachSignals(*m_list.back()); 282 detachSignals(*m_list.back());
280 m_list.pop_back(); 283 m_list.pop_back();
281 } 284 }
285 m_pat->resetMatches();
282 if (m_parent) 286 if (m_parent)
283 addMatching(); 287 addMatching();
284 m_resetsig.notify(0); 288 m_resetsig.notify(0);
diff --git a/src/Remember.cc b/src/Remember.cc
index 43437f4..a1f5d62 100644
--- a/src/Remember.cc
+++ b/src/Remember.cc
@@ -1373,6 +1373,16 @@ void Remember::updateClientClose(WinClient &winclient) {
1373 checkReload(); // reload if it's changed 1373 checkReload(); // reload if it's changed
1374 Application *app = find(winclient); 1374 Application *app = find(winclient);
1375 1375
1376 if (app) {
1377 Patterns::iterator it = m_pats->begin();
1378 for (; it != m_pats->end(); it++) {
1379 if (it->second == app) {
1380 it->first->removeMatch();
1381 break;
1382 }
1383 }
1384 }
1385
1376 if (app && (app->save_on_close_remember && app->save_on_close)) { 1386 if (app && (app->save_on_close_remember && app->save_on_close)) {
1377 1387
1378 for (int attrib = 0; attrib < REM_LASTATTRIB; attrib++) { 1388 for (int attrib = 0; attrib < REM_LASTATTRIB; attrib++) {
diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc
index 592b34b..41c7832 100644
--- a/src/WorkspaceCmd.cc
+++ b/src/WorkspaceCmd.cc
@@ -69,8 +69,7 @@ FbTk::Command<void> *WindowListCmd::parse(const string &command, const string &a
69 if (tokens.size() > 1) { 69 if (tokens.size() > 1) {
70 FocusableList::parseArgs(tokens[1], opts, pat); 70 FocusableList::parseArgs(tokens[1], opts, pat);
71 71
72 filter = FbTk::CommandParser<bool>::instance().parse(pat, 72 filter = FbTk::CommandParser<bool>::instance().parse(pat, trusted);
73 trusted);
74 } 73 }
75 74
76 return new WindowListCmd(FbTk::RefCount<FbTk::Command<void> >(cmd), opts, 75 return new WindowListCmd(FbTk::RefCount<FbTk::Command<void> >(cmd), opts,