summaryrefslogtreecommitdiff
blob: 55c6d0a9f978216ae42e26ea2fb2e046796c486f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Index: src/Remember.cc
===================================================================
RCS file: /cvsroot/fluxbox/fluxbox/src/Remember.cc,v
retrieving revision 1.39
retrieving revision 1.42
diff -u -r1.39 -r1.42
--- src/Remember.cc	10 Aug 2004 18:35:05 -0000	1.39
+++ src/Remember.cc	4 Sep 2004 04:54:38 -0000	1.42
@@ -79,14 +79,19 @@
         m_win(fbwin), m_attrib(attrib) {}
 
     bool isSelected() const {
-        return m_remember.isRemembered(m_win.winClient(), m_attrib);
+        if (m_win.numClients()) // ensure it HAS clients
+            return m_remember.isRemembered(m_win.winClient(), m_attrib);
+        else
+            return false;
     }
 
     bool isEnabled() const {
         if (m_attrib != Remember::REM_JUMPWORKSPACE) 
             return true;
-        else 
+        else if (m_win.numClients())
             return (m_remember.isRemembered(m_win.winClient(), Remember::REM_WORKSPACE));
+        else
+            return false;
     }
 
     void click(int button, int time) {
@@ -291,8 +296,10 @@
             }
 
             row++;
-            if (line[0] == '#')
-                continue;  //the line is commented
+            FbTk::StringUtil::removeFirstWhitespace(line);
+            FbTk::StringUtil::removeTrailingWhitespace(line);
+            if (line.size() == 0 || line[0] == '#')
+                continue;  //the line is commented or blank
             int parse_pos = 0, err = 0;
             string str_key, str_option, str_label;
             err = FbTk::StringUtil::getStringBetween(str_key, 
@@ -333,7 +340,7 @@
                 } else if (str_label == "NORMAL") {
                     l = Fluxbox::instance()->getNormalLayer();
                 } else if (str_label == "TOP") {
-                    l = Fluxbox::instance()->getNormalLayer();
+                    l = Fluxbox::instance()->getTopLayer();
                 } else if (str_label == "DOCK") {
                     l = Fluxbox::instance()->getDockLayer();
                 } else if (str_label == "ABOVEDOCK") {
@@ -454,7 +461,9 @@
             std::list<ClientPattern *> grouped_pats;
             while (getline(apps_file, line) && ! apps_file.eof()) {
                 row++;
-                if (line[0] == '#')
+                FbTk::StringUtil::removeFirstWhitespace(line);
+                FbTk::StringUtil::removeTrailingWhitespace(line);
+                if (line.size() == 0 || line[0] == '#')
                     continue;
                 string key;
                 int err=0;