]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/119-match.t
Merge branch 'master' into next
[i3/i3] / testcases / t / 119-match.t
index 7ac622c72457777c6610a047532ce7abd1fa5b55..0aaeddd732ddfc676380cc451f0c2f28fd666fe3 100644 (file)
@@ -17,7 +17,6 @@
 # Tests all kinds of matching methods
 #
 use i3test;
-use X11::XCB qw(PROP_MODE_REPLACE);
 
 my $tmp = fresh_workspace;
 
@@ -61,39 +60,10 @@ is_num_children($tmp, 0, 'window killed');
 
 $tmp = fresh_workspace;
 
-# TODO: move to X11::XCB
-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"
-    );
-}
-
-sub open_special {
-    my %args = @_;
-    my $wm_class = delete($args{wm_class}) || 'special';
-
-    return open_window(
-        %args,
-        before_map => sub { set_wm_class($_->id, $wm_class, $wm_class) },
-    );
-}
-
-my $left = open_special(name => 'left');
+my $left = open_window(wm_class => 'special', name => 'left');
 ok($left->mapped, 'left window mapped');
 
-my $right = open_special(name => 'right');
+my $right = open_window(wm_class => 'special', name => 'right');
 ok($right->mapped, 'right window mapped');
 
 # two windows should be here
@@ -111,7 +81,7 @@ is_num_children($tmp, 1, 'one window still there');
 
 $tmp = fresh_workspace;
 
-$left = open_special(name => 'left', wm_class => 'special7');
+$left = open_window(name => 'left', wm_class => 'special7');
 ok($left->mapped, 'left window mapped');
 is_num_children($tmp, 1, 'window opened');
 
@@ -125,7 +95,7 @@ is_num_children($tmp, 0, 'window killed');
 
 $tmp = fresh_workspace;
 
-$left = open_special(name => 'ä 3', wm_class => 'special7');
+$left = open_window(name => 'ä 3', wm_class => 'special7');
 ok($left->mapped, 'left window mapped');
 is_num_children($tmp, 1, 'window opened');