From 2bda8bc2933dc3be318fbb7d1e290cd6ff4b1262 Mon Sep 17 00:00:00 2001 From: Mathieu OTHACEHE Date: Wed, 28 Dec 2016 14:41:25 +0100 Subject: screen: rewrite screen_del conditions Rewrite screen_del conditional imbrications for a better readability. No functional changes here. --- src/screen.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'src') 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 { -- cgit v1.2.3