[haiku-commits] haiku: hrev44771 - src/servers/app/stackandtile

  • From: clemens.zeidler@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 5 Nov 2012 22:29:08 +0100 (CET)

hrev44771 adds 1 changeset to branch 'master'
old head: 35ef01c5663c170ea9f5a9fcaaa1b6d6b9edb84d
new head: 24ad8261a9e60661a01331a1d350c47567c6f018

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

24ad826: Integrate patch from jessicah #8937. Thanks!
  
  - navigate in a single S&T group using (win + left and right arrows)
  - minor fixed to the patch
  - enable switching between S&T groups on the same desktop again (win + up and 
down arrows)
  
  Hope window key + arrow keys does not collide with to many apps?

                                     [ czeidler <haiku@xxxxxxxxxxxxxxxxxx> ]

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

Revision:    hrev44771
Commit:      24ad8261a9e60661a01331a1d350c47567c6f018
URL:         http://cgit.haiku-os.org/haiku/commit/?id=24ad826
Author:      czeidler <haiku@xxxxxxxxxxxxxxxxxx>
Date:        Mon Nov  5 21:24:42 2012 UTC

Ticket:      https://dev.haiku-os.org/ticket/8937

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

1 file changed, 30 insertions(+), 4 deletions(-)
src/servers/app/stackandtile/StackAndTile.cpp | 34 ++++++++++++++++++++---

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

diff --git a/src/servers/app/stackandtile/StackAndTile.cpp 
b/src/servers/app/stackandtile/StackAndTile.cpp
index 2fb5454..8568f71 100644
--- a/src/servers/app/stackandtile/StackAndTile.cpp
+++ b/src/servers/app/stackandtile/StackAndTile.cpp
@@ -129,16 +129,42 @@ StackAndTile::KeyPressed(uint32 what, int32 key, int32 
modifiers)
                if (!wasPressed && fSATKeyPressed)
                        _StartSAT();
        }
-// switch off group navigation because it clashes with tracker...
-return false;
-       if (!SATKeyPressed() || (modifiers & B_COMMAND_KEY) == 0
-               || what != B_KEY_DOWN)
+
+       if (!SATKeyPressed() || what != B_KEY_DOWN)
                return false;
 
        const int kArrowKeyUp = 87;
        const int kArrowKeyDown = 98;
+       const int kArrowKeyLeft = 97;
+       const int kArrowKeyRight = 99;
 
        switch (key) {
+               case kArrowKeyLeft:
+               case kArrowKeyRight:
+               {
+                       SATWindow* frontWindow = 
GetSATWindow(fDesktop->FocusWindow());
+                       SATGroup* currentGroup = NULL;
+                       if (frontWindow)
+                               currentGroup = frontWindow->GetGroup();
+                       int32 groupSize = currentGroup->CountItems();
+                       if (!currentGroup || groupSize <= 1)
+                               return false;
+
+                       for (int32 i = 0; i < groupSize; i++) {
+                               SATWindow* targetWindow = 
currentGroup->WindowAt(i);
+                               if (targetWindow == frontWindow) {
+                                       if (key == kArrowKeyLeft && i > 0) {
+                                               targetWindow = 
currentGroup->WindowAt(i - 1);
+                                       } else if (key == kArrowKeyRight && i < 
groupSize - 1) {
+                                               targetWindow = 
currentGroup->WindowAt(i + 1);
+                                       }
+                                       _ActivateWindow(targetWindow);
+                                       return true;
+                               }
+                       }
+                       break;
+               }
+
                case kArrowKeyDown:
                {
                        SATWindow* frontWindow = 
GetSATWindow(fDesktop->FocusWindow());


Other related posts:

  • » [haiku-commits] haiku: hrev44771 - src/servers/app/stackandtile - clemens . zeidler