[metacity/wip/muktupavels/issue-33: 4/6] window-props: do not change size_hints.flags




commit fcc7a358dbfc86bff383e9596a6eb5580b5b964f
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun Oct 2 23:42:57 2022 +0300

    window-props: do not change size_hints.flags
    
    We are not really using these flags anywere else besides checking
    for differences when size hints changes. Stop setting flags if they
    was not set to ensure flags always represents what window actually
    did set.
    
    There was at least one problem if PBaseSize and PMinSize flags was
    not set. We first initialized base size zero and set PBaseSize flag.
    Then intializing minimum size we used base size because flag is set
    and later we are complaining that window sets minimum size to 0.

 src/core/window-props.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
---
diff --git a/src/core/window-props.c b/src/core/window-props.c
index 2a8cb51c..bf0ea066 100644
--- a/src/core/window-props.c
+++ b/src/core/window-props.c
@@ -1197,7 +1197,6 @@ meta_set_normal_hints (MetaWindow *window,
       window->size_hints.base_width = 0;
       window->size_hints.base_height = 0;
     }
-  window->size_hints.flags |= PBaseSize;
 
   /* Get min size hints */
   if (window->size_hints.flags & PMinSize)
@@ -1217,7 +1216,6 @@ meta_set_normal_hints (MetaWindow *window,
       window->size_hints.min_width = 1;
       window->size_hints.min_height = 1;
     }
-  window->size_hints.flags |= PMinSize;
 
   /* Get max size hints */
   if (window->size_hints.flags & PMaxSize)
@@ -1231,7 +1229,6 @@ meta_set_normal_hints (MetaWindow *window,
     {
       window->size_hints.max_width = G_MAXINT;
       window->size_hints.max_height = G_MAXINT;
-      window->size_hints.flags |= PMaxSize;
     }
 
   /* Get resize increment hints */
@@ -1247,7 +1244,6 @@ meta_set_normal_hints (MetaWindow *window,
     {
       window->size_hints.width_inc = 1;
       window->size_hints.height_inc = 1;
-      window->size_hints.flags |= PResizeInc;
     }
 
   /* Get aspect ratio hints */
@@ -1267,7 +1263,6 @@ meta_set_normal_hints (MetaWindow *window,
       window->size_hints.min_aspect.y = G_MAXINT;
       window->size_hints.max_aspect.x = G_MAXINT;
       window->size_hints.max_aspect.y = 1;
-      window->size_hints.flags |= PAspect;
     }
 
   /* Get gravity hint */
@@ -1283,7 +1278,6 @@ meta_set_normal_hints (MetaWindow *window,
                   "Window %s doesn't set gravity, using NW\n",
                   window->desc);
       window->size_hints.win_gravity = NorthWestGravity;
-      window->size_hints.flags |= PWinGravity;
     }
 
   /*** Lots of sanity checking ***/
@@ -1494,7 +1488,8 @@ reload_normal_hints (MetaWindow    *window,
 
       meta_set_normal_hints (window, value->v.size_hints);
 
-      spew_size_hints_differences (&old_hints, &window->size_hints);
+      if (!initial)
+        spew_size_hints_differences (&old_hints, &window->size_hints);
 
       meta_window_recalc_features (window);
 


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