From 5fc277afaa7eaf974b31289a7bed695e3093ed20 Mon Sep 17 00:00:00 2001 From: simonb Date: Sun, 5 Aug 2007 03:11:05 +0000 Subject: port default change from trunk --- src/Remember.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Remember.cc b/src/Remember.cc index cfd0d61..fa9b2ee 100644 --- a/src/Remember.cc +++ b/src/Remember.cc @@ -318,15 +318,22 @@ Application * Remember::add(WinClient &winclient) { ClientPattern *p = new ClientPattern(); Application *app = new Application(false); - // by default, we match against the WMClass of a window. + // by default, we match against the WMClass of a window (instance and class strings) + string win_name = p->getProperty(ClientPattern::NAME, winclient); string win_class = p->getProperty(ClientPattern::CLASS, winclient); // replace special chars like ( ) and [ ] with \( \) and \[ \] + win_name = FbTk::StringUtil::replaceString(win_name, "(", "\\("); + win_name = FbTk::StringUtil::replaceString(win_name, ")", "\\)"); + win_name = FbTk::StringUtil::replaceString(win_name, "[", "\\["); + win_name = FbTk::StringUtil::replaceString(win_name, "]", "\\]"); + win_class = FbTk::StringUtil::replaceString(win_class, "(", "\\("); win_class = FbTk::StringUtil::replaceString(win_class, ")", "\\)"); win_class = FbTk::StringUtil::replaceString(win_class, "[", "\\["); win_class = FbTk::StringUtil::replaceString(win_class, "]", "\\]"); + p->addTerm(win_name, ClientPattern::NAME); p->addTerm(win_class, ClientPattern::CLASS); m_clients[&winclient] = app; p->addMatch(); -- cgit v0.11.2