[metacity] window: fix logically dead code defect



commit adfedd1d6513ec7fe44c5cf773b6ca89932935ac
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Mon Mar 15 00:06:59 2021 +0200

    window: fix logically dead code defect
    
    We assert that at least one of the two directions are set!
    
    Coverity CID: #1418266

 src/core/window.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index e089f1e87..948687d73 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -2852,13 +2852,19 @@ meta_window_unmaximize (MetaWindow        *window,
       (unmaximize_vertically   && window->maximized_vertically))
     {
       MetaRectangle target_rect;
+      const char *direction;
+
+      if (unmaximize_horizontally && unmaximize_vertically)
+        direction = "";
+      else if (unmaximize_horizontally)
+        direction = "horizontally";
+      else
+        direction = "vertically";
 
       meta_topic (META_DEBUG_WINDOW_OPS,
                   "Unmaximizing %s%s\n",
                   window->desc,
-                  unmaximize_horizontally && unmaximize_vertically ? "" :
-                    unmaximize_horizontally ? " horizontally" :
-                      unmaximize_vertically ? " vertically" : "BUGGGGG");
+                  direction);
 
       window->maximized_horizontally =
         window->maximized_horizontally && !unmaximize_horizontally;


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