X-Git-Url: https://git.sur5r.net/?p=i3%2Fi3;a=blobdiff_plain;f=testcases%2Ft%2F285-sticky.t;fp=testcases%2Ft%2F285-sticky.t;h=8dfe9aeaeb78f6be2248e78b3da3fd47a9c29638;hp=f53e4a9341c09e8fd3f65f1c0a7913cbb81080d2;hb=1847938d4eeba98260cc79ca45a11a134274c2ea;hpb=c54f5008395b10c046f380cc3069ff779e5d2877;ds=sidebyside diff --git a/testcases/t/285-sticky.t b/testcases/t/285-sticky.t index f53e4a93..8dfe9aea 100644 --- a/testcases/t/285-sticky.t +++ b/testcases/t/285-sticky.t @@ -16,7 +16,14 @@ # # Tests sticky windows. # Ticket: #1455 -use i3test; +use i3test i3_config => < 'findme'); +open_window; cmd 'sticky enable'; $ws = fresh_workspace; is(@{get_ws($ws)->{nodes}}, 0, 'tiling sticky container did not move'); is(@{get_ws($ws)->{floating_nodes}}, 0, 'tiling sticky container did not move'); -cmd '[class="findme"] kill'; +kill_all_windows; ############################################################################### # 2: Given a sticky floating container, when the workspace is switched, then # the container moves to the new workspace. ############################################################################### $ws = fresh_workspace; -open_floating_window(wm_class => 'findme'); +open_floating_window; $focused = get_focused($ws); cmd 'sticky enable'; $ws = fresh_workspace; is(@{get_ws($ws)->{floating_nodes}}, 1, 'floating sticky container moved to new workspace'); is(get_focused($ws), $focused, 'sticky container has focus'); -cmd '[class="findme"] kill'; +kill_all_windows; ############################################################################### # 3: Given two sticky floating containers, when the workspace is switched, # then both containers move to the new workspace. ############################################################################### fresh_workspace; -open_floating_window(wm_class => 'findme'); +open_floating_window; cmd 'sticky enable'; -open_floating_window(wm_class => 'findme'); +open_floating_window; cmd 'sticky enable'; $ws = fresh_workspace; is(@{get_ws($ws)->{floating_nodes}}, 2, 'multiple sticky windows can be used at the same time'); -cmd '[class="findme"] kill'; +kill_all_windows; ############################################################################### # 4: Given an unfocused sticky floating container and a tiling container on the @@ -70,13 +77,13 @@ $ws = fresh_workspace; open_window; $focused = get_focused($ws); fresh_workspace; -open_floating_window(wm_class => 'findme'); +open_floating_window; cmd 'sticky enable'; open_window; cmd 'workspace ' . $ws; is(get_focused($ws), $focused, 'the tiling container has focus'); -cmd '[class="findme"] kill'; +kill_all_windows; ############################################################################### # 5: Given a focused sticky floating container and a tiling container on the @@ -86,13 +93,13 @@ cmd '[class="findme"] kill'; $ws = fresh_workspace; open_window; $tmp = fresh_workspace; -open_floating_window(wm_class => 'findme'); +open_floating_window; $focused = get_focused($tmp); cmd 'sticky enable'; cmd 'workspace ' . $ws; is(get_focused($ws), $focused, 'the sticky container has focus'); -cmd '[class="findme"] kill'; +kill_all_windows; ############################################################################### # 6: Given a floating container on a non-visible workspace, when the window @@ -100,13 +107,31 @@ cmd '[class="findme"] kill'; # visible workspace. ############################################################################### fresh_workspace; -open_floating_window(wm_class => 'findme'); +open_floating_window; cmd 'mark sticky'; $ws = fresh_workspace; cmd '[con_mark=sticky] sticky enable'; is(@{get_ws($ws)->{floating_nodes}}, 1, 'the sticky window jumps to the front'); -cmd '[class="findme"] kill'; +kill_all_windows; + +############################################################################### +# 7: Given a sticky floating container and a workspace on another output, when +# a new workspace assigned to the first output is focused, then the sticky +# container should jump to the new workspace and have input focus correctly. +############################################################################### +$ws = fresh_workspace(output => 0); +open_floating_window; +cmd 'sticky enabled'; +$focused = get_focused($ws); +$ws = fresh_workspace(output => 1); + +is(@{get_ws($ws)->{floating_nodes}}, 0, 'the sticky window didn\'t jump to a workspace on a different output'); +$ws = 'ws-on-0'; +cmd "workspace $ws"; +is(@{get_ws($ws)->{floating_nodes}}, 1, 'the sticky window moved to new workspace on first output'); +is(get_focused($ws), $focused, 'the sticky window has focus'); +kill_all_windows; ###############################################################################