diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2004-03-03 09:54:02 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2004-03-03 09:54:02 +0000 |
commit | 3d370a143027b1a984b6c6f583e7eb6f76d4bf4e (patch) | |
tree | b8bcbada78c114c019ff5a8a764ad0d6a1dc7c4e | |
parent | e4875fb4243f0622b091e420e34124c7866dd576 (diff) | |
download | control-center-3d370a143027b1a984b6c6f583e7eb6f76d4bf4e.tar control-center-3d370a143027b1a984b6c6f583e7eb6f76d4bf4e.tar.gz control-center-3d370a143027b1a984b6c6f583e7eb6f76d4bf4e.tar.bz2 control-center-3d370a143027b1a984b6c6f583e7eb6f76d4bf4e.tar.xz control-center-3d370a143027b1a984b6c6f583e7eb6f76d4bf4e.zip |
handle --geometry
-rwxr-xr-x | control-center | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/control-center b/control-center index 454def7c..8a5a2d75 100755 --- a/control-center +++ b/control-center @@ -64,6 +64,17 @@ my %option_values; $option_values{show_log} = text2bool($h{LOGS}); my $theme = $h{THEME}; $theme = $1 if "@ARGV" =~ /--theme (\w+)/; + +my ($i, $geometry); +foreach (@ARGV) { + $i++; + if (/^--geometry$/) { + $geometry = splice @ARGV, $i, 1; + print "geometry is $geometry\n"; + last; + } +} + -d "$themes_dir/$theme" or $theme = 'default'; add_icon_path("$themes_dir/$theme/"); add_icon_path("$themes_dir/default") if $theme ne 'default'; # fall back if theme miss some icons @@ -307,7 +318,14 @@ my @tree = my ($timeout, %check_boxes, $emb_socket, $page_id); my $window_global = gtkset_size_request(Gtk2::Window->new('toplevel'), 620, 460); -$window_global->resize(max($default_width, $h{WIDTH}), max($h{HEIGTH}, $default_heigth)); +if ($geometry) { + my ($w, $h) = $geometry =~ /(\d+)x(\d+)/; + my ($x, $y) = $geometry =~ /([+-]\d+)([+-]\d+)/; + $window_global->resize(max($w, $default_width), max($default_heigth, $h)); + $window_global->set_uposition($x, $y) if $x || $y; +} else { + $window_global->resize(max($default_width, $h{WIDTH}), max($h{HEIGTH}, $default_heigth)); +} $window_global->set_icon(gtkcreate_pixbuf("/usr/share/icons/drakconf.png")); my $pending_app = 0; |