From bdd65091d80665762010f21af35af795107fc7fe Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 19 Feb 2004 21:01:32 +0000 Subject: use $ugtk2::current_window in place of @interactive::objects (which was unused and broken) => fix XSetInputFocus (bugzilla #8046 and #8053) --- perl-install/interactive/gtk.pm | 4 ++-- perl-install/ugtk2.pm | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'perl-install') diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm index a8783e347..37e427f7f 100644 --- a/perl-install/interactive/gtk.pm +++ b/perl-install/interactive/gtk.pm @@ -751,8 +751,8 @@ sub wait_message_endW { sub kill { my ($_o) = @_; - $_->destroy foreach $::WizardTable ? $::WizardTable->get_children : (), @tempory::objects, @interactive::objects; - @tempory::objects = @interactive::objects = (); + $_->destroy foreach $::WizardTable ? $::WizardTable->get_children : (), @tempory::objects; + @tempory::objects = (); } sub ok { diff --git a/perl-install/ugtk2.pm b/perl-install/ugtk2.pm index 519fbb35c..dfa848a38 100644 --- a/perl-install/ugtk2.pm +++ b/perl-install/ugtk2.pm @@ -884,9 +884,7 @@ sub new { } else { $o->{window} = $o->{rwindow}; } - $o->{rwindow}->set_position('center_always') if - $force_center || $o->{force_center} || - @interactive::objects && $::isStandalone && !$o->{transient}; #- no need to center when set_transient is used + $o->{rwindow}->set_position('center_always') if $force_center || $o->{force_center}; $o->{rwindow}->set_modal(1) if $grab || $o->{grab} || $o->{modal}; $o->{rwindow}->set_transient_for($o->{transient}) if $o->{transient} =~ /Gtk2::Window/; @@ -957,7 +955,6 @@ sub show($) { sub destroy($) { my ($o) = @_; $o->{rwindow}->destroy if !$o->{destroyed}; - @interactive::objects = grep { $o != $_ } @interactive::objects; gtkset_mousecursor_wait(); flush(); } @@ -988,7 +985,11 @@ sub _create_window { $w->set_name("Title"); $w->set_title($title); - $w->signal_connect(expose_event => \&_XSetInputFocus) if $force_focus; + if ($force_focus) { + (my $previous_current_window, $ugtk2::current_window) = ($ugtk2::current_window, $w); + $w->signal_connect(expose_event => \&_XSetInputFocus); + $w->signal_connect(destroy => sub { $ugtk2::current_window = $previous_current_window }); + } $w->signal_connect(delete_event => sub { if ($::isWizard) { $w->destroy; @@ -1027,7 +1028,7 @@ sub _create_window { sub _XSetInputFocus { my ($w) = @_; - if (!@interactive::objects || $interactive::objects[-1]{rwindow} == $w) { + if ($ugtk2::current_window == $w) { $w->window->XSetInputFocus; } else { log::l("not XSetInputFocus since already done and not on top"); -- cgit v1.2.1