summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Luminarys <kizunanohikari@gmail.com>2015-08-23 12:22:45 -0500
committerLibravatar Luminarys <kizunanohikari@gmail.com>2015-08-23 12:23:01 -0500
commite01cf0b56654ff459a98a90e5e35615ad8d9203e (patch)
tree7f3aff68c417f0b733621086860fd39f0b78211d
parentAdded in glitchy disabling (diff)
downloadsway-e01cf0b56654ff459a98a90e5e35615ad8d9203e.tar.gz
sway-e01cf0b56654ff459a98a90e5e35615ad8d9203e.tar.zst
sway-e01cf0b56654ff459a98a90e5e35615ad8d9203e.zip
Added in glitchy disabling
-rw-r--r--sway/commands.c10
-rw-r--r--sway/container.c6
-rw-r--r--sway/handlers.c20
3 files changed, 18 insertions, 18 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 9a0bc076..ae75ec67 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -372,13 +372,13 @@ static bool cmd_output(struct sway_config *config, int argc, char **argv) {
372 struct output_config *output = calloc(1, sizeof(struct output_config)); 372 struct output_config *output = calloc(1, sizeof(struct output_config));
373 output->x = output->y = output->width = output->height = -1; 373 output->x = output->y = output->width = output->height = -1;
374 output->name = strdup(argv[0]); 374 output->name = strdup(argv[0]);
375 output->enabled = true; 375 output->enabled = true;
376 376
377 // TODO: atoi doesn't handle invalid numbers 377 // TODO: atoi doesn't handle invalid numbers
378 378
379 if (strcmp(argv[1], "disable") == 0) { 379 if (strcmp(argv[1], "disable") == 0) {
380 output->enabled = false; 380 output->enabled = false;
381 } 381 }
382 382
383 int i; 383 int i;
384 for (i = 1; i < argc; ++i) { 384 for (i = 1; i < argc; ++i) {
diff --git a/sway/container.c b/sway/container.c
index 6debeea3..d4f7c693 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -70,9 +70,9 @@ swayc_t *new_output(wlc_handle handle) {
70 oc = NULL; 70 oc = NULL;
71 } 71 }
72 72
73 if (oc && !oc->enabled) { 73 if (oc && !oc->enabled) {
74 return NULL; 74 return NULL;
75 } 75 }
76 76
77 swayc_t *output = new_swayc(C_OUTPUT); 77 swayc_t *output = new_swayc(C_OUTPUT);
78 if (oc && oc->width != -1 && oc->height != -1) { 78 if (oc && oc->width != -1 && oc->height != -1) {
diff --git a/sway/handlers.c b/sway/handlers.c
index 9fca6387..1ff430f2 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -86,22 +86,22 @@ swayc_t *container_under_pointer(void) {
86static bool handle_output_created(wlc_handle output) { 86static bool handle_output_created(wlc_handle output) {
87 swayc_t *op = new_output(output); 87 swayc_t *op = new_output(output);
88 88
89 if (!op) { 89 if (!op) {
90 return false; 90 return false;
91 } 91 }
92 92
93 wlc_output_focus(output); 93 wlc_output_focus(output);
94 // Switch to workspace if we need to 94 // Switch to workspace if we need to
95 if (swayc_active_workspace() == NULL) { 95 if (swayc_active_workspace() == NULL) {
96 sway_log(L_INFO, "Focus switch"); 96 sway_log(L_INFO, "Focus switch");
97 swayc_t *ws = op->children->items[0]; 97 swayc_t *ws = op->children->items[0];
98 workspace_switch(ws); 98 workspace_switch(ws);
99 } 99 }
100 /* 100 /*
101 if (wlc_output_get_sleep(wlc_get_focused_output())) { 101 if (wlc_output_get_sleep(wlc_get_focused_output())) {
102 wlc_output_focus(output); 102 wlc_output_focus(output);
103 } 103 }
104 */ 104 */
105 return true; 105 return true;
106} 106}
107 107