* Made menu windows behave differently than others: before, they were just

always put between window screens and modal all windows (before floating
  all ones), so a BWindowScreen couldn't have menus at all.
  Now, they behave more like floating app windows, just that they float above
  all other application windows, such that all window feels (also BWindowScreen)
  can now have menus.
* Reenabled keyboard redirection to the top most window in case it's a menu;
  bug #1152 no longer applies due to the above change.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22149 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2007-09-02 12:16:28 +00:00
parent 4c751e51c8
commit 8a3cfa2cf3
2 changed files with 12 additions and 7 deletions

View File

@ -1107,13 +1107,10 @@ Desktop::_UpdateFronts(bool updateFloating)
EventTarget*
Desktop::KeyboardEventTarget()
{
// TODO: Not yet useful, and prevents a crashing application
// which has opened menu windows to be debugged (ticket #1152)
#if 0
WindowLayer* window = _CurrentWindows().LastWindow();
if (window != NULL && window->Feel() == kMenuWindowFeel)
return &window->EventTarget();
#endif
if (FocusWindow() != NULL)
return &FocusWindow()->EventTarget();

View File

@ -1528,13 +1528,21 @@ WindowLayer::RemoveFromSubset(WindowLayer* window)
bool
WindowLayer::HasInSubset(const WindowLayer* window) const
{
if (window == NULL || fFeel == window->Feel() || fFeel == B_NORMAL_WINDOW_FEEL)
if (window == NULL || fFeel == window->Feel()
|| fFeel == B_NORMAL_WINDOW_FEEL)
return false;
// Menus are a special case: they will always be on-top of every window
// of their application
if (fFeel == kMenuWindowFeel)
return window->ServerWindow()->App() == ServerWindow()->App();
else if (window->Feel() == kMenuWindowFeel)
return false;
// we have a few special feels that have a fixed order
const int32 feel[] = {kWindowScreenFeel, kMenuWindowFeel,
B_MODAL_ALL_WINDOW_FEEL, B_FLOATING_ALL_WINDOW_FEEL, 0};
const int32 feel[] = {kWindowScreenFeel, B_MODAL_ALL_WINDOW_FEEL,
B_FLOATING_ALL_WINDOW_FEEL, 0};
for (int32 order = 0; feel[order]; order++) {
if (fFeel == feel[order])