]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/158-wm_take_focus.t
Merge pull request #2469 from Airblader/feature-2465
[i3/i3] / testcases / t / 158-wm_take_focus.t
index 050e11623f95e250b4bfe6e7fe0e15e4c1261a47..5d481924af245729b80f8830131d9ee655ac4ca8 100644 (file)
@@ -50,12 +50,16 @@ sub recv_take_focus {
 }
 
 subtest 'Window without WM_TAKE_FOCUS', sub {
-    fresh_workspace;
+    my $ws = fresh_workspace;
 
     my $window = open_window;
 
     ok(!recv_take_focus($window), 'did not receive ClientMessage');
 
+    my ($nodes) = get_ws_content($ws);
+    my $con = shift @$nodes;
+    ok($con->{focused}, 'con is focused');
+
     done_testing;
 };
 
@@ -72,7 +76,7 @@ subtest 'Window without WM_TAKE_FOCUS', sub {
 # list), the window cannot accept input focus, so we should not try to focus
 # the window at all.
 subtest 'Window with WM_TAKE_FOCUS and without InputHint', sub {
-    fresh_workspace;
+    my $ws = fresh_workspace;
 
     my $take_focus = $x->atom(name => 'WM_TAKE_FOCUS');
 
@@ -88,6 +92,10 @@ subtest 'Window with WM_TAKE_FOCUS and without InputHint', sub {
 
     ok(!recv_take_focus($window), 'did not receive ClientMessage');
 
+    my ($nodes) = get_ws_content($ws);
+    my $con = shift @$nodes;
+    ok($con->{focused}, 'con is focused');
+
     done_testing;
 };
 
@@ -97,7 +105,7 @@ subtest 'Window with WM_TAKE_FOCUS and without InputHint', sub {
 # nearly identical presently, so this is currently used also as a proxy test
 # for the latter case.
 subtest 'Window with WM_TAKE_FOCUS and unspecified InputHint', sub {
-    fresh_workspace;
+    my $ws = fresh_workspace;
 
     my $take_focus = $x->atom(name => 'WM_TAKE_FOCUS');
 
@@ -105,6 +113,10 @@ subtest 'Window with WM_TAKE_FOCUS and unspecified InputHint', sub {
 
     ok(!recv_take_focus($window), 'did not receive ClientMessage');
 
+    my ($nodes) = get_ws_content($ws);
+    my $con = shift @$nodes;
+    ok($con->{focused}, 'con is focused');
+
     done_testing;
 };