summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérémie Courrèges-Anglas <jca@wxcvbn.org>2014-12-31 10:14:21 +0100
committerJérémie Courrèges-Anglas <jca@wxcvbn.org>2014-12-31 10:27:59 +0100
commit0eed7e7bcac0ebeb29b1850ae36ee5c1bd098bbe (patch)
tree647092b2442ed2f2b7e4b36f2d00c7ba11d93c12
parent4f550327eb60d2f32b00d9576c1f4cc068684390 (diff)
downloadratpoison-0eed7e7bcac0ebeb29b1850ae36ee5c1bd098bbe.zip
Style fixes in set_active_window_body
* Delete useless parens * Sprinkle whitespace * No "if (cond) statement;" on a single line (items from the GNU coding standards, cf. README.developers) Additionally, * Don't mix code and decls, for consistency * Compare pointers against NULL
-rw-r--r--src/window.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/window.c b/src/window.c
index 9d784ea..d398b75 100644
--- a/src/window.c
+++ b/src/window.c
@@ -459,25 +459,28 @@ set_active_window_body (rp_window *win, int force)
{
rp_window *last_win;
rp_frame *frame = NULL, *last_frame = NULL;
+ rp_screen *screen;
- if (win == NULL) return;
+ if (win == NULL)
+ return;
PRINT_DEBUG (("intended_frame_number: %d\n", win->intended_frame_number));
/* With Xinerama, we can move a window over to the current screen; otherwise
* we have to switch to the screen that the window belongs to.
*/
- rp_screen *screen = (rp_have_xinerama ? current_screen() : win->scr);
+ screen = rp_have_xinerama ? current_screen () : win->scr;
+
/* use the intended frame if we can. */
if (win->intended_frame_number >= 0)
{
frame = screen_get_frame (screen, win->intended_frame_number);
win->intended_frame_number = -1;
- if (frame != current_frame())
- last_frame = current_frame();
+ if (frame != current_frame ())
+ last_frame = current_frame ();
}
- if (!frame)
+ if (frame == NULL)
frame = screen_get_frame (screen, screen->current_frame);
if (frame->dedicated && !force)
@@ -529,7 +532,8 @@ set_active_window_body (rp_window *win, int force)
last_win = set_frames_window (frame, win);
- if (last_win) PRINT_DEBUG (("last window: %s\n", window_name (last_win)));
+ if (last_win != NULL)
+ PRINT_DEBUG (("last window: %s\n", window_name (last_win)));
PRINT_DEBUG (("new window: %s\n", window_name (win)));
/* Make sure the window comes up full screen */
@@ -549,7 +553,7 @@ set_active_window_body (rp_window *win, int force)
XSync (dpy, False);
/* If we switched frame, go back to the old one. */
- if (last_frame)
+ if (last_frame != NULL)
set_active_frame (last_frame, 0);
/* Call the switch window hook */