BPopUpMenu: install shortcuts into menu window instead of caller window

This reverts commit a502215d78.

Do not overwrite caller window shortcuts with popup menu shortcuts, otherwise shortcuts will stop working after closing popup menu.

Fixes #19439.

Change-Id: I2199ebd1d8cbfc6212c8fb9c1b6291f0d39ecb46
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9216
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
X512
2025-04-28 14:34:42 +00:00
committed by waddlesplash
parent 1de993d223
commit 1ab126b49f
2 changed files with 3 additions and 5 deletions
+3
View File
@@ -1648,6 +1648,9 @@ BMenu::_Show(bool selectFirstItem, bool keyDown)
return false;
}
if (ourWindow)
_Install(window);
_UpdateWindowViewSize(true);
window->Show();
-5
View File
@@ -16,7 +16,6 @@
#include <Application.h>
#include <Looper.h>
#include <MenuItem.h>
#include <MenuPrivate.h>
#include <Window.h>
#include <binary_compatibility/Interface.h>
@@ -351,10 +350,6 @@ BPopUpMenu::_Go(BPoint where, bool autoInvoke, bool startOpened,
BWindow* window = dynamic_cast<BWindow*>(BLooper::LooperForThread(find_thread(NULL)));
data->window = window;
// Install() items to prepare their shortcuts and set missing targets to target window
BPrivate::MenuPrivate menuPrivate(this);
menuPrivate.Install(window);
// Asynchronous menu: we set the BWindow menu's semaphore
// and let BWindow block when needed
if (async && window != NULL)