summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberts Muktupāvels <alberts.muktupavels@gmail.com>2021-03-15 00:06:59 +0200
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2021-03-15 00:06:59 +0200
commitadfedd1d6513ec7fe44c5cf773b6ca89932935ac (patch)
treea3e1919fb40506c3f33e87a4267532dd0d508a94
parentf22bcf416fab8769126b12a83e9852b2ff3e3497 (diff)
downloadmetacity-adfedd1d6513ec7fe44c5cf773b6ca89932935ac.tar.gz
window: fix logically dead code defect
We assert that at least one of the two directions are set! Coverity CID: #1418266
-rw-r--r--src/core/window.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/core/window.c b/src/core/window.c
index e089f1e8..948687d7 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;