Don't disable floating in internal workspaces

This commit is contained in:
Orestis Floros 2018-08-28 10:26:07 +03:00
parent 08a53611f9
commit 9718e38a7a
No known key found for this signature in database
GPG Key ID: E9AD9F32E401E38F
2 changed files with 20 additions and 0 deletions

View File

@ -366,6 +366,10 @@ void floating_disable(Con *con, bool automatic) {
} }
Con *ws = con_get_workspace(con); Con *ws = con_get_workspace(con);
if (con_is_internal(ws)) {
LOG("Can't disable floating for container in internal workspace.\n");
return;
}
Con *tiling_focused = con_descend_tiling_focused(ws); Con *tiling_focused = con_descend_tiling_focused(ws);
if (tiling_focused->type == CT_WORKSPACE) { if (tiling_focused->type == CT_WORKSPACE) {

View File

@ -517,4 +517,20 @@ fresh_workspace;
$result = cmd 'scratchpad show'; $result = cmd 'scratchpad show';
is($result->[0]->{success}, 1, 'call to scratchpad in another workspace succeeded'); is($result->[0]->{success}, 1, 'call to scratchpad in another workspace succeeded');
################################################################################
# 18: Disabling floating for a scratchpad window should not work.
################################################################################
kill_all_windows;
$ws = fresh_workspace;
$window = open_window;
cmd 'move scratchpad';
cmd '[id=' . $window->id . '] floating disable';
is(scalar @{get_ws_content($ws)}, 0, 'no window in workspace');
cmd 'scratchpad show';
is($x->input_focus, $window->id, 'scratchpad window shown');
done_testing; done_testing;