summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-12-17 16:03:04 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-12-17 16:03:04 +0000
commit6902e4292254fac7e7088e82c7acc67819a34705 (patch)
tree41a03caa0819a4a02ae52ad79f63eafae10a1fdd /perl-install
parent1f827eb197702deabebe3ff7b2dd228d4eae3461 (diff)
downloaddrakx-backup-do-not-use-6902e4292254fac7e7088e82c7acc67819a34705.tar
drakx-backup-do-not-use-6902e4292254fac7e7088e82c7acc67819a34705.tar.gz
drakx-backup-do-not-use-6902e4292254fac7e7088e82c7acc67819a34705.tar.bz2
drakx-backup-do-not-use-6902e4292254fac7e7088e82c7acc67819a34705.tar.xz
drakx-backup-do-not-use-6902e4292254fac7e7088e82c7acc67819a34705.zip
don't parse the theme rc file to set the root window background color during install,
instead use the gc of a fake window named "background"
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/install_gtk.pm24
-rw-r--r--perl-install/mygtk2.pm9
2 files changed, 17 insertions, 16 deletions
diff --git a/perl-install/install_gtk.pm b/perl-install/install_gtk.pm
index 59eff6373..28256021d 100644
--- a/perl-install/install_gtk.pm
+++ b/perl-install/install_gtk.pm
@@ -13,8 +13,6 @@ use devices;
#-INTERN CONSTANT
#-#####################################################################################
-my @background;
-
#- if we're running for the doc team, we want screenshots with
#- a good B&W contrast: we'll override values of our theme
my $theme_overriding_for_doc = q(style "galaxy-default"
@@ -57,17 +55,10 @@ widget "*logo*" style "background-logo"
sub load_rc {
my ($o, $name) = @_;
- if (my $f = -r $name ? $name
- : find { -r $_ } map { "$_/themes-$name.rc" } ("share", $ENV{SHARE_PATH}, dirname(__FILE__))) {
- my @contents = cat_($f);
- $o->{doc} and push @contents, $theme_overriding_for_doc;
-
- Gtk2::Rc->parse_string(join("\n", @contents));
- foreach (@contents) {
- if (/style\s+"background"/ .. /^\s*$/) {
- @background = map { $_ * 255 * 255 } split ',', $1 if /NORMAL.*\{(.*)\}/;
- }
- }
+ my $f = $name;
+ -r $name or $f = find { -r $_ } map { "$_/themes-$name.rc" } ("share", $ENV{SHARE_PATH}, dirname(__FILE__));
+ if ($f) {
+ Gtk2::Rc->parse_string($o->{doc} ? $theme_overriding_for_doc : scalar cat_($f));
}
if ($::move) {
@@ -118,7 +109,12 @@ sub install_theme {
load_rc($o, $o->{theme} ||= default_theme($o));
load_font($o);
- mygtk2::set_root_window_background(@background) if !$::move;
+
+ if (!$::move) {
+ my $win = gtknew('Window', widget_name => 'background');
+ $win->realize;
+ mygtk2::set_root_window_background_with_gc($win->style->bg_gc('normal'));
+ }
}
#------------------------------------------------------------------------------
diff --git a/perl-install/mygtk2.pm b/perl-install/mygtk2.pm
index 68f95e714..5f9e3d2eb 100644
--- a/perl-install/mygtk2.pm
+++ b/perl-install/mygtk2.pm
@@ -675,10 +675,15 @@ sub set_root_window_background {
my $gc = Gtk2::Gdk::GC->new($root);
my $color = rgb2color($r, $g, $b);
$gc->set_rgb_fg_color($color);
- $root->set_background($color);
+ set_root_window_background_with_gc($gc);
+}
+
+sub set_root_window_background_with_gc {
+ my ($gc) = @_;
+ my $root = root_window();
my ($w, $h) = $root->get_size;
+ $root->set_background($gc->get_values->{foreground});
$root->draw_rectangle($gc, 1, 0, 0, $w, $h);
}
1;
-