]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix zoom rect computation for some deskbar positions on Haiku
authorPo Lu <luangruo@yahoo.com>
Wed, 13 Apr 2022 04:44:11 +0000 (04:44 +0000)
committerPo Lu <luangruo@yahoo.com>
Wed, 13 Apr 2022 04:44:11 +0000 (04:44 +0000)
* src/haiku_support.cc (CalculateZoomRect): Fix computation for
left top and right bottom.

src/haiku_support.cc

index 826e1c21005d7495bf9b5522710d707196b4e727..599ff305ae3e16db35c5b4e0570123d6c8df02d5 100644 (file)
@@ -477,8 +477,7 @@ public:
     screen_frame = frame = screen.Frame ();
     deskbar_frame = deskbar.Frame ();
 
-    if (!(modifiers () & B_SHIFT_KEY)
-       && !deskbar.IsAutoHide ())
+    if (!(modifiers () & B_SHIFT_KEY) && !deskbar.IsAutoHide ())
       {
        switch (deskbar.Location ())
          {
@@ -489,13 +488,14 @@ public:
          case B_DESKBAR_BOTTOM:
          case B_DESKBAR_LEFT_BOTTOM:
          case B_DESKBAR_RIGHT_BOTTOM:
-           frame.bottom = deskbar_frame.bottom - 2;
+           frame.bottom = deskbar_frame.top - 2;
            break;
 
          case B_DESKBAR_LEFT_TOP:
-           if (deskbar.IsExpanded ())
+           if (!deskbar.IsExpanded ())
              frame.top = deskbar_frame.bottom + 2;
-           else
+           else if (!deskbar.IsAlwaysOnTop ()
+                    && !deskbar.IsAutoRaise ())
              frame.left = deskbar_frame.right + 2;
            break;
 
@@ -525,7 +525,7 @@ public:
        frame.left = screen_frame.left + (window_frame.left
                                          - decorator_frame.left);
        frame.right = screen_frame.right - (decorator_frame.right
-                                           - window_frame.left);
+                                           - window_frame.right);
       }
 
     return frame;