From: Orestis Floros Date: Tue, 28 Aug 2018 07:26:07 +0000 (+0300) Subject: Don't disable floating in internal workspaces X-Git-Tag: 4.16~50^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9718e38a7af4afc65da26e9a6762074a0fba404a;p=i3%2Fi3 Don't disable floating in internal workspaces --- diff --git a/src/floating.c b/src/floating.c index 08041334..3c5afb25 100644 --- a/src/floating.c +++ b/src/floating.c @@ -366,6 +366,10 @@ void floating_disable(Con *con, bool automatic) { } 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); if (tiling_focused->type == CT_WORKSPACE) { diff --git a/testcases/t/185-scratchpad.t b/testcases/t/185-scratchpad.t index efb5d002..fd3827f7 100644 --- a/testcases/t/185-scratchpad.t +++ b/testcases/t/185-scratchpad.t @@ -517,4 +517,20 @@ fresh_workspace; $result = cmd 'scratchpad show'; 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;