diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-02-19 21:01:32 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-02-19 21:01:32 +0000 |
commit | bdd65091d80665762010f21af35af795107fc7fe (patch) | |
tree | 5a9bd69e6cff4ceb8a9801d572d615fa2a9fb496 /perl-install/ugtk2.pm | |
parent | 15dcf43d21d3213a4b17980b1519a52e1ceb1183 (diff) | |
download | drakx-bdd65091d80665762010f21af35af795107fc7fe.tar drakx-bdd65091d80665762010f21af35af795107fc7fe.tar.gz drakx-bdd65091d80665762010f21af35af795107fc7fe.tar.bz2 drakx-bdd65091d80665762010f21af35af795107fc7fe.tar.xz drakx-bdd65091d80665762010f21af35af795107fc7fe.zip |
use $ugtk2::current_window in place of @interactive::objects (which was unused and broken)
=> fix XSetInputFocus (bugzilla #8046 and #8053)
Diffstat (limited to 'perl-install/ugtk2.pm')
-rw-r--r-- | perl-install/ugtk2.pm | 13 |
1 files changed, 7 insertions, 6 deletions
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"); |