summaryrefslogtreecommitdiffstats
path: root/perl-install/ugtk2.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-09-08 12:36:10 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-09-08 12:36:10 +0000
commitabbe4a3de13983cbcab7c62f08457fccd6aa9bee (patch)
tree904217b046d2a81dc02a77c7af6f9debad3bcb32 /perl-install/ugtk2.pm
parent56aa33e8cf2d62b12f4c56537d13905e6cafca72 (diff)
downloaddrakx-abbe4a3de13983cbcab7c62f08457fccd6aa9bee.tar
drakx-abbe4a3de13983cbcab7c62f08457fccd6aa9bee.tar.gz
drakx-abbe4a3de13983cbcab7c62f08457fccd6aa9bee.tar.bz2
drakx-abbe4a3de13983cbcab7c62f08457fccd6aa9bee.tar.xz
drakx-abbe4a3de13983cbcab7c62f08457fccd6aa9bee.zip
fixing keyboard focus during install:
- removed aewm-drakx which doesn't work nicely - fix @interactive::objects handling (don't push non pop_it windows, ensure destroyed windows are removed) - ensure XSetInputFocus is called on $::WizardWindow
Diffstat (limited to 'perl-install/ugtk2.pm')
-rw-r--r--perl-install/ugtk2.pm25
1 files changed, 21 insertions, 4 deletions
diff --git a/perl-install/ugtk2.pm b/perl-install/ugtk2.pm
index 4f434ce52..24d0f2210 100644
--- a/perl-install/ugtk2.pm
+++ b/perl-install/ugtk2.pm
@@ -806,9 +806,6 @@ sub new {
my $o = bless { %opts }, $type;
$o->_create_window($title);
while (my $e = shift @tempory::objects) { $e->destroy }
- push @interactive::objects, $o if !$opts{no_interactive_objects};
- $o->{rwindow}->set_modal(1) if ($grab || $o->{grab} || $o->{modal}) && !$::isInstall;
- $o->{rwindow}->set_transient_for($o->{transient}) if $o->{transient};
$o->{pop_it} ||= $pop_it || $::WizardTable && do {
my @l = $::WizardTable->get_children;
@@ -816,6 +813,12 @@ sub new {
any { $_->visible } @l;
};
+ if ($o->{pop_it}) {
+ push @interactive::objects, $o if !$opts{no_interactive_objects};
+ $o->{rwindow}->set_modal(1) if ($grab || $o->{grab} || $o->{modal}) && !$::isInstall;
+ $o->{rwindow}->set_transient_for($o->{transient}) if $o->{transient};
+ }
+
if ($::isWizard && !$o->{pop_it}) {
$o->{isWizard} = 1;
$o->{window} = Gtk2::VBox->new(0,0);
@@ -824,6 +827,8 @@ sub new {
if (!defined($::WizardWindow)) {
$::WizardWindow = Gtk2::Window->new('toplevel');
$::WizardWindow->signal_connect(delete_event => sub { die 'wizcancel' });
+ $::WizardWindow->signal_connect(expose_event => \&_XSetInputFocus) if $force_focus || $o->{force_focus};
+
$::WizardTable = Gtk2::Table->new(2, 2, 0);
$::WizardWindow->add(gtkadd(gtkset_shadow_type(Gtk2::Frame->new, 'out'), $::WizardTable));
@@ -916,6 +921,7 @@ sub show($) {
sub destroy($) {
my ($o) = @_;
$o->{rwindow}->destroy if !$o->{destroyed};
+ @interactive::objects = grep { $o != $_ } @interactive::objects;
gtkset_mousecursor_wait();
flush();
}
@@ -945,7 +951,7 @@ sub _create_window($$) {
$w->set_name("Title");
$w->set_title($title);
- $w->signal_connect(expose_event => sub { eval { $interactive::objects[-1]{rwindow} == $w and $w->window->XSetInputFocus } }) if $force_focus || $o->{force_focus};
+ $w->signal_connect(expose_event => \&_XSetInputFocus) if $force_focus || $o->{force_focus};
$w->signal_connect(delete_event => sub { if ($::isWizard) { $w->destroy; die 'wizcancel' } else { Gtk2->main_quit } });
$w->set_uposition(@{$force_position || $o->{force_position}}) if $force_position || $o->{force_position};
@@ -975,6 +981,17 @@ sub _create_window($$) {
$o->{rwindow} = $w;
}
+sub _XSetInputFocus {
+ my ($w) = @_;
+ log::l("_XSetInputFocus");
+ if (!@interactive::objects || $interactive::objects[-1]{rwindow} == $w) {
+ $w->window->XSetInputFocus;
+ } else {
+ log::l("not XSetInputFocus since already done and not on top");
+ }
+ 0;
+}
+
# -=-=---=-=---=-=---=-=---=-=---=-=---=-=---=-=---=-=---=-=---=-=---=-=---
# ask