diff options
author | akir <akir> | 2004-09-02 09:52:26 (GMT) |
---|---|---|
committer | akir <akir> | 2004-09-02 09:52:26 (GMT) |
commit | f2db83f3fd77b42392c3b91f038ae61a1752ee2f (patch) | |
tree | 59b38d7ddcf80c831fdded7303bb51d560c2558b /src | |
parent | 4b1b3f592aa4308bce6f7448ead5322fb3b269f7 (diff) | |
download | fluxbox_lack-f2db83f3fd77b42392c3b91f038ae61a1752ee2f.zip fluxbox_lack-f2db83f3fd77b42392c3b91f038ae61a1752ee2f.tar.bz2 |
fix to avoid crash when in remember-submenu and closing the application
-> current clientwindow would be 0x0 -> crash
Diffstat (limited to 'src')
-rw-r--r-- | src/Remember.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Remember.cc b/src/Remember.cc index 47528af..05690d4 100644 --- a/src/Remember.cc +++ b/src/Remember.cc | |||
@@ -21,7 +21,7 @@ | |||
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
22 | // DEALINGS IN THE SOFTWARE. | 22 | // DEALINGS IN THE SOFTWARE. |
23 | 23 | ||
24 | // $Id: Remember.cc,v 1.40 2004/09/02 08:58:06 akir Exp $ | 24 | // $Id: Remember.cc,v 1.41 2004/09/02 09:52:26 akir Exp $ |
25 | 25 | ||
26 | #include "Remember.hh" | 26 | #include "Remember.hh" |
27 | #include "ClientPattern.hh" | 27 | #include "ClientPattern.hh" |
@@ -79,14 +79,19 @@ public: | |||
79 | m_win(fbwin), m_attrib(attrib) {} | 79 | m_win(fbwin), m_attrib(attrib) {} |
80 | 80 | ||
81 | bool isSelected() const { | 81 | bool isSelected() const { |
82 | return m_remember.isRemembered(m_win.winClient(), m_attrib); | 82 | if (m_win.numClients()) // ensure it HAS clients |
83 | return m_remember.isRemembered(m_win.winClient(), m_attrib); | ||
84 | else | ||
85 | return false; | ||
83 | } | 86 | } |
84 | 87 | ||
85 | bool isEnabled() const { | 88 | bool isEnabled() const { |
86 | if (m_attrib != Remember::REM_JUMPWORKSPACE) | 89 | if (m_attrib != Remember::REM_JUMPWORKSPACE) |
87 | return true; | 90 | return true; |
88 | else | 91 | else if (m_win.numClients()) |
89 | return (m_remember.isRemembered(m_win.winClient(), Remember::REM_WORKSPACE)); | 92 | return (m_remember.isRemembered(m_win.winClient(), Remember::REM_WORKSPACE)); |
93 | else | ||
94 | return false; | ||
90 | } | 95 | } |
91 | 96 | ||
92 | void click(int button, int time) { | 97 | void click(int button, int time) { |