Skip to content

Commit

Permalink
Fix the ordering of the EWMH function calls
Browse files Browse the repository at this point in the history
First provide the new list of items, then declare the active item.

Fix baskerville#911.
  • Loading branch information
baskerville committed Jan 26, 2019
1 parent f82338f commit 19f3c5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/restore.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,13 @@ bool restore_tree(const char *file_path)
}
}

ewmh_update_client_list(false);
ewmh_update_client_list(true);
ewmh_update_active_window();
ewmh_update_number_of_desktops();
ewmh_update_current_desktop();
ewmh_update_desktop_names();
ewmh_update_desktop_viewport();
ewmh_update_current_desktop();
ewmh_update_client_list(false);
ewmh_update_client_list(true);
ewmh_update_active_window();

free(tokens);
free(json);
Expand Down
5 changes: 3 additions & 2 deletions src/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ bool manage_window(xcb_window_t win, rule_consequence_t *csq, int fd)
hide_node(d, n);
}

ewmh_update_client_list(false);
ewmh_set_wm_desktop(n, d);

if (!csq->hidden && csq->focus) {
if (d == mon->desk || csq->follow) {
focus_node(m, d, n);
Expand All @@ -212,8 +215,6 @@ bool manage_window(xcb_window_t win, rule_consequence_t *csq, int fd)
draw_border(n, false, (m == mon));
}

ewmh_set_wm_desktop(n, d);
ewmh_update_client_list(false);
free(csq->layer);
free(csq->state);

Expand Down

0 comments on commit 19f3c5b

Please sign in to comment.