ratpoison-devel
[Top][All Lists]
Advanced

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

[RP] [PATCH] screen: rewrite screen_del conditions


From: Mathieu OTHACEHE
Subject: [RP] [PATCH] screen: rewrite screen_del conditions
Date: Wed, 28 Dec 2016 14:41:25 +0100

Rewrite screen_del conditional imbrications for a better readability.
No functional changes here.
---
 src/screen.c | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/src/screen.c b/src/screen.c
index cfcf2f8..2c36a6b 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -655,18 +655,21 @@ screen_add (int rr_output)
 void
 screen_del (rp_screen *s)
 {
-  if (screen_count () == 1)
-    {
-      hide_screen_windows (s);
-      rp_current_screen = NULL;
-    }
-  else if (s == rp_current_screen)
+  if (s == rp_current_screen)
     {
-      /*
-       * The deleted screen cannot be the current screen anymore,
-       * focus the next one.
-       */
-      screen_remove_current ();
+      if (screen_count () == 1)
+        {
+          hide_screen_windows (s);
+          rp_current_screen = NULL;
+        }
+      else
+        {
+          /*
+           * The deleted screen cannot be the current screen anymore,
+           * focus the next one.
+           */
+          screen_remove_current ();
+        }
     }
   else
     {
-- 
2.11.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]