* The keyboard target was always the first menu in the window list - no matter if that was hidden or not.

This fixes the bug described by Stefano in r23343.
* Therefore, I enabled cached menu windows again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23356 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2008-01-10 21:26:55 +00:00
parent 9d2f3035cd
commit 737ce1c03c
2 changed files with 4 additions and 1 deletions

View File

@ -34,7 +34,7 @@
#include "utf8_functions.h"
#define USE_CACHED_MENUWINDOW 0
#define USE_CACHED_MENUWINDOW 1
using std::nothrow;
using BPrivate::BMenuWindow;

View File

@ -1172,6 +1172,9 @@ EventTarget*
Desktop::KeyboardEventTarget()
{
WindowLayer* window = _CurrentWindows().LastWindow();
while (window != NULL && window->IsHidden()) {
window = window->PreviousWindow(fCurrentWorkspace);
}
if (window != NULL && window->Feel() == kMenuWindowFeel)
return &window->EventTarget();