[haiku-commits] haiku: hrev45200 - src/servers/app/decorator

  • From: jscipione@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 25 Jan 2013 07:30:55 +0100 (CET)

hrev45200 adds 1 changeset to branch 'master'
old head: 5a0b5a5d521e8d4b3e106f98198d0c27132a9ddc
new head: ae883c5f1597be8a7098bfab659b43251839998f
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=ae883c5+%5E5a0b5a5

----------------------------------------------------------------------------

ae883c5: Reset cursor if kAcceptKeyboardFocusFlag is set.
  
  This basically affects menus which are not movable, and not
  resizable but have that flag set because they take input anyway.
  This change shows the regular cursor over menu windows even
  in window management mode when ctrl+alt are held down.
  
  Also rename _SetNowAllowedCursor to _SetNotAllowedCursor, typo.

                                     [ John Scipione <jscipione@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev45200
Commit:      ae883c5f1597be8a7098bfab659b43251839998f
URL:         http://cgit.haiku-os.org/haiku/commit/?id=ae883c5
Author:      John Scipione <jscipione@xxxxxxxxx>
Date:        Fri Jan 25 06:27:46 2013 UTC

----------------------------------------------------------------------------

2 files changed, 13 insertions(+), 7 deletions(-)
.../app/decorator/DefaultWindowBehaviour.cpp       | 18 ++++++++++++------
src/servers/app/decorator/DefaultWindowBehaviour.h |  2 +-

----------------------------------------------------------------------------

diff --git a/src/servers/app/decorator/DefaultWindowBehaviour.cpp 
b/src/servers/app/decorator/DefaultWindowBehaviour.cpp
index 7166aff..dd16b5c 100644
--- a/src/servers/app/decorator/DefaultWindowBehaviour.cpp
+++ b/src/servers/app/decorator/DefaultWindowBehaviour.cpp
@@ -702,8 +702,10 @@ 
DefaultWindowBehaviour::ManageWindowState::EnterState(State* previousState)
        // Update the mouse cursor
        if ((fWindow->Flags() & B_NOT_MOVABLE) == 0)
                fBehavior._SetMoveCursor();
+       else if ((fWindow->Flags() & kAcceptKeyboardFocusFlag) != 0)
+               fBehavior._ResetCursor();
        else
-               fBehavior._SetNowAllowedCursor();
+               fBehavior._SetNotAllowedCursor();
 
        _UpdateResizeArrows(fLastMousePosition);
 }
@@ -730,8 +732,10 @@ 
DefaultWindowBehaviour::ManageWindowState::MouseDown(BMessage* message,
                if ((fWindow->Flags() & B_NOT_RESIZABLE) == 0) {
                        fBehavior._NextState(new (std::nothrow) 
ResizeBorderState(
                                fBehavior, where, fHorizontal, fVertical));
-               } else
-                       fBehavior._SetNowAllowedCursor();
+               } else if ((fWindow->Flags() & kAcceptKeyboardFocusFlag) != 0)
+                       fBehavior._ResetCursor();
+               else
+                       fBehavior._SetNotAllowedCursor();
        }
 
        return true;
@@ -745,11 +749,13 @@ 
DefaultWindowBehaviour::ManageWindowState::MouseMoved(BMessage* message,
        // Update the mouse cursor
        if ((fDesktop->WindowAt(where)->Flags() & B_NOT_RESIZABLE) != 0
                && (message->FindInt32("buttons") & B_SECONDARY_MOUSE_BUTTON) 
!= 0) {
-               fBehavior._SetNowAllowedCursor();
+               fBehavior._SetNotAllowedCursor();
        } else if ((fDesktop->WindowAt(where)->Flags() & B_NOT_MOVABLE) == 0)
                fBehavior._SetMoveCursor();
+       else if ((fWindow->Flags() & kAcceptKeyboardFocusFlag) != 0)
+               fBehavior._ResetCursor();
        else
-               fBehavior._SetNowAllowedCursor();
+               fBehavior._SetNotAllowedCursor();
 
        // If the cursor is still over our window, update the borders.
        // Otherwise leave the state.
@@ -1182,7 +1188,7 @@ DefaultWindowBehaviour::_SetMoveCursor()
 
 
 void
-DefaultWindowBehaviour::_SetNowAllowedCursor()
+DefaultWindowBehaviour::_SetNotAllowedCursor()
 {
        fDesktop->SetManagementCursor(
                
fDesktop->GetCursorManager().GetCursor(B_CURSOR_ID_NOT_ALLOWED));
diff --git a/src/servers/app/decorator/DefaultWindowBehaviour.h 
b/src/servers/app/decorator/DefaultWindowBehaviour.h
index 7021a0b..593cc41 100644
--- a/src/servers/app/decorator/DefaultWindowBehaviour.h
+++ b/src/servers/app/decorator/DefaultWindowBehaviour.h
@@ -96,7 +96,7 @@ private:
                                                                        int8 
vertical);
 
                        void                            _SetMoveCursor();
-                       void                            _SetNowAllowedCursor();
+                       void                            _SetNotAllowedCursor();
                        void                            _SetResizeCursor(int8 
horizontal,
                                                                        int8 
vertical);
                        void                            
_SetBorderResizeCursor(BPoint where);


Other related posts:

  • » [haiku-commits] haiku: hrev45200 - src/servers/app/decorator - jscipione