an eventually opened menu is now quit in BWindow::DispatchMessage()
before sending a B_MOUSE_DOWN message to any other view. This fixes bug 594 for real and another bug in BMenuBar. BMenuBar tracking will also be simplified a bit because of this. Install items to a NULL window on Show() as does R5 (although I don't know why yet). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17605 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include <AppMisc.h>
|
||||
#include <ApplicationPrivate.h>
|
||||
#include <InputServerTypes.h>
|
||||
#include <MenuPrivate.h>
|
||||
#include <MessagePrivate.h>
|
||||
#include <PortLink.h>
|
||||
#include <ServerProtocol.h>
|
||||
@@ -317,6 +318,10 @@ BWindow::~BWindow()
|
||||
{
|
||||
Lock();
|
||||
|
||||
if (BMenu *menu = dynamic_cast<BMenu *>(fFocus)) {
|
||||
menu->QuitTracking();
|
||||
}
|
||||
|
||||
// Wait if a menu is still tracking
|
||||
if (fMenuSem > 0) {
|
||||
while (acquire_sem(fMenuSem) == B_INTERRUPTED)
|
||||
@@ -904,6 +909,11 @@ FrameMoved(origin);
|
||||
|
||||
case B_MOUSE_DOWN:
|
||||
{
|
||||
// Close an eventually opened menu.
|
||||
if (BMenu *menu = dynamic_cast<BMenu *>(fFocus)) {
|
||||
menu->QuitTracking();
|
||||
}
|
||||
|
||||
if (BView *view = dynamic_cast<BView *>(target)) {
|
||||
BPoint where;
|
||||
msg->FindPoint("be:view_where", &where);
|
||||
@@ -1544,7 +1554,8 @@ BWindow::FindView(BPoint point) const
|
||||
}
|
||||
|
||||
|
||||
BView *BWindow::CurrentFocus() const
|
||||
BView *
|
||||
BWindow::CurrentFocus() const
|
||||
{
|
||||
return fFocus;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user