#!perl
# vim:ts=4:sw=4:expandtab
-# !NO_I3_INSTANCE! will prevent complete-run.pl from starting i3
#
+# Please read the following documents before working on tests:
+# • http://build.i3wm.org/docs/testsuite.html
+# (or docs/testsuite)
#
-use i3test;
+# • http://build.i3wm.org/docs/lib-i3test.html
+# (alternatively: perldoc ./testcases/lib/i3test.pm)
+#
+# • http://build.i3wm.org/docs/ipc.html
+# (or docs/ipc)
+#
+# • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
+# (unless you are already familiar with Perl)
+#
+use i3test i3_autostart => 0;
use X11::XCB qw(PROP_MODE_REPLACE);
##############################################################
cmp_ok(@content, '==', 0, 'no more nodes');
diag('content = '. Dumper(\@content));
-
-# TODO: move this to X11::XCB::Window
-sub set_wm_class {
- my ($id, $class, $instance) = @_;
-
- # Add a _NET_WM_STRUT_PARTIAL hint
- my $atomname = $x->atom(name => 'WM_CLASS');
- my $atomtype = $x->atom(name => 'STRING');
-
- $x->change_property(
- PROP_MODE_REPLACE,
- $id,
- $atomname->id,
- $atomtype->id,
- 8,
- length($class) + length($instance) + 2,
- "$instance\x00$class\x00"
- );
-}
-
$window = open_window(
name => 'Borderless window',
- before_map => sub { set_wm_class($_->id, 'borderless', 'borderless') },
+ wm_class => 'borderless',
);
@content = @{get_ws_content($tmp)};
$window = open_window(
name => 'usethis',
- before_map => sub { set_wm_class($_->id, 'borderless', 'borderless') },
+ wm_class => 'borderless',
);
@content = @{get_ws_content($tmp)};
cmp_ok(@content, '==', 0, 'no nodes on this workspace now');
$window->_create;
-
-set_wm_class($window->id, 'borderless', 'borderless');
+$window->wm_class('borderless');
$window->name('notthis');
$window->map;
wait_for_map $window;
$window = open_window(
name => 'usethis',
- before_map => sub { set_wm_class($_->id, 'bar', 'foo') },
+ wm_class => 'bar',
+ instance => 'foo',
);
@content = @{get_ws_content($tmp)};
$window = open_window(
name => 'usethis',
- before_map => sub { set_wm_class($_->id, 'bar', 'foo') },
+ wm_class => 'bar',
+ instance => 'foo',
);
@content = @{get_ws_content($tmp)};
$window = open_window(
name => 'usethis',
- before_map => sub { set_wm_class($_->id, 'bar', 'foo') },
+ wm_class => 'bar',
+ instance => 'foo',
);
@content = @{get_ws_content($tmp)};