forked from external/yambar
i3: Handle FALLBACK output for workspaces.
sway moves the workspace to fallback_output when there is no output. For example: when all the screens are off. This commit adds an ignore for the fallback output.
This commit is contained in:
parent
b3313cefc6
commit
a467f56677
1 changed files with 14 additions and 9 deletions
23
modules/i3.c
23
modules/i3.c
|
@ -514,7 +514,6 @@ handle_workspace_event(int sock, int type, const struct json_object *json, void
|
||||||
|
|
||||||
else if (is_move) {
|
else if (is_move) {
|
||||||
struct workspace *w = workspace_lookup(m, current_id);
|
struct workspace *w = workspace_lookup(m, current_id);
|
||||||
assert(w != NULL);
|
|
||||||
|
|
||||||
struct json_object *_current_output;
|
struct json_object *_current_output;
|
||||||
if (!json_object_object_get_ex(current, "output", &_current_output)) {
|
if (!json_object_object_get_ex(current, "output", &_current_output)) {
|
||||||
|
@ -522,16 +521,22 @@ handle_workspace_event(int sock, int type, const struct json_object *json, void
|
||||||
mtx_unlock(&mod->lock);
|
mtx_unlock(&mod->lock);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
const char *current_output_string = json_object_get_string(_current_output);
|
||||||
|
|
||||||
free(w->output);
|
/* Ignore fallback_output ("For when there's no connected outputs") */
|
||||||
w->output = strdup(json_object_get_string(_current_output));
|
if (strcmp(current_output_string, "FALLBACK") != 0) {
|
||||||
|
|
||||||
/*
|
assert(w != NULL);
|
||||||
* If the moved workspace was focused, schedule a full update because
|
free(w->output);
|
||||||
* visibility for other workspaces may have changed.
|
w->output = strdup(current_output_string);
|
||||||
*/
|
|
||||||
if (w->focused) {
|
/*
|
||||||
i3_send_pkg(sock, I3_IPC_MESSAGE_TYPE_GET_WORKSPACES, NULL);
|
* If the moved workspace was focused, schedule a full update because
|
||||||
|
* visibility for other workspaces may have changed.
|
||||||
|
*/
|
||||||
|
if (w->focused) {
|
||||||
|
i3_send_pkg(sock, I3_IPC_MESSAGE_TYPE_GET_WORKSPACES, NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue