Sun Jan 30 20:10:52 2000 Lars Hamann <lars@gtk.org> A few more fixes for bug #5487, #2051, #2677. * gtk/gtkclist.c : (gtk_clist_button_press): Reset clist->anchor to -1 if event->type is not GDK_BUTTON_PRESS. (resync_selection): resync only if selection_mode is GTK_SELECTION_EXTENDED * gtk/gtkctree.c (resync_selection): same here
This commit is contained in:
10
ChangeLog
10
ChangeLog
@@ -1,3 +1,13 @@
|
||||
Sun Jan 30 20:10:52 2000 Lars Hamann <lars@gtk.org>
|
||||
|
||||
A few more fixes for bug #5487, #2051, #2677.
|
||||
* gtk/gtkclist.c :
|
||||
(gtk_clist_button_press): Reset clist->anchor to -1 if event->type is
|
||||
not GDK_BUTTON_PRESS.
|
||||
(resync_selection): resync only if selection_mode is
|
||||
GTK_SELECTION_EXTENDED
|
||||
* gtk/gtkctree.c (resync_selection): same here
|
||||
|
||||
Sun Jan 30 12:29:20 2000 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gdk/gdk.h gtk/gtkmenu.h: Removed duplicate prototypes for
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
Sun Jan 30 20:10:52 2000 Lars Hamann <lars@gtk.org>
|
||||
|
||||
A few more fixes for bug #5487, #2051, #2677.
|
||||
* gtk/gtkclist.c :
|
||||
(gtk_clist_button_press): Reset clist->anchor to -1 if event->type is
|
||||
not GDK_BUTTON_PRESS.
|
||||
(resync_selection): resync only if selection_mode is
|
||||
GTK_SELECTION_EXTENDED
|
||||
* gtk/gtkctree.c (resync_selection): same here
|
||||
|
||||
Sun Jan 30 12:29:20 2000 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gdk/gdk.h gtk/gtkmenu.h: Removed duplicate prototypes for
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
Sun Jan 30 20:10:52 2000 Lars Hamann <lars@gtk.org>
|
||||
|
||||
A few more fixes for bug #5487, #2051, #2677.
|
||||
* gtk/gtkclist.c :
|
||||
(gtk_clist_button_press): Reset clist->anchor to -1 if event->type is
|
||||
not GDK_BUTTON_PRESS.
|
||||
(resync_selection): resync only if selection_mode is
|
||||
GTK_SELECTION_EXTENDED
|
||||
* gtk/gtkctree.c (resync_selection): same here
|
||||
|
||||
Sun Jan 30 12:29:20 2000 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gdk/gdk.h gtk/gtkmenu.h: Removed duplicate prototypes for
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
Sun Jan 30 20:10:52 2000 Lars Hamann <lars@gtk.org>
|
||||
|
||||
A few more fixes for bug #5487, #2051, #2677.
|
||||
* gtk/gtkclist.c :
|
||||
(gtk_clist_button_press): Reset clist->anchor to -1 if event->type is
|
||||
not GDK_BUTTON_PRESS.
|
||||
(resync_selection): resync only if selection_mode is
|
||||
GTK_SELECTION_EXTENDED
|
||||
* gtk/gtkctree.c (resync_selection): same here
|
||||
|
||||
Sun Jan 30 12:29:20 2000 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gdk/gdk.h gtk/gtkmenu.h: Removed duplicate prototypes for
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
Sun Jan 30 20:10:52 2000 Lars Hamann <lars@gtk.org>
|
||||
|
||||
A few more fixes for bug #5487, #2051, #2677.
|
||||
* gtk/gtkclist.c :
|
||||
(gtk_clist_button_press): Reset clist->anchor to -1 if event->type is
|
||||
not GDK_BUTTON_PRESS.
|
||||
(resync_selection): resync only if selection_mode is
|
||||
GTK_SELECTION_EXTENDED
|
||||
* gtk/gtkctree.c (resync_selection): same here
|
||||
|
||||
Sun Jan 30 12:29:20 2000 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gdk/gdk.h gtk/gtkmenu.h: Removed duplicate prototypes for
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
Sun Jan 30 20:10:52 2000 Lars Hamann <lars@gtk.org>
|
||||
|
||||
A few more fixes for bug #5487, #2051, #2677.
|
||||
* gtk/gtkclist.c :
|
||||
(gtk_clist_button_press): Reset clist->anchor to -1 if event->type is
|
||||
not GDK_BUTTON_PRESS.
|
||||
(resync_selection): resync only if selection_mode is
|
||||
GTK_SELECTION_EXTENDED
|
||||
* gtk/gtkctree.c (resync_selection): same here
|
||||
|
||||
Sun Jan 30 12:29:20 2000 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gdk/gdk.h gtk/gtkmenu.h: Removed duplicate prototypes for
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
Sun Jan 30 20:10:52 2000 Lars Hamann <lars@gtk.org>
|
||||
|
||||
A few more fixes for bug #5487, #2051, #2677.
|
||||
* gtk/gtkclist.c :
|
||||
(gtk_clist_button_press): Reset clist->anchor to -1 if event->type is
|
||||
not GDK_BUTTON_PRESS.
|
||||
(resync_selection): resync only if selection_mode is
|
||||
GTK_SELECTION_EXTENDED
|
||||
* gtk/gtkctree.c (resync_selection): same here
|
||||
|
||||
Sun Jan 30 12:29:20 2000 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gdk/gdk.h gtk/gtkmenu.h: Removed duplicate prototypes for
|
||||
|
||||
@@ -3865,8 +3865,7 @@ real_undo_selection (GtkCList *clist)
|
||||
clist->selection_mode != GTK_SELECTION_EXTENDED)
|
||||
return;
|
||||
|
||||
if (clist->anchor >= 0)
|
||||
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
||||
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
||||
|
||||
if (!(clist->undo_selection || clist->undo_unselection))
|
||||
{
|
||||
@@ -3948,6 +3947,9 @@ resync_selection (GtkCList *clist,
|
||||
GList *list;
|
||||
GtkCListRow *clist_row;
|
||||
|
||||
if (clist->selection_mode != GTK_SELECTION_EXTENDED)
|
||||
return;
|
||||
|
||||
if (clist->anchor < 0 || clist->drag_pos < 0)
|
||||
return;
|
||||
|
||||
@@ -4226,10 +4228,9 @@ end_selection (GtkCList *clist)
|
||||
g_return_if_fail (clist != NULL);
|
||||
g_return_if_fail (GTK_IS_CLIST (clist));
|
||||
|
||||
if ((gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_FOCUS(clist)) ||
|
||||
clist->anchor == -1)
|
||||
if (gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_FOCUS(clist))
|
||||
return;
|
||||
|
||||
|
||||
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
||||
}
|
||||
|
||||
@@ -4286,8 +4287,7 @@ sync_selection (GtkCList *clist,
|
||||
clist->focus_row = clist->rows - 1;
|
||||
}
|
||||
|
||||
if (clist->selection_mode == GTK_SELECTION_BROWSE && clist->anchor != -1)
|
||||
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
||||
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
||||
|
||||
g_list_free (clist->undo_selection);
|
||||
g_list_free (clist->undo_unselection);
|
||||
@@ -4692,9 +4692,7 @@ gtk_clist_unmap (GtkWidget *widget)
|
||||
{
|
||||
remove_grab (clist);
|
||||
|
||||
if (clist->anchor != -1 &&
|
||||
clist->selection_mode == GTK_SELECTION_EXTENDED)
|
||||
GTK_CLIST_CLASS_FW (widget)->resync_selection (clist, NULL);
|
||||
GTK_CLIST_CLASS_FW (widget)->resync_selection (clist, NULL);
|
||||
|
||||
clist->click_cell.row = -1;
|
||||
clist->click_cell.column = -1;
|
||||
@@ -4942,10 +4940,6 @@ gtk_clist_button_press (GtkWidget *widget,
|
||||
clist->click_cell.column = column;
|
||||
clist->drag_button = event->button;
|
||||
}
|
||||
/* FIXME FIXME FIXME: The following code is harmful, because it results in the
|
||||
* necessary cleanup not being done in gtk_clist_button_release()
|
||||
* when we get a GDK_BUTTON_PRESS GDK_2BUTTON_PRESS GDK_BUTTON_RELEASE sequence.
|
||||
*/
|
||||
else
|
||||
{
|
||||
clist->click_cell.row = -1;
|
||||
@@ -4998,9 +4992,12 @@ gtk_clist_button_press (GtkWidget *widget,
|
||||
case GTK_SELECTION_SINGLE:
|
||||
case GTK_SELECTION_MULTIPLE:
|
||||
if (event->type != GDK_BUTTON_PRESS)
|
||||
gtk_signal_emit (GTK_OBJECT (clist),
|
||||
clist_signals[SELECT_ROW],
|
||||
row, column, event);
|
||||
{
|
||||
gtk_signal_emit (GTK_OBJECT (clist),
|
||||
clist_signals[SELECT_ROW],
|
||||
row, column, event);
|
||||
clist->anchor = -1;
|
||||
}
|
||||
else
|
||||
clist->anchor = row;
|
||||
break;
|
||||
@@ -6691,8 +6688,7 @@ gtk_clist_focus_out (GtkWidget *widget,
|
||||
|
||||
clist = GTK_CLIST (widget);
|
||||
|
||||
if (clist->anchor != -1 && clist->selection_mode == GTK_SELECTION_EXTENDED)
|
||||
GTK_CLIST_CLASS_FW (widget)->resync_selection (clist, (GdkEvent *) event);
|
||||
GTK_CLIST_CLASS_FW (widget)->resync_selection (clist, (GdkEvent *) event);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -7886,9 +7882,7 @@ gtk_clist_set_button_actions (GtkCList *clist,
|
||||
clist->drag_button = 0;
|
||||
}
|
||||
|
||||
if (clist->anchor >= 0 &&
|
||||
clist->selection_mode == GTK_SELECTION_EXTENDED)
|
||||
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
||||
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
||||
|
||||
clist->button_actions[button] = button_actions;
|
||||
}
|
||||
|
||||
@@ -2056,8 +2056,7 @@ gtk_ctree_link (GtkCTree *ctree,
|
||||
|
||||
if (update_focus_row && clist->selection_mode == GTK_SELECTION_EXTENDED)
|
||||
{
|
||||
if (clist->anchor != -1)
|
||||
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
||||
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
||||
|
||||
g_list_free (clist->undo_selection);
|
||||
g_list_free (clist->undo_unselection);
|
||||
@@ -2202,8 +2201,7 @@ gtk_ctree_unlink (GtkCTree *ctree,
|
||||
|
||||
if (update_focus_row && clist->selection_mode == GTK_SELECTION_EXTENDED)
|
||||
{
|
||||
if (clist->anchor != -1)
|
||||
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
||||
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
||||
|
||||
g_list_free (clist->undo_selection);
|
||||
g_list_free (clist->undo_unselection);
|
||||
@@ -2385,8 +2383,7 @@ real_tree_move (GtkCTree *ctree,
|
||||
|
||||
if (clist->selection_mode == GTK_SELECTION_EXTENDED)
|
||||
{
|
||||
if (clist->anchor != -1)
|
||||
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
||||
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
||||
|
||||
g_list_free (clist->undo_selection);
|
||||
g_list_free (clist->undo_unselection);
|
||||
@@ -2502,8 +2499,7 @@ real_tree_expand (GtkCTree *ctree,
|
||||
|
||||
clist = GTK_CLIST (ctree);
|
||||
|
||||
if (clist->selection_mode == GTK_SELECTION_EXTENDED && clist->anchor >= 0)
|
||||
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
||||
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
||||
|
||||
GTK_CTREE_ROW (node)->expanded = TRUE;
|
||||
level = GTK_CTREE_ROW (node)->level;
|
||||
@@ -2648,8 +2644,7 @@ real_tree_collapse (GtkCTree *ctree,
|
||||
|
||||
clist = GTK_CLIST (ctree);
|
||||
|
||||
if (clist->selection_mode == GTK_SELECTION_EXTENDED && clist->anchor >= 0)
|
||||
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
||||
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
||||
|
||||
GTK_CTREE_ROW (node)->expanded = FALSE;
|
||||
level = GTK_CTREE_ROW (node)->level;
|
||||
@@ -4572,8 +4567,7 @@ gtk_ctree_real_select_recursive (GtkCTree *ctree,
|
||||
|
||||
if (clist->selection_mode == GTK_SELECTION_EXTENDED)
|
||||
{
|
||||
if (clist->anchor != -1)
|
||||
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
||||
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
||||
|
||||
g_list_free (clist->undo_selection);
|
||||
g_list_free (clist->undo_unselection);
|
||||
@@ -5505,8 +5499,7 @@ gtk_ctree_sort_recursive (GtkCTree *ctree,
|
||||
|
||||
if (clist->selection_mode == GTK_SELECTION_EXTENDED)
|
||||
{
|
||||
if (clist->anchor != -1)
|
||||
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
||||
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
||||
|
||||
g_list_free (clist->undo_selection);
|
||||
g_list_free (clist->undo_unselection);
|
||||
@@ -5554,8 +5547,7 @@ gtk_ctree_sort_node (GtkCTree *ctree,
|
||||
|
||||
if (clist->selection_mode == GTK_SELECTION_EXTENDED)
|
||||
{
|
||||
if (clist->anchor != -1)
|
||||
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
||||
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
||||
|
||||
g_list_free (clist->undo_selection);
|
||||
g_list_free (clist->undo_unselection);
|
||||
@@ -5637,6 +5629,9 @@ resync_selection (GtkCList *clist, GdkEvent *event)
|
||||
g_return_if_fail (clist != NULL);
|
||||
g_return_if_fail (GTK_IS_CTREE (clist));
|
||||
|
||||
if (clist->selection_mode != GTK_SELECTION_EXTENDED)
|
||||
return;
|
||||
|
||||
if (clist->anchor < 0 || clist->drag_pos < 0)
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user