]> git.sur5r.net Git - i3/i3/blob - testcases/t/05-ipc.t
bugfix: don’t clean up workspace when switching to the same workspace
[i3/i3] / testcases / t / 05-ipc.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3
4 use i3test tests => 3;
5 use X11::XCB qw(:all);
6 use Time::HiRes qw(sleep);
7
8 BEGIN {
9     use_ok('X11::XCB::Connection') or BAIL_OUT('Cannot load X11::XCB::Connection');
10 }
11
12 my $x = X11::XCB::Connection->new;
13
14 my $i3 = i3;
15
16 #####################################################################
17 # Ensure IPC works by switching workspaces
18 #####################################################################
19
20 # Switch to the first workspace to get a clean testing environment
21 $i3->command('1')->recv;
22
23 # Create a window so we can get a focus different from NULL
24 my $window = i3test::open_standard_window($x);
25 diag("window->id = " . $window->id);
26
27 sleep(0.25);
28
29 my $focus = $x->input_focus;
30 diag("old focus = $focus");
31
32 # Switch to the nineth workspace
33 $i3->command('9')->recv;
34
35 my $new_focus = $x->input_focus;
36 isnt($focus, $new_focus, "Focus changed");
37
38 diag( "Testing i3, Perl $], $^X" );