2010-10-11 15:32:04 -04:00
|
|
|
#!perl
|
|
|
|
# vim:ts=4:sw=4:expandtab
|
|
|
|
#
|
2012-09-10 08:09:01 -04:00
|
|
|
# Please read the following documents before working on tests:
|
|
|
|
# • http://build.i3wm.org/docs/testsuite.html
|
|
|
|
# (or docs/testsuite)
|
|
|
|
#
|
|
|
|
# • 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)
|
|
|
|
#
|
2010-10-11 15:32:04 -04:00
|
|
|
# Checks if size hints are interpreted correctly.
|
|
|
|
#
|
2011-03-09 14:25:17 -05:00
|
|
|
use i3test;
|
2010-10-11 15:32:04 -04:00
|
|
|
|
2011-03-09 14:25:17 -05:00
|
|
|
my $tmp = fresh_workspace;
|
2010-10-11 15:32:04 -04:00
|
|
|
|
|
|
|
ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
|
|
|
|
|
2011-11-21 18:47:32 -05:00
|
|
|
my $win = open_window({ dont_map => 1 });
|
2010-10-11 15:32:04 -04:00
|
|
|
# XXX: we should check screen size. in screens with an AR of 2.0,
|
|
|
|
# this is not a good idea.
|
|
|
|
my $aspect = X11::XCB::Sizehints::Aspect->new;
|
|
|
|
$aspect->min_num(600);
|
|
|
|
$aspect->min_den(300);
|
|
|
|
$aspect->max_num(600);
|
|
|
|
$aspect->max_den(300);
|
|
|
|
$win->_create;
|
|
|
|
$win->map;
|
2011-11-21 17:44:20 -05:00
|
|
|
wait_for_map $win;
|
2010-10-11 15:32:04 -04:00
|
|
|
$win->hints->aspect($aspect);
|
|
|
|
$x->flush;
|
|
|
|
|
2011-11-21 19:13:37 -05:00
|
|
|
sync_with_i3;
|
2010-10-11 15:32:04 -04:00
|
|
|
|
|
|
|
my $rect = $win->rect;
|
|
|
|
my $ar = $rect->width / $rect->height;
|
|
|
|
diag("Aspect ratio = $ar");
|
|
|
|
ok(($ar > 1.90) && ($ar < 2.10), 'Aspect ratio about 2.0');
|
|
|
|
|
2011-03-09 14:25:17 -05:00
|
|
|
done_testing;
|