From 56d29bbec5acf76275722ec501249bf165106815 Mon Sep 17 00:00:00 2001 From: jdiez17 Date: Mon, 10 Aug 2015 02:23:56 +0200 Subject: [PATCH] log: add newline --- sway/commands.c | 14 ++++++++++++++ sway/layout.c | 4 ++++ sway/log.c | 3 ++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/sway/commands.c b/sway/commands.c index 725eaf15d..b77940874 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -217,6 +217,19 @@ int cmd_log_colors(struct sway_config *config, int argc, char **argv) { return 0; } +int cmd_fullscreen(struct sway_config *config, int argc, char **argv) { + if (argc != 1) { + sway_log(L_ERROR, "Invalid fullscreen command (expected 1 arguments, got %d)", argc); + return 1; + } + + swayc_t *container = get_focused_container(&root_container); + wlc_view_set_state(container->handle, WLC_BIT_FULLSCREEN, true); + arrange_windows(container, -1, -1); + + return 1; +} + /* Keep alphabetized */ struct cmd_handler handlers[] = { { "bindsym", cmd_bindsym }, @@ -224,6 +237,7 @@ struct cmd_handler handlers[] = { { "exit", cmd_exit }, { "focus", cmd_focus }, { "focus_follows_mouse", cmd_focus_follows_mouse }, + { "fullscreen", cmd_fullscreen }, { "layout", cmd_layout }, { "log_colors", cmd_log_colors }, { "set", cmd_set }, diff --git a/sway/layout.c b/sway/layout.c index b320e8ad0..7dbe686ac 100644 --- a/sway/layout.c +++ b/sway/layout.c @@ -42,6 +42,10 @@ void arrange_windows(swayc_t *container, int width, int height) { return; case C_VIEW: sway_log(L_DEBUG, "Setting view to %d x %d @ %d, %d", width, height, container->x, container->y); + // If the view is fullscreen, we need to tell wlc to draw it as such + if (wlc_view_get_state(container->handle) & WLC_BIT_FULLSCREEN > 0) { + sway_log(L_DEBUG, "window is fullscreen!"); + } struct wlc_geometry geometry = { .origin = { .x = container->x, diff --git a/sway/log.c b/sway/log.c index 7a88b6d13..f439e3b28 100644 --- a/sway/log.c +++ b/sway/log.c @@ -48,7 +48,8 @@ void sway_log(int verbosity, char* format, ...) { va_end(args); if (colored) { - fprintf(stderr, "\x1B[0m\n"); + fprintf(stderr, "\x1B[0m"); } + fprintf(stderr, "\n"); } }