* 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:
Axel Dörfler
2010-06-17 08:10:16 +00:00
parent cdb638a8ee
commit 4c139440d0
2 changed files with 23 additions and 2 deletions
+20 -2
View File
@@ -55,6 +55,8 @@ All rights reserved.
#include "StatusView.h"
#include "tracker_private.h"
#include <MessagePrivate.h>
// This is a very ugly hack to be able to call the private BMenuBar::StartMenuBar()
// method from the TBarWindow::ShowBeMenu() method.
@@ -105,8 +107,9 @@ TBarWindow::DispatchMessage(BMessage* message, BHandler* handler)
if (!((TBarApp*)be_app)->Settings()->autoRaise)
Activate(true);
if ((modifiers() & (B_CONTROL_KEY | B_COMMAND_KEY | B_OPTION_KEY
| B_SHIFT_KEY)) == (B_CONTROL_KEY | B_COMMAND_KEY)) {
if (_IsFocusMessage(message)
&& (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
fBarView->DragRegion()->MouseDown(
fBarView->DragRegion()->DragRegion().LeftTop());
@@ -614,3 +617,18 @@ TBarWindow::GetIconFrame(BMessage* message)
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;
}
+3
View File
@@ -85,6 +85,9 @@ public:
void GetIconFrame(BMessage* message);
private:
bool _IsFocusMessage(BMessage* message);
private:
static TBeMenu* sBeMenu;
TBarView* fBarView;