diff options
-rw-r--r-- | src/ClientMenu.cc | 6 |
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 | } |