aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2011-03-15 08:49:06 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2011-03-15 08:49:06 (GMT)
commita53017cc3bad26906b99ac473513a10847c40bc0 (patch)
tree9b8c1300fd599d5203404b2197c594c1fb2d4895 /src
parentbb2ce5df8a814f9b858b6919356f7d37f10e6b9f (diff)
downloadfluxbox_pavel-a53017cc3bad26906b99ac473513a10847c40bc0.zip
fluxbox_pavel-a53017cc3bad26906b99ac473513a10847c40bc0.tar.bz2
bugfix: do not use anything from the current ClientMenuItem after m_client.focus(), closes #3210493
m_client.focus() might call ~ClientMenuItem(), thus m_client is not available anymore. the crash was triggered by trying to deiconify a client via the clientmenu. this triggers a signal to remove and destroy the current ClientMenuItem.
Diffstat (limited to 'src')
-rw-r--r--src/ClientMenu.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ClientMenu.cc b/src/ClientMenu.cc
index 6e1c442..063cad4 100644
--- a/src/ClientMenu.cc
+++ b/src/ClientMenu.cc
@@ -52,15 +52,17 @@ public:
52 return; 52 return;
53 53
54 // this MenuItem object can get destroyed as a result of focus(), so we 54 // this MenuItem object can get destroyed as a result of focus(), so we
55 // must get a local copy of the parent menu 55 // must get a local copy of anything we want to use here
56 // AFTER ~ClientMenuItem() is called.
56 FbTk::Menu *parent = menu(); 57 FbTk::Menu *parent = menu();
58 FocusControl& focus_control = m_client.screen().focusControl();
57 59
58 m_client.focus(); 60 m_client.focus();
59 fbwin->raise(); 61 fbwin->raise();
60 if ((mods & ControlMask) == 0) { 62 if ((mods & ControlMask) == 0) {
61 // Ignore any focus changes due to this menu closing 63 // Ignore any focus changes due to this menu closing
62 // (even in StrictMouseFocus mode) 64 // (even in StrictMouseFocus mode)
63 m_client.screen().focusControl().ignoreAtPointer(true); 65 focus_control.ignoreAtPointer(true);
64 parent->hide(); 66 parent->hide();
65 } 67 }
66 } 68 }