summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonb <simonb>2007-08-05 03:20:38 (GMT)
committersimonb <simonb>2007-08-05 03:20:38 (GMT)
commita9103a89cbcfc553617888fd16df4349e1097d77 (patch)
tree646453cbd3cdf4eb162053584a77c15473ad2946
parent2006d20d45eaa091c737067004ec7421a0cfc730 (diff)
downloadfluxbox_lack-a9103a89cbcfc553617888fd16df4349e1097d77.zip
fluxbox_lack-a9103a89cbcfc553617888fd16df4349e1097d77.tar.bz2
remember role too by default
-rw-r--r--ChangeLog7
-rw-r--r--src/Remember.cc30
2 files changed, 21 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 6222d3f..d759366 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,10 @@
1 (Format: Year/Month/Day) 1 (Format: Year/Month/Day)
2Changes for 1.0.0: 2Changes for 1.0.0:
3*07/08/05: 3*07/08/05:
4 * When saving window info for rememberm use class name AND instance name. 4 * When saving window info for rememberm use class name AND instance name,
5 This should fix firefox/thunderbird issues, but note that mplayer (nogui) 5 AND role if present. (Simon)
6 sets the vo driver name as the instance name. (Simon) 6 - This should fix firefox/thunderbird issues, but note that mplayer
7 (nogui) sets the vo driver name as the instance name.
7 Remember.cc 8 Remember.cc
8 * Fix menu heading encoding (Simon) 9 * Fix menu heading encoding (Simon)
9 sf.net bug #1712583: NLS:Non-latin characters displayed incorrectly in menu title 10 sf.net bug #1712583: NLS:Non-latin characters displayed incorrectly in menu title
diff --git a/src/Remember.cc b/src/Remember.cc
index 31b416a..2de6d86 100644
--- a/src/Remember.cc
+++ b/src/Remember.cc
@@ -76,6 +76,18 @@ using std::dec;
76 76
77namespace { 77namespace {
78 78
79// replace special chars like ( ) and [ ] with \( \) and \[ \]
80static string escapeRememberChars(string str) {
81 if (str.empty())
82 return str;
83
84 str = FbTk::StringUtil::replaceString(str, "(", "\\(");
85 str = FbTk::StringUtil::replaceString(str, ")", "\\)");
86 str = FbTk::StringUtil::replaceString(str, "[", "\\[");
87 str = FbTk::StringUtil::replaceString(str, "]", "\\]");
88 return str;
89}
90
79bool getuint(const char *val, unsigned int &ret) { 91bool getuint(const char *val, unsigned int &ret) {
80 return (sscanf(val, "%u", &ret) == 1); 92 return (sscanf(val, "%u", &ret) == 1);
81} 93}
@@ -319,22 +331,14 @@ Application * Remember::add(WinClient &winclient) {
319 Application *app = new Application(0); 331 Application *app = new Application(0);
320 332
321 // by default, we match against the WMClass of a window (instance and class strings) 333 // by default, we match against the WMClass of a window (instance and class strings)
322 string win_name = p->getProperty(ClientPattern::NAME, winclient); 334 string win_name = ::escapeRememberChars(p->getProperty(ClientPattern::NAME, winclient));
323 string win_class = p->getProperty(ClientPattern::CLASS, winclient); 335 string win_class = ::escapeRememberChars(p->getProperty(ClientPattern::CLASS, winclient));
324 336 string win_role = ::escapeRememberChars(p->getProperty(ClientPattern::ROLE, winclient));
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
331 win_class = FbTk::StringUtil::replaceString(win_class, "(", "\\(");
332 win_class = FbTk::StringUtil::replaceString(win_class, ")", "\\)");
333 win_class = FbTk::StringUtil::replaceString(win_class, "[", "\\[");
334 win_class = FbTk::StringUtil::replaceString(win_class, "]", "\\]");
335 337
336 p->addTerm(win_name, ClientPattern::NAME); 338 p->addTerm(win_name, ClientPattern::NAME);
337 p->addTerm(win_class, ClientPattern::CLASS); 339 p->addTerm(win_class, ClientPattern::CLASS);
340 if (!win_role.empty())
341 p->addTerm(win_role, ClientPattern::ROLE);
338 m_clients[&winclient] = app; 342 m_clients[&winclient] = app;
339 p->addMatch(); 343 p->addMatch();
340 m_pats->push_back(make_pair(p, app)); 344 m_pats->push_back(make_pair(p, app));