Only set FLOATING_AUTO_ON when floating_enable succeeds

Fixes #4039

Crash with docking clients where the floating field is set even though
floating_enable refuses to make them floating.

See issue for example with logs.
This commit is contained in:
Orestis Floros
2020-04-27 13:10:15 +02:00
parent 4d55bba7f8
commit 5e2f13a28c
5 changed files with 85 additions and 12 deletions

View File

@ -841,12 +841,13 @@ static void handle_client_message(xcb_client_message_event_t *event) {
* let's float it and make it sticky. */
DLOG("The window was requested to be visible on all workspaces, making it sticky and floating.\n");
floating_enable(con, false);
con->floating = FLOATING_AUTO_ON;
if (floating_enable(con, false)) {
con->floating = FLOATING_AUTO_ON;
con->sticky = true;
ewmh_update_sticky(con->window->id, true);
output_push_sticky_windows(focused);
con->sticky = true;
ewmh_update_sticky(con->window->id, true);
output_push_sticky_windows(focused);
}
} else {
Con *ws = ewmh_get_workspace_by_index(index);
if (ws == NULL) {