From 19cbd3cbeca8f043830a80a35fdcb28c971d4da5 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 25 Nov 2012 20:55:49 +0100 Subject: [PATCH] code style fixes for the previous commit MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit • our function names use underscores • rewrote the function’s comment • function comments must be in the source _and_ in the header • no blank lines after function signatures --- include/floating.h | 8 ++++---- src/commands.c | 3 +-- src/floating.c | 11 ++++++++--- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/include/floating.h b/include/floating.h index e07897a0..c8586527 100644 --- a/include/floating.h +++ b/include/floating.h @@ -100,12 +100,12 @@ void floating_drag_window(Con *con, const xcb_button_press_event_t *event); void floating_resize_window(Con *con, const bool proportional, const xcb_button_press_event_t *event); /** - * Called when the windows is created or resized - * This function resize the windows if is size if higher or lower to the - * limits. + * Called when a floating window is created or resized. + * This function resizes the window if its size is higher or lower than the + * configured maximum/minimum size, respectively. * */ -void floating_checkSize(Con *floating_con); +void floating_check_size(Con *floating_con); #if 0 /** diff --git a/src/commands.c b/src/commands.c index 0bfc4689..0f36cd38 100644 --- a/src/commands.c +++ b/src/commands.c @@ -575,7 +575,6 @@ void cmd_move_con_to_workspace_number(I3_CMD, char *which) { } static void cmd_resize_floating(I3_CMD, char *way, char *direction, Con *floating_con, int px) { - LOG("floating resize\n"); if (strcmp(direction, "up") == 0) { floating_con->rect.y -= px; @@ -589,7 +588,7 @@ static void cmd_resize_floating(I3_CMD, char *way, char *direction, Con *floatin floating_con->rect.width += px; } - floating_checkSize(floating_con); + floating_check_size(floating_con); } static bool cmd_resize_tiling_direction(I3_CMD, Con *current, char *way, char *direction, int ppt) { diff --git a/src/floating.c b/src/floating.c index b72e7fc0..761d207d 100644 --- a/src/floating.c +++ b/src/floating.c @@ -28,8 +28,13 @@ static Rect total_outputs_dimensions(void) { return outputs_dimensions; } -void floating_checkSize(Con *floating_con) { - +/** + * Called when a floating window is created or resized. + * This function resizes the window if its size is higher or lower than the + * configured maximum/minimum size, respectively. + * + */ +void floating_check_size(Con *floating_con) { /* Define reasonable minimal and maximal sizes for floating windows */ const int floating_sane_min_height = 50; const int floating_sane_min_width = 75; @@ -178,7 +183,7 @@ void floating_enable(Con *con, bool automatic) { } } - floating_checkSize(nc); + floating_check_size(nc); /* 3: attach the child to the new parent container. We need to do this * because con_border_style_rect() needs to access con->parent. */ -- 2.39.2