Fix: UI: Close pie menu on window focus loss

Close open pie menus on window loss of focus, to prevent waiting for
the pie key release if it was released outside of focus.

Pull Request: https://projects.blender.org/blender/blender/pulls/134215
This commit is contained in:
Gilberto.R
2025-02-11 23:30:31 +01:00
committed by Harley Acheson
parent 312579ce82
commit b5b786b34f

View File

@@ -11607,6 +11607,16 @@ static int ui_pie_handler(bContext *C, const wmEvent *event, uiPopupBlockHandle
}
break;
case WINDEACTIVATE: {
/* Prevent waiting for the pie key release if it was released outside of focus. */
wmWindow *win = CTX_wm_window(C);
if (win) {
win->pie_event_type_lock = EVENT_NONE;
}
menu->menuretval = UI_RETURN_CANCEL;
break;
}
case EVT_ESCKEY:
case RIGHTMOUSE:
menu->menuretval = UI_RETURN_CANCEL;