* Only move the window when we were targeted. This fixes #6179.
* I wondered if I should make BWindow::_IsFocusMessage() public - it determines whether or not the message was retrieved via normal focus, or via the SetEventMask() functionality. Any opinions? git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37163 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -55,6 +55,8 @@ All rights reserved.
|
|||||||
#include "StatusView.h"
|
#include "StatusView.h"
|
||||||
#include "tracker_private.h"
|
#include "tracker_private.h"
|
||||||
|
|
||||||
|
#include <MessagePrivate.h>
|
||||||
|
|
||||||
|
|
||||||
// This is a very ugly hack to be able to call the private BMenuBar::StartMenuBar()
|
// This is a very ugly hack to be able to call the private BMenuBar::StartMenuBar()
|
||||||
// method from the TBarWindow::ShowBeMenu() method.
|
// method from the TBarWindow::ShowBeMenu() method.
|
||||||
@@ -105,8 +107,9 @@ TBarWindow::DispatchMessage(BMessage* message, BHandler* handler)
|
|||||||
if (!((TBarApp*)be_app)->Settings()->autoRaise)
|
if (!((TBarApp*)be_app)->Settings()->autoRaise)
|
||||||
Activate(true);
|
Activate(true);
|
||||||
|
|
||||||
if ((modifiers() & (B_CONTROL_KEY | B_COMMAND_KEY | B_OPTION_KEY
|
if (_IsFocusMessage(message)
|
||||||
| B_SHIFT_KEY)) == (B_CONTROL_KEY | B_COMMAND_KEY)) {
|
&& (modifiers() & (B_CONTROL_KEY | B_COMMAND_KEY | B_OPTION_KEY
|
||||||
|
| B_SHIFT_KEY)) == (B_CONTROL_KEY | B_COMMAND_KEY)) {
|
||||||
// The window key was pressed - enter dragging code
|
// The window key was pressed - enter dragging code
|
||||||
fBarView->DragRegion()->MouseDown(
|
fBarView->DragRegion()->MouseDown(
|
||||||
fBarView->DragRegion()->DragRegion().LeftTop());
|
fBarView->DragRegion()->DragRegion().LeftTop());
|
||||||
@@ -614,3 +617,18 @@ TBarWindow::GetIconFrame(BMessage* message)
|
|||||||
message->SendReply(&reply);
|
message->SendReply(&reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
TBarWindow::_IsFocusMessage(BMessage* message)
|
||||||
|
{
|
||||||
|
BMessage::Private messagePrivate(message);
|
||||||
|
if (!messagePrivate.UsePreferredTarget())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
bool feedFocus;
|
||||||
|
if (message->HasInt32("_token")
|
||||||
|
&& (message->FindBool("_feed_focus", &feedFocus) != B_OK || !feedFocus))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|||||||
@@ -85,6 +85,9 @@ public:
|
|||||||
|
|
||||||
void GetIconFrame(BMessage* message);
|
void GetIconFrame(BMessage* message);
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool _IsFocusMessage(BMessage* message);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static TBeMenu* sBeMenu;
|
static TBeMenu* sBeMenu;
|
||||||
TBarView* fBarView;
|
TBarView* fBarView;
|
||||||
|
|||||||
Reference in New Issue
Block a user