aboutsummaryrefslogtreecommitdiff
path: root/src/Remember.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Remember.cc')
-rw-r--r--src/Remember.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Remember.cc b/src/Remember.cc
index aec9921..31b416a 100644
--- a/src/Remember.cc
+++ b/src/Remember.cc
@@ -318,15 +318,22 @@ Application * Remember::add(WinClient &winclient) {
318 ClientPattern *p = new ClientPattern(); 318 ClientPattern *p = new ClientPattern();
319 Application *app = new Application(0); 319 Application *app = new Application(0);
320 320
321 // by default, we match against the WMClass of a window. 321 // by default, we match against the WMClass of a window (instance and class strings)
322 string win_name = p->getProperty(ClientPattern::NAME, winclient);
322 string win_class = p->getProperty(ClientPattern::CLASS, winclient); 323 string win_class = p->getProperty(ClientPattern::CLASS, winclient);
323 324
324 // replace special chars like ( ) and [ ] with \( \) and \[ \] 325 // replace special chars like ( ) and [ ] with \( \) and \[ \]
326 win_name = FbTk::StringUtil::replaceString(win_name, "(", "\\(");
327 win_name = FbTk::StringUtil::replaceString(win_name, ")", "\\)");
328 win_name = FbTk::StringUtil::replaceString(win_name, "[", "\\[");
329 win_name = FbTk::StringUtil::replaceString(win_name, "]", "\\]");
330
325 win_class = FbTk::StringUtil::replaceString(win_class, "(", "\\("); 331 win_class = FbTk::StringUtil::replaceString(win_class, "(", "\\(");
326 win_class = FbTk::StringUtil::replaceString(win_class, ")", "\\)"); 332 win_class = FbTk::StringUtil::replaceString(win_class, ")", "\\)");
327 win_class = FbTk::StringUtil::replaceString(win_class, "[", "\\["); 333 win_class = FbTk::StringUtil::replaceString(win_class, "[", "\\[");
328 win_class = FbTk::StringUtil::replaceString(win_class, "]", "\\]"); 334 win_class = FbTk::StringUtil::replaceString(win_class, "]", "\\]");
329 335
336 p->addTerm(win_name, ClientPattern::NAME);
330 p->addTerm(win_class, ClientPattern::CLASS); 337 p->addTerm(win_class, ClientPattern::CLASS);
331 m_clients[&winclient] = app; 338 m_clients[&winclient] = app;
332 p->addMatch(); 339 p->addMatch();