aboutsummaryrefslogtreecommitdiff
path: root/src/Remember.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Remember.cc')
-rw-r--r--src/Remember.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Remember.cc b/src/Remember.cc
index 6f41528..d39cd3e 100644
--- a/src/Remember.cc
+++ b/src/Remember.cc
@@ -302,8 +302,17 @@ Application* Remember::find(WinClient &winclient) {
302Application * Remember::add(WinClient &winclient) { 302Application * Remember::add(WinClient &winclient) {
303 ClientPattern *p = new ClientPattern(); 303 ClientPattern *p = new ClientPattern();
304 Application *app = new Application(false); 304 Application *app = new Application(false);
305
305 // by default, we match against the WMClass of a window. 306 // by default, we match against the WMClass of a window.
306 p->addTerm(p->getProperty(ClientPattern::NAME, winclient), ClientPattern::NAME); 307 string win_name = p->getProperty(ClientPattern::NAME, winclient);
308
309 // replace special chars like ( ) and [ ] with \( \) and \[ \]
310 win_name = FbTk::StringUtil::replaceString(win_name, "(", "\\(");
311 win_name = FbTk::StringUtil::replaceString(win_name, ")", "\\)");
312 win_name = FbTk::StringUtil::replaceString(win_name, "[", "\\[");
313 win_name = FbTk::StringUtil::replaceString(win_name, "]", "\\]");
314
315 p->addTerm(win_name, ClientPattern::NAME);
307 m_clients[&winclient] = app; 316 m_clients[&winclient] = app;
308 p->addMatch(); 317 p->addMatch();
309 m_pats->push_back(make_pair(p, app)); 318 m_pats->push_back(make_pair(p, app));