2009-08-05 21:37:11 +02:00
|
|
|
#!perl
|
|
|
|
# vim:ts=4:sw=4:expandtab
|
|
|
|
|
2010-06-02 23:53:22 +02:00
|
|
|
use i3test tests => 2;
|
2009-08-05 21:37:11 +02:00
|
|
|
use X11::XCB qw(:all);
|
|
|
|
use Time::HiRes qw(sleep);
|
|
|
|
|
|
|
|
BEGIN {
|
|
|
|
use_ok('X11::XCB::Connection') or BAIL_OUT('Cannot load X11::XCB::Connection');
|
|
|
|
}
|
|
|
|
|
2009-10-26 20:04:37 +01:00
|
|
|
my $x = X11::XCB::Connection->new;
|
2009-08-05 21:37:11 +02:00
|
|
|
|
2010-06-02 23:53:22 +02:00
|
|
|
my $i3 = i3("/tmp/nestedcons");
|
|
|
|
my $tmp = get_unused_workspace();
|
|
|
|
$i3->command("workspace $tmp")->recv;
|
2009-08-05 21:37:11 +02:00
|
|
|
|
|
|
|
#####################################################################
|
|
|
|
# Ensure IPC works by switching workspaces
|
|
|
|
#####################################################################
|
|
|
|
|
|
|
|
# Create a window so we can get a focus different from NULL
|
2009-10-26 20:04:37 +01:00
|
|
|
my $window = i3test::open_standard_window($x);
|
2009-08-05 21:37:11 +02:00
|
|
|
diag("window->id = " . $window->id);
|
|
|
|
|
|
|
|
sleep(0.25);
|
|
|
|
|
2009-10-26 20:04:37 +01:00
|
|
|
my $focus = $x->input_focus;
|
2009-08-05 21:37:11 +02:00
|
|
|
diag("old focus = $focus");
|
|
|
|
|
|
|
|
# Switch to the nineth workspace
|
2010-06-02 23:53:22 +02:00
|
|
|
my $otmp = get_unused_workspace();
|
|
|
|
$i3->command("workspace $otmp")->recv;
|
2009-08-05 21:37:11 +02:00
|
|
|
|
2009-10-26 20:04:37 +01:00
|
|
|
my $new_focus = $x->input_focus;
|
2009-08-05 21:37:11 +02:00
|
|
|
isnt($focus, $new_focus, "Focus changed");
|
|
|
|
|
|
|
|
diag( "Testing i3, Perl $], $^X" );
|