From 3b0359bc17830004fd75dc6b2a574cbe87bb8bc3 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 19 Mar 2008 13:37:29 +0000 Subject: - XFdrake library: o ensure set_default_background() doesn't fail (#39065) (ie default to 1024x768 if 0x0 is given) --- lib/Xconfig/resolution_and_depth.pm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib') diff --git a/lib/Xconfig/resolution_and_depth.pm b/lib/Xconfig/resolution_and_depth.pm index d35deca..0c87503 100644 --- a/lib/Xconfig/resolution_and_depth.pm +++ b/lib/Xconfig/resolution_and_depth.pm @@ -250,6 +250,11 @@ sub set_resolution { } sub set_default_background { my ($resolution) = @_; + + $resolution->{X} && $resolution->{Y} or do { + $resolution = { X => 1024, Y => 768 }; + log::l("defaulting background resolution to $resolution->{X}x$resolution->{Y}"); + }; my $ratio = $resolution->{X} / $resolution->{Y}; my $dir = "$::prefix/usr/share/mdk/backgrounds"; -- cgit v1.2.1