summaryrefslogtreecommitdiffstats
path: root/perl-install/my_gtk.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/my_gtk.pm')
-rw-r--r--perl-install/my_gtk.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm
index 8bbd6a7a8..312d903f2 100644
--- a/perl-install/my_gtk.pm
+++ b/perl-install/my_gtk.pm
@@ -840,7 +840,12 @@ sub _create_window($$) {
$w->signal_connect(delete_event => sub { $w->destroy; die 'wizcancel' });
$w->set_uposition(@{$my_gtk::force_position || $o->{force_position}}) if $my_gtk::force_position || $o->{force_position};
- $w->signal_connect(focus => sub { Gtk->idle_add(sub { $w->ensure_focus($_[0]); 0 }, $_[1]) }) if $w->can('ensure_focus');
+ my $focusing;
+ $w->signal_connect(focus => sub {
+ return 1 if $focusing;
+ $focusing = 1;
+ Gtk->idle_add(sub { $w->ensure_focus($_[0]); $focusing = 0; 0 }, $_[1]);
+ }) if $w->can('ensure_focus');
if ($::o->{mouse}{unsafe}) {
$w->set_events("pointer_motion_mask");
')
-rw-r--r--perl-install/install_gtk.pm12
1 files changed, 9 insertions, 3 deletions
diff --git a/perl-install/install_gtk.pm b/perl-install/install_gtk.pm
index 2c198464c..2631c2024 100644
--- a/perl-install/install_gtk.pm
+++ b/perl-install/install_gtk.pm
@@ -443,13 +443,15 @@ sub test_mouse {
my ($bw, $bh) = ($width / 3, $height / 3);
gtkadd($w->{window},
- gtkpack(new Gtk::VBox(0,0),
+ gtkpack(my $vbox_grab = new Gtk::VBox(0,0),
my $darea = gtkset_usize(new Gtk::DrawingArea, $width+1, $height+1),
- '',
- create_okcancel($w, '', '', "edge"),
+# '',
+ my $okcancel = create_okcancel($w, '', '', "edge"),
),
);
+ $okcancel->set_uposition(2, $height-30);
+
my $draw_rect; $draw_rect = sub {
my ($black, $fill, $rect) = @_;
$draw_rect->(0, 1, $rect) if !$fill; #- blank it first
@@ -506,6 +508,10 @@ sub test_mouse {
$w->{cancel}->grab_focus;
# my $timeout = Gtk->timeout_add(1000, sub { if ($time-- == 0) { log::l("timeout test_mouse"); undef $w->{retval}; Gtk->main_quit } 1 });
# my $b = before_leaving { log::l("removing timeout"); Gtk->timeout_remove($timeout) };
+ $w->{window}->realize;
+ Gtk::Gdk->pointer_grab($darea->window, 1,
+ [ 'pointer_motion_mask'],
+ $darea->window, undef ,0);
$w->main;
}