summaryrefslogtreecommitdiffstats
path: root/perl-install/ugtk2.pm
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2003-01-08 16:40:46 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2003-01-08 16:40:46 +0000
commit22e659977faafc0f55a02be7197d49885be362c1 (patch)
tree5525c82670c6e108ac9c4b15dea67bbe312fd22d /perl-install/ugtk2.pm
parent5231c1ae186ea18f3e8f9d015c549e6e3d988ade (diff)
downloaddrakx-backup-do-not-use-22e659977faafc0f55a02be7197d49885be362c1.tar
drakx-backup-do-not-use-22e659977faafc0f55a02be7197d49885be362c1.tar.gz
drakx-backup-do-not-use-22e659977faafc0f55a02be7197d49885be362c1.tar.bz2
drakx-backup-do-not-use-22e659977faafc0f55a02be7197d49885be362c1.tar.xz
drakx-backup-do-not-use-22e659977faafc0f55a02be7197d49885be362c1.zip
fix a misc bug in rpmdrake (selecting a pkg doesn't work in certain circumstances - seems to be when the treeview doesn't have the focus, for exa
mple after a search) by changing a bit the way we handle button_press_event in ask_browse_tree_info
Diffstat (limited to 'perl-install/ugtk2.pm')
-rw-r--r--perl-install/ugtk2.pm12
1 files changed, 9 insertions, 3 deletions
diff --git a/perl-install/ugtk2.pm b/perl-install/ugtk2.pm
index 37c105e2d..c4775b138 100644
--- a/perl-install/ugtk2.pm
+++ b/perl-install/ugtk2.pm
@@ -1245,11 +1245,17 @@ sub ask_browse_tree_info_given_widgets {
} else {
$curr = $iter;
}
- $toggle->(1), $mouse_toggle_pending = 0 if $mouse_toggle_pending;
+ #- the following test for equality is because we can have a button_press_event first, then
+ #- two changed events, the first being on a different row :/ (is it a bug in gtk2?) - that
+ #- happens in rpmdrake when doing a "search" and directly trying to select a found package
+ $toggle->(1), $mouse_toggle_pending = 0 if $mouse_toggle_pending eq $model->get($iter, 0);
});
$w->{tree}->signal_connect(button_press_event => sub { #- not too good, but CellRendererPixbuf doesn't have the needed signals :(
- my ($x, $textw, $pixw) = ($_[1]->x, $w->{textcolumn}->get_width, $w->{pixcolumn}->get_width);
- $mouse_toggle_pending = 1 if $x > $textw && $x < $textw + $pixw;
+ my ($returns, $path, $column) = $w->{tree}->get_path_at_pos($_[1]->x, $_[1]->y);
+ if ($returns) {
+ Gtk2->equals($column, $w->{pixcolumn}) and $mouse_toggle_pending = $w->{tree_model}->get($path, 0);
+ $path->free;
+ }
});
$common->{rebuild_tree}->();
&$update_size;