summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar jdiez17 <jose.manuel.diez@gmail.com>2015-08-10 02:23:56 +0200
committerLibravatar jdiez17 <jose.manuel.diez@gmail.com>2015-08-10 02:24:19 +0200
commit56d29bbec5acf76275722ec501249bf165106815 (patch)
tree5a38c03b8252419c637038f2f9de890d8961e73c
parentImplement focus parent (diff)
downloadsway-56d29bbec5acf76275722ec501249bf165106815.tar.gz
sway-56d29bbec5acf76275722ec501249bf165106815.tar.zst
sway-56d29bbec5acf76275722ec501249bf165106815.zip
log: add newline
-rw-r--r--sway/commands.c14
-rw-r--r--sway/layout.c4
-rw-r--r--sway/log.c3
3 files changed, 20 insertions, 1 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 725eaf15..b7794087 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) {
217 return 0; 217 return 0;
218} 218}
219 219
220int cmd_fullscreen(struct sway_config *config, int argc, char **argv) {
221 if (argc != 1) {
222 sway_log(L_ERROR, "Invalid fullscreen command (expected 1 arguments, got %d)", argc);
223 return 1;
224 }
225
226 swayc_t *container = get_focused_container(&root_container);
227 wlc_view_set_state(container->handle, WLC_BIT_FULLSCREEN, true);
228 arrange_windows(container, -1, -1);
229
230 return 1;
231}
232
220/* Keep alphabetized */ 233/* Keep alphabetized */
221struct cmd_handler handlers[] = { 234struct cmd_handler handlers[] = {
222 { "bindsym", cmd_bindsym }, 235 { "bindsym", cmd_bindsym },
@@ -224,6 +237,7 @@ struct cmd_handler handlers[] = {
224 { "exit", cmd_exit }, 237 { "exit", cmd_exit },
225 { "focus", cmd_focus }, 238 { "focus", cmd_focus },
226 { "focus_follows_mouse", cmd_focus_follows_mouse }, 239 { "focus_follows_mouse", cmd_focus_follows_mouse },
240 { "fullscreen", cmd_fullscreen },
227 { "layout", cmd_layout }, 241 { "layout", cmd_layout },
228 { "log_colors", cmd_log_colors }, 242 { "log_colors", cmd_log_colors },
229 { "set", cmd_set }, 243 { "set", cmd_set },
diff --git a/sway/layout.c b/sway/layout.c
index b320e8ad..7dbe686a 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -42,6 +42,10 @@ void arrange_windows(swayc_t *container, int width, int height) {
42 return; 42 return;
43 case C_VIEW: 43 case C_VIEW:
44 sway_log(L_DEBUG, "Setting view to %d x %d @ %d, %d", width, height, container->x, container->y); 44 sway_log(L_DEBUG, "Setting view to %d x %d @ %d, %d", width, height, container->x, container->y);
45 // If the view is fullscreen, we need to tell wlc to draw it as such
46 if (wlc_view_get_state(container->handle) & WLC_BIT_FULLSCREEN > 0) {
47 sway_log(L_DEBUG, "window is fullscreen!");
48 }
45 struct wlc_geometry geometry = { 49 struct wlc_geometry geometry = {
46 .origin = { 50 .origin = {
47 .x = container->x, 51 .x = container->x,
diff --git a/sway/log.c b/sway/log.c
index 7a88b6d1..f439e3b2 100644
--- a/sway/log.c
+++ b/sway/log.c
@@ -48,7 +48,8 @@ void sway_log(int verbosity, char* format, ...) {
48 va_end(args); 48 va_end(args);
49 49
50 if (colored) { 50 if (colored) {
51 fprintf(stderr, "\x1B[0m\n"); 51 fprintf(stderr, "\x1B[0m");
52 } 52 }
53 fprintf(stderr, "\n");
53 } 54 }
54} 55}