[Xfce4-commits] [xfce/xfce4-panel] 03/05: autohide: Improve animation support for intellihide

noreply at xfce.org noreply at xfce.org
Mon Oct 14 01:34:59 CEST 2019


This is an automated email from the git hooks/post-receive script.

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfce4-panel.

commit 5a996cb8cddb6471c3e6786113fc9882b1ba1028
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Sun Oct 13 00:21:29 2019 +0200

    autohide: Improve animation support for intellihide
---
 panel/panel-window.c | 62 ++++++++++++++++++++++------------------------------
 1 file changed, 26 insertions(+), 36 deletions(-)

diff --git a/panel/panel-window.c b/panel/panel-window.c
index c71a586..6e00045 100644
--- a/panel/panel-window.c
+++ b/panel/panel-window.c
@@ -2516,56 +2516,46 @@ panel_window_autohide_slideout (gpointer data)
 {
   PanelWindow  *window = PANEL_WINDOW (data);
   PanelBorders  borders;
-  gint          x, y, auto_x, auto_y;
+  gint          x, y, w, h;
 
   gtk_window_get_position (GTK_WINDOW (window), &x, &y);
-  gtk_window_get_position (GTK_WINDOW (window->autohide_window), &auto_x, &auto_y);
+  w = gdk_screen_get_width (window->screen);
+  h = gdk_screen_get_height (window->screen);
   borders = panel_base_window_get_borders (PANEL_BASE_WINDOW (window));
 
-  /* FIXME: maybe use something instead of the autohide window, because this may
-     cause issues with the autohide window being moved to -9999/-9999 */
-  g_warning ("autohide window: %d/%d panel window %d/%d", auto_x, auto_y, x, y);
-
   if (IS_HORIZONTAL (window))
     {
       if (PANEL_HAS_FLAG (borders, PANEL_BORDER_BOTTOM))
-        y -= 1;
-      else
-        y += 1;
-
-      gtk_window_move (GTK_WINDOW (window), x, y);
-
-      if (PANEL_HAS_FLAG (borders, PANEL_BORDER_BOTTOM)
-          && y < (auto_y - window->alloc.height))
         {
-          return FALSE;
+          y--;
+
+          if (y < (0 - window->alloc.height - 1))
+            return FALSE;
         }
-      else if (PANEL_HAS_FLAG (borders, PANEL_BORDER_TOP)
-          && y > (auto_y + window->alloc.height))
+      else if (PANEL_HAS_FLAG (borders, PANEL_BORDER_TOP))
         {
-          return FALSE;
+          y++;
+          if (y > (h + window->alloc.height + 1))
+            return FALSE;
         }
     }
   else
-  {
-    if (PANEL_HAS_FLAG (borders, PANEL_BORDER_RIGHT))
-      x -= 1;
-    else if (PANEL_HAS_FLAG (borders, PANEL_BORDER_LEFT))
-      x += 1;
-
-    gtk_window_move (GTK_WINDOW (window), x, y);
+    {
+      if (PANEL_HAS_FLAG (borders, PANEL_BORDER_RIGHT))
+        {
+          x--;
+          if (x < (0 - window->alloc.width + 1))
+            return FALSE;
+        }
+      else if (PANEL_HAS_FLAG (borders, PANEL_BORDER_LEFT))
+        {
+          x++;
+          if (x > (w + window->alloc.width + 1))
+            return FALSE;
+        }
+    }
 
-    if (PANEL_HAS_FLAG (borders, PANEL_BORDER_RIGHT)
-        && x < (auto_x - window->alloc.width))
-      {
-        return FALSE;
-      }
-    else if (PANEL_HAS_FLAG (borders, PANEL_BORDER_LEFT)
-        && x > (auto_x + window->alloc.width))
-      {
-        return FALSE;
-      }
-  }
+  gtk_window_move (GTK_WINDOW (window), x, y);
 
   return TRUE;
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list