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.
Mathias Gumz akira at fluxbox dot org
1 files changed,
4 insertions(+),
2 deletions(-)
jump to
M
src/ClientMenu.cc
→
src/ClientMenu.cc
@@ -52,15 +52,17 @@ if (fbwin == 0)
return; // this MenuItem object can get destroyed as a result of focus(), so we - // must get a local copy of the parent menu + // must get a local copy of anything we want to use here + // AFTER ~ClientMenuItem() is called. FbTk::Menu *parent = menu(); + FocusControl& focus_control = m_client.screen().focusControl(); m_client.focus(); fbwin->raise(); if ((mods & ControlMask) == 0) { // Ignore any focus changes due to this menu closing // (even in StrictMouseFocus mode) - m_client.screen().focusControl().ignoreAtPointer(true); + focus_control.ignoreAtPointer(true); parent->hide(); } }