Replace calls to DragRegion() with fDragRegion avoiding a function call. Move variables in MouseMoved down to just before they are used.

This commit is contained in:
John Scipione
2012-07-22 16:00:20 -04:00
parent d7ed9414a3
commit 47a394ec13
+9 -10
View File
@@ -254,19 +254,19 @@ TBarView::MessageReceived(BMessage* message)
void
TBarView::MouseMoved(BPoint where, uint32 transit, const BMessage* dragMessage)
{
desk_settings* settings = ((TBarApp*)be_app)->Settings();
bool alwaysOnTop = settings->alwaysOnTop;
bool autoRaise = settings->autoRaise;
bool autoHide = settings->autoHide;
if (DragRegion()->IsDragging()) {
DragRegion()->MouseMoved(where, transit, dragMessage);
if (fDragRegion->IsDragging()) {
fDragRegion->MouseMoved(where, transit, dragMessage);
return;
}
if (transit == B_ENTERED_VIEW && EventMask() == 0)
SetEventMask(B_POINTER_EVENTS, B_NO_POINTER_HISTORY);
desk_settings* settings = ((TBarApp*)be_app)->Settings();
bool alwaysOnTop = settings->alwaysOnTop;
bool autoRaise = settings->autoRaise;
bool autoHide = settings->autoHide;
if (!autoRaise && !autoHide) {
if (transit == B_EXITED_VIEW || transit == B_OUTSIDE_VIEW)
SetEventMask(0);
@@ -324,8 +324,7 @@ TBarView::MouseDown(BPoint where)
if ((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
DragRegion()->MouseDown(
DragRegion()->DragRegion().LeftTop());
fDragRegion->MouseDown(fDragRegion->DragRegion().LeftTop());
return;
}
} else {
@@ -504,7 +503,7 @@ TBarView::GetPreferredWindowSize(BRect screenFrame, float* width, float* height)
float windowHeight = 0;
float windowWidth = sMinimumWindowWidth;
bool setToHiddenSize = ((TBarApp*)be_app)->Settings()->autoHide
&& IsHidden() && !DragRegion()->IsDragging();
&& IsHidden() && !fDragRegion->IsDragging();
int32 iconSize = static_cast<TBarApp*>(be_app)->IconSize();
if (setToHiddenSize) {