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.
This commit is contained in:
parent
bb2ce5df8a
commit
a53017cc3b
1 changed files with 4 additions and 2 deletions
|
@ -52,15 +52,17 @@ public:
|
|||
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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue