[gnome-panel/wip/muktupavels/alignment: 80/81] toplevel: don't change orientation from update_struts




commit 0c5e2d2dd87002926d040c155e7291a0445e28c9
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun Feb 16 13:06:01 2020 +0200

    toplevel: don't change orientation from update_struts

 gnome-panel/panel-toplevel.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)
---
diff --git a/gnome-panel/panel-toplevel.c b/gnome-panel/panel-toplevel.c
index 8acf82e9f..b872fbd6d 100644
--- a/gnome-panel/panel-toplevel.c
+++ b/gnome-panel/panel-toplevel.c
@@ -1440,7 +1440,6 @@ panel_toplevel_get_effective_auto_hide_size (PanelToplevel *toplevel)
 static gboolean
 panel_toplevel_update_struts (PanelToplevel *toplevel, gboolean end_of_animation)
 {
-       PanelOrientation  orientation;
        GdkScreen        *screen;
        gboolean          geometry_changed = FALSE;
        int               strut, strut_start, strut_end;
@@ -1485,16 +1484,12 @@ panel_toplevel_update_struts (PanelToplevel *toplevel, gboolean end_of_animation
                height = toplevel->priv->geometry.height;
        }
 
-       orientation = toplevel->priv->orientation;
-
        strut = strut_start = strut_end = 0;
 
-       if (orientation & PANEL_HORIZONTAL_MASK) {
+       if (toplevel->priv->orientation & PANEL_HORIZONTAL_MASK) {
                if (y <= monitor_y) {
-                       orientation = PANEL_ORIENTATION_TOP;
                        strut = y + height - monitor_y;
                } else if (y >= monitor_y + monitor_height - height) {
-                       orientation = PANEL_ORIENTATION_BOTTOM;
                        strut = monitor_y + monitor_height - y;
                }
 
@@ -1504,10 +1499,8 @@ panel_toplevel_update_struts (PanelToplevel *toplevel, gboolean end_of_animation
                }
        } else {
                if (x <= monitor_x) {
-                       orientation = PANEL_ORIENTATION_LEFT;
                        strut = x + width - monitor_x;
                } else if (x >= monitor_x + monitor_width - width) {
-                       orientation = PANEL_ORIENTATION_RIGHT;
                        strut = monitor_x + monitor_width - x;
                }
 
@@ -1517,18 +1510,13 @@ panel_toplevel_update_struts (PanelToplevel *toplevel, gboolean end_of_animation
                }
        }
 
-       if (orientation != toplevel->priv->orientation) {
-               toplevel->priv->orientation = orientation;
-               g_object_notify (G_OBJECT (toplevel), "orientation");
-       }
-
        if (toplevel->priv->auto_hide && strut > 0)
                strut = panel_toplevel_get_effective_auto_hide_size (toplevel);
 
        if (strut > 0)
                geometry_changed = panel_struts_register_strut (toplevel,
                                                                toplevel->priv->monitor,
-                                                               orientation,
+                                                               toplevel->priv->orientation,
                                                                strut,
                                                                strut_start,
                                                                strut_end);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]