summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-01-11 09:17:47 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-01-11 09:17:47 +0000
commitb90a8c0290b372790636d7f1d4b306c7af39834d (patch)
tree9a2b39fae6430076fe4250523ae2e17ca13d6efa /perl-install
parenta26232615ff7c02a8c0b52151cb5978b7210d89e (diff)
downloaddrakx-backup-do-not-use-b90a8c0290b372790636d7f1d4b306c7af39834d.tar
drakx-backup-do-not-use-b90a8c0290b372790636d7f1d4b306c7af39834d.tar.gz
drakx-backup-do-not-use-b90a8c0290b372790636d7f1d4b306c7af39834d.tar.bz2
drakx-backup-do-not-use-b90a8c0290b372790636d7f1d4b306c7af39834d.tar.xz
drakx-backup-do-not-use-b90a8c0290b372790636d7f1d4b306c7af39834d.zip
- $current_window can be local to ugtk2, so do it that way
- create force_keyboard_focus()
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/ugtk2.pm29
1 files changed, 18 insertions, 11 deletions
diff --git a/perl-install/ugtk2.pm b/perl-install/ugtk2.pm
index 9677246fe..7d16fb08f 100644
--- a/perl-install/ugtk2.pm
+++ b/perl-install/ugtk2.pm
@@ -964,10 +964,7 @@ sub _create_window {
});
if ($no_Window_Manager) {
- #- force keyboard focus instead of mouse 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 });
+ force_keyboard_focus($w);
}
if ($::isInstall) {
@@ -992,16 +989,26 @@ sub _create_window {
$w;
}
-sub _XSetInputFocus {
+my $current_window;
+sub force_keyboard_focus {
my ($w) = @_;
- if ($ugtk2::current_window == $w) {
- $w->window->XSetInputFocus;
- } else {
- log::l("not XSetInputFocus since already done and not on top");
+
+ sub _XSetInputFocus {
+ my ($w) = @_;
+ if ($current_window == $w) {
+ $w->window->XSetInputFocus;
+ } else {
+ log::l("not XSetInputFocus since already done and not on top");
+ }
+ 0;
}
- 0;
-}
+ #- force keyboard focus instead of mouse focus
+ my $previous_current_window = $current_window;
+ $current_window = $w;
+ $w->signal_connect(expose_event => \&_XSetInputFocus);
+ $w->signal_connect(destroy => sub { $current_window = $previous_current_window });
+}
# -=-=---=-=---=-=---=-=---=-=---=-=---=-=---=-=---=-=---=-=---=-=---=-=---
# ask