summaryrefslogtreecommitdiffstats
path: root/sway/commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sway/commands.c b/sway/commands.c
index babefd02..a3f74747 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -81,7 +81,7 @@ static int bindsym_sort(const void *_lbind, const void *_rbind) {
81 const struct sway_binding *rbind = *(void **)_rbind; 81 const struct sway_binding *rbind = *(void **)_rbind;
82 unsigned int lmod = 0, rmod = 0, i; 82 unsigned int lmod = 0, rmod = 0, i;
83 83
84 //Count how any modifiers are pressed 84 // Count how any modifiers are pressed
85 for (i = 0; i < 8 * sizeof(lbind->modifiers); ++i) { 85 for (i = 0; i < 8 * sizeof(lbind->modifiers); ++i) {
86 lmod += lbind->modifiers & 1 << i; 86 lmod += lbind->modifiers & 1 << i;
87 rmod += rbind->modifiers & 1 << i; 87 rmod += rbind->modifiers & 1 << i;
@@ -203,10 +203,10 @@ static bool cmd_floating(struct sway_config *config, int argc, char **argv) {
203 } 203 }
204 // Change from nonfloating to floating 204 // Change from nonfloating to floating
205 if (!view->is_floating) { 205 if (!view->is_floating) {
206 //Remove view from its current location 206 // Remove view from its current location
207 destroy_container(remove_child(view)); 207 destroy_container(remove_child(view));
208 208
209 //and move it into workspace floating 209 // and move it into workspace floating
210 add_floating(active_workspace,view); 210 add_floating(active_workspace,view);
211 view->x = (active_workspace->width - view->width)/2; 211 view->x = (active_workspace->width - view->width)/2;
212 view->y = (active_workspace->height - view->height)/2; 212 view->y = (active_workspace->height - view->height)/2;
@@ -233,11 +233,11 @@ static bool cmd_floating(struct sway_config *config, int argc, char **argv) {
233 233
234 sway_log(L_DEBUG, "Non-floating focused container is %p", focused); 234 sway_log(L_DEBUG, "Non-floating focused container is %p", focused);
235 235
236 //Case of focused workspace, just create as child of it 236 // Case of focused workspace, just create as child of it
237 if (focused->type == C_WORKSPACE) { 237 if (focused->type == C_WORKSPACE) {
238 add_child(focused, view); 238 add_child(focused, view);
239 } 239 }
240 //Regular case, create as sibling of current container 240 // Regular case, create as sibling of current container
241 else { 241 else {
242 add_sibling(focused, view); 242 add_sibling(focused, view);
243 } 243 }
@@ -258,7 +258,7 @@ static bool cmd_floating_mod(struct sway_config *config, int argc, char **argv)
258 list_t *split = split_string(argv[0], "+"); 258 list_t *split = split_string(argv[0], "+");
259 config->floating_mod = 0; 259 config->floating_mod = 0;
260 260
261 //set modifer keys 261 // set modifer keys
262 for (i = 0; i < split->length; ++i) { 262 for (i = 0; i < split->length; ++i) {
263 for (j = 0; j < sizeof(modifiers) / sizeof(struct modifier_key); ++j) { 263 for (j = 0; j < sizeof(modifiers) / sizeof(struct modifier_key); ++j) {
264 if (strcasecmp(modifiers[j].name, split->items[i]) == 0) { 264 if (strcasecmp(modifiers[j].name, split->items[i]) == 0) {
@@ -508,14 +508,14 @@ static bool cmd_fullscreen(struct sway_config *config, int argc, char **argv) {
508 swayc_t *container = get_focused_view(&root_container); 508 swayc_t *container = get_focused_view(&root_container);
509 bool current = (wlc_view_get_state(container->handle) & WLC_BIT_FULLSCREEN) > 0; 509 bool current = (wlc_view_get_state(container->handle) & WLC_BIT_FULLSCREEN) > 0;
510 wlc_view_set_state(container->handle, WLC_BIT_FULLSCREEN, !current); 510 wlc_view_set_state(container->handle, WLC_BIT_FULLSCREEN, !current);
511 //Resize workspace if going from fullscreen -> notfullscreen 511 // Resize workspace if going from fullscreen -> notfullscreen
512 //otherwise just resize container 512 // otherwise just resize container
513 if (current) { 513 if (current) {
514 while (container->type != C_WORKSPACE) { 514 while (container->type != C_WORKSPACE) {
515 container = container->parent; 515 container = container->parent;
516 } 516 }
517 } 517 }
518 //Only resize container when going into fullscreen 518 // Only resize container when going into fullscreen
519 arrange_windows(container, -1, -1); 519 arrange_windows(container, -1, -1);
520 520
521 return true; 521 return true;
@@ -679,7 +679,7 @@ bool handle_command(struct sway_config *config, char *exec) {
679 char **argv = split_directive(exec + strlen(handler->command), &argc); 679 char **argv = split_directive(exec + strlen(handler->command), &argc);
680 int i; 680 int i;
681 681
682 //Perform var subs on all parts of the command 682 // Perform var subs on all parts of the command
683 for (i = 0; i < argc; ++i) { 683 for (i = 0; i < argc; ++i) {
684 argv[i] = do_var_replacement(config, argv[i]); 684 argv[i] = do_var_replacement(config, argv[i]);
685 } 685 }