From 44ab15abf05deda00cd452d01589faed40055d45 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 1 Feb 2011 18:18:25 +0100 Subject: [PATCH] tests: add testcase for the focus when moving floating con to other ws problem --- testcases/t/48-regress-floatingmovews.t | 39 +++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 testcases/t/48-regress-floatingmovews.t diff --git a/testcases/t/48-regress-floatingmovews.t b/testcases/t/48-regress-floatingmovews.t new file mode 100644 index 00000000..deebecd9 --- /dev/null +++ b/testcases/t/48-regress-floatingmovews.t @@ -0,0 +1,39 @@ +#!perl +# vim:ts=4:sw=4:expandtab +# +# Regression test for correct focus behaviour when moving a floating con to +# another workspace. +# +use X11::XCB qw(:all); +use Time::HiRes qw(sleep); +use i3test tests => 2; + +BEGIN { + use_ok('X11::XCB::Window'); +} + +my $x = X11::XCB::Connection->new; + +my $tmp = get_unused_workspace; +cmd "workspace $tmp"; + +# open a tiling window on the first workspace +open_standard_window($x); +sleep 0.25; +my $first = get_focused($tmp); + +# on a different ws, open a floating window +my $otmp = get_unused_workspace; +cmd "workspace $otmp"; +open_standard_window($x); +sleep 0.25; +my $float = get_focused($otmp); +cmd 'mode toggle'; +sleep 0.25; + +# move the floating con to first workspace +cmd "move workspace $tmp"; +sleep 0.25; + +# switch to the first ws and check focus +is(get_focused($tmp), $float, 'floating client correctly focused'); -- 2.39.5