summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Xconfig/test.pm23
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/Xconfig/test.pm b/lib/Xconfig/test.pm
index c2f16cd..a09e48e 100644
--- a/lib/Xconfig/test.pm
+++ b/lib/Xconfig/test.pm
@@ -101,7 +101,6 @@ sub test {
$ENV{DISPLAY} = ":9";
Gtk3->init;
- gtkset_background(200 * 257, 210 * 257, 210 * 257);
my $text = Gtk3::Label->new;
my $time = 12;
Glib::Timeout->add(1000, sub {
@@ -110,16 +109,18 @@ sub test {
1;
});
- eval { #- eval it so that missing pixmap will not break the test completely
- my $root = gtkroot();
- my $gc = Gtk3::Gdk::GC->new($root);
- my $pixbuf = Gtk3::Gdk::Pixbuf->new_from_file("$::prefix/usr/share/mga/xfdrake/xfdrake-test-card.png");
- my ($w, $h) = ($pixbuf->get_allocated_width, $pixbuf->get_allocated_height);
- my $pixmap = Gtk3::Gdk::Pixmap->new($root, $w, $h, $root->get_depth);
- $pixbuf->render_to_drawable($pixmap, $gc, 0, 0, 0, 0, $w, $h, 'none', 0, 0);
- $root->set_back_pixmap($pixmap, 0);
- $root->clear;
- };
+ my $root_w = Gtk3::Window->new;
+ $root_w->set_name("back");
+ my $pl = Gtk3::CssProvider->new;
+ $pl->load_from_data("#back {
+background-image: url('$::prefix/usr/share/mga/xfdrake/xfdrake-test-card.png');
+background-repeat: repeat;
+}");
+ Gtk3::StyleContext::add_provider_for_screen(Gtk3::Gdk::Screen::get_default(), $pl, Gtk3::STYLE_PROVIDER_PRIORITY_APPLICATION);
+
+ # maximize:
+ $root_w->set_default_size(Gtk3::Gdk::Screen::width, Gtk3::Gdk::Screen::height);
+ $root_w->show_all;
my $in = interactive::gtk->new;
$in->exit($in->ask_yesorno('', [ translate("%s"), $text ], 0) ? 0 : 222);