summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Hamann <lars@gtk.org>2000-01-29 23:12:08 +0000
committerLars Hamann <lars@src.gnome.org>2000-01-29 23:12:08 +0000
commit255369aecb8b971aa5bda3c8fa3ce27c7109bc68 (patch)
tree01b9048dfe02082a8a992c7ee189d33d6593633c
parentc59f76082454c8b4f862e04bd73a87ad846825cd (diff)
downloadgdk-pixbuf-255369aecb8b971aa5bda3c8fa3ce27c7109bc68.tar.gz
A few more fixes for bug #5487, #2051, #2677. Reset clist->anchor to -1 if
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
-rw-r--r--ChangeLog10
-rw-r--r--ChangeLog.pre-2-010
-rw-r--r--ChangeLog.pre-2-1010
-rw-r--r--ChangeLog.pre-2-210
-rw-r--r--ChangeLog.pre-2-410
-rw-r--r--ChangeLog.pre-2-610
-rw-r--r--ChangeLog.pre-2-810
-rw-r--r--gtk/gtkclist.c38
-rw-r--r--gtk/gtkctree.c27
9 files changed, 97 insertions, 38 deletions
diff --git a/ChangeLog b/ChangeLog
index b7f3de5d6..3a4fc25d5 100644
--- a/ChangeLog
+++ b/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
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index b7f3de5d6..3a4fc25d5 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -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
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index b7f3de5d6..3a4fc25d5 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -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
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index b7f3de5d6..3a4fc25d5 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -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
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index b7f3de5d6..3a4fc25d5 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -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
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index b7f3de5d6..3a4fc25d5 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -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
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index b7f3de5d6..3a4fc25d5 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -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
diff --git a/gtk/gtkclist.c b/gtk/gtkclist.c
index 248b0a9e2..2c46ea9f8 100644
--- a/gtk/gtkclist.c
+++ b/gtk/gtkclist.c
@@ -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;
}
diff --git a/gtk/gtkctree.c b/gtk/gtkctree.c
index 300250dfa..7a4f5c180 100644
--- a/gtk/gtkctree.c
+++ b/gtk/gtkctree.c
@@ -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;