Added in glitchy disabling

This commit is contained in:
Luminarys 2015-08-23 12:22:45 -05:00
parent 98fad060e2
commit e01cf0b566
3 changed files with 18 additions and 18 deletions

View File

@ -372,13 +372,13 @@ static bool cmd_output(struct sway_config *config, int argc, char **argv) {
struct output_config *output = calloc(1, sizeof(struct output_config));
output->x = output->y = output->width = output->height = -1;
output->name = strdup(argv[0]);
output->enabled = true;
output->enabled = true;
// TODO: atoi doesn't handle invalid numbers
if (strcmp(argv[1], "disable") == 0) {
output->enabled = false;
}
if (strcmp(argv[1], "disable") == 0) {
output->enabled = false;
}
int i;
for (i = 1; i < argc; ++i) {

View File

@ -70,9 +70,9 @@ swayc_t *new_output(wlc_handle handle) {
oc = NULL;
}
if (oc && !oc->enabled) {
return NULL;
}
if (oc && !oc->enabled) {
return NULL;
}
swayc_t *output = new_swayc(C_OUTPUT);
if (oc && oc->width != -1 && oc->height != -1) {

View File

@ -86,22 +86,22 @@ swayc_t *container_under_pointer(void) {
static bool handle_output_created(wlc_handle output) {
swayc_t *op = new_output(output);
if (!op) {
return false;
}
if (!op) {
return false;
}
wlc_output_focus(output);
wlc_output_focus(output);
// Switch to workspace if we need to
if (swayc_active_workspace() == NULL) {
sway_log(L_INFO, "Focus switch");
sway_log(L_INFO, "Focus switch");
swayc_t *ws = op->children->items[0];
workspace_switch(ws);
}
/*
if (wlc_output_get_sleep(wlc_get_focused_output())) {
wlc_output_focus(output);
}
*/
/*
if (wlc_output_get_sleep(wlc_get_focused_output())) {
wlc_output_focus(output);
}
*/
return true;
}