show empty workspaces

This commit is contained in:
Akos Horvath 2022-09-08 13:37:13 +02:00
parent ebcd1d43ea
commit 8220ff251c
3 changed files with 25 additions and 2 deletions

View File

@ -186,3 +186,9 @@ Con *workspace_encapsulate(Con *ws);
*
*/
void workspace_move_to_output(Con *ws, Output *output);
/*
* Create all workspaces specified in the config bindings.
*
*/
void workspace_init(void);

View File

@ -1197,5 +1197,6 @@ int main(int argc, char *argv[]) {
atexit(i3_exit);
sd_notify(1, "READY=1");
workspace_init();
ev_loop(main_loop, 0);
}

View File

@ -506,8 +506,8 @@ void workspace_show(Con *workspace) {
* client, which will clear the urgency flag too early. Also, there is no
* way for con_focus() to know about when to clear urgency immediately and
* when to defer it. */
/*
if (old && TAILQ_EMPTY(&(old->nodes_head)) && TAILQ_EMPTY(&(old->floating_head))) {
/* check if this workspace is currently visible */
if (!workspace_is_visible(old)) {
LOG("Closing old workspace (%p / %s), it is empty\n", old, old->name);
yajl_gen gen = ipc_marshal_workspace_event("empty", old, NULL);
@ -520,7 +520,6 @@ void workspace_show(Con *workspace) {
y(free);
/* Avoid calling output_push_sticky_windows later with a freed container. */
if (old == old_focus) {
old_focus = NULL;
}
@ -528,6 +527,7 @@ void workspace_show(Con *workspace) {
ewmh_update_desktop_properties();
}
}
*/
workspace->fullscreen_mode = CF_OUTPUT;
LOG("focused now = %p / %s\n", focused, focused->name);
@ -1065,3 +1065,19 @@ void workspace_move_to_output(Con *ws, Output *output) {
break;
}
}
void workspace_init(void)
{
int i = 0;
char *c = binding_workspace_names[0];
while (c != NULL) {
DLOG("bwn: %s\n", c);
workspace_get(c);
i++;
c = binding_workspace_names[i];
}
//workspace_show_by_name(binding_workspace_names[0]);
}