From 47a394ec139b7defdd57aeea2587f435716aa172 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Sun, 22 Jul 2012 13:22:48 -0400 Subject: [PATCH] Replace calls to DragRegion() with fDragRegion avoiding a function call. Move variables in MouseMoved down to just before they are used. --- src/apps/deskbar/BarView.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/apps/deskbar/BarView.cpp b/src/apps/deskbar/BarView.cpp index 44248e06d0..c2a9e26141 100644 --- a/src/apps/deskbar/BarView.cpp +++ b/src/apps/deskbar/BarView.cpp @@ -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(be_app)->IconSize(); if (setToHiddenSize) {