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



commit ec475fd7dc76d3f490b02c0c2c7a4b0d30652d46
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 c5877b377..3e1dff336 100644
--- a/gnome-panel/panel-toplevel.c
+++ b/gnome-panel/panel-toplevel.c
@@ -1437,7 +1437,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;
@@ -1482,16 +1481,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;
                }
 
@@ -1501,10 +1496,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;
                }
 
@@ -1514,11 +1507,6 @@ 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);
 
@@ -1526,7 +1514,7 @@ panel_toplevel_update_struts (PanelToplevel *toplevel, gboolean end_of_animation
                geometry_changed = panel_struts_register_strut (toplevel,
                                                                screen,
                                                                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]