From c3c5e7215115ece0577fbf07357dc6b93e02c55e Mon Sep 17 00:00:00 2001 From: Lars Hamann Date: Sun, 2 Aug 1998 22:18:20 +0000 Subject: [PATCH] reset drag_pos after abort removed a few unneeded lines fixed compiler Mon Aug 3 00:04:09 1998 Lars Hamann * gtk/gtkclist.c (abort_column_resize): reset drag_pos after abort * gtk/gtkclist.c (gtk_clist_key_press): removed a few unneeded lines * gtk/gtkcombo.c (gtk_combo_list_key_press): fixed compiler warning --- ChangeLog | 6 ++++++ ChangeLog.pre-2-0 | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-2 | 6 ++++++ ChangeLog.pre-2-4 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gtk/gtkclist.c | 38 ++++++++------------------------------ gtk/gtkcombo.c | 2 +- 9 files changed, 51 insertions(+), 31 deletions(-) diff --git a/ChangeLog b/ChangeLog index 31dc9ae342..617ac22e5b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Aug 3 00:04:09 1998 Lars Hamann + + * gtk/gtkclist.c (abort_column_resize): reset drag_pos after abort + * gtk/gtkclist.c (gtk_clist_key_press): removed a few unneeded lines + * gtk/gtkcombo.c (gtk_combo_list_key_press): fixed compiler warning + Sun Aug 2 03:08:07 1998 Owen Taylor * gdk/gdkwindow.c (gdk_window_reparent): Change diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 31dc9ae342..617ac22e5b 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,9 @@ +Mon Aug 3 00:04:09 1998 Lars Hamann + + * gtk/gtkclist.c (abort_column_resize): reset drag_pos after abort + * gtk/gtkclist.c (gtk_clist_key_press): removed a few unneeded lines + * gtk/gtkcombo.c (gtk_combo_list_key_press): fixed compiler warning + Sun Aug 2 03:08:07 1998 Owen Taylor * gdk/gdkwindow.c (gdk_window_reparent): Change diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 31dc9ae342..617ac22e5b 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Mon Aug 3 00:04:09 1998 Lars Hamann + + * gtk/gtkclist.c (abort_column_resize): reset drag_pos after abort + * gtk/gtkclist.c (gtk_clist_key_press): removed a few unneeded lines + * gtk/gtkcombo.c (gtk_combo_list_key_press): fixed compiler warning + Sun Aug 2 03:08:07 1998 Owen Taylor * gdk/gdkwindow.c (gdk_window_reparent): Change diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 31dc9ae342..617ac22e5b 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,9 @@ +Mon Aug 3 00:04:09 1998 Lars Hamann + + * gtk/gtkclist.c (abort_column_resize): reset drag_pos after abort + * gtk/gtkclist.c (gtk_clist_key_press): removed a few unneeded lines + * gtk/gtkcombo.c (gtk_combo_list_key_press): fixed compiler warning + Sun Aug 2 03:08:07 1998 Owen Taylor * gdk/gdkwindow.c (gdk_window_reparent): Change diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 31dc9ae342..617ac22e5b 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Mon Aug 3 00:04:09 1998 Lars Hamann + + * gtk/gtkclist.c (abort_column_resize): reset drag_pos after abort + * gtk/gtkclist.c (gtk_clist_key_press): removed a few unneeded lines + * gtk/gtkcombo.c (gtk_combo_list_key_press): fixed compiler warning + Sun Aug 2 03:08:07 1998 Owen Taylor * gdk/gdkwindow.c (gdk_window_reparent): Change diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 31dc9ae342..617ac22e5b 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Mon Aug 3 00:04:09 1998 Lars Hamann + + * gtk/gtkclist.c (abort_column_resize): reset drag_pos after abort + * gtk/gtkclist.c (gtk_clist_key_press): removed a few unneeded lines + * gtk/gtkcombo.c (gtk_combo_list_key_press): fixed compiler warning + Sun Aug 2 03:08:07 1998 Owen Taylor * gdk/gdkwindow.c (gdk_window_reparent): Change diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 31dc9ae342..617ac22e5b 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Mon Aug 3 00:04:09 1998 Lars Hamann + + * gtk/gtkclist.c (abort_column_resize): reset drag_pos after abort + * gtk/gtkclist.c (gtk_clist_key_press): removed a few unneeded lines + * gtk/gtkcombo.c (gtk_combo_list_key_press): fixed compiler warning + Sun Aug 2 03:08:07 1998 Owen Taylor * gdk/gdkwindow.c (gdk_window_reparent): Change diff --git a/gtk/gtkclist.c b/gtk/gtkclist.c index cbe95622e1..8018e547ad 100644 --- a/gtk/gtkclist.c +++ b/gtk/gtkclist.c @@ -2744,6 +2744,9 @@ gtk_clist_button_press (GtkWidget * widget, for (i = 0; i < clist->columns; i++) if (clist->column[i].window && event->window == clist->column[i].window) { + if (!GTK_WIDGET_HAS_FOCUS (widget)) + gtk_widget_grab_focus (widget); + GTK_CLIST_SET_FLAG (clist, CLIST_IN_DRAG); gtk_widget_get_pointer (widget, &clist->x_drag, NULL); @@ -5513,7 +5516,8 @@ abort_column_resize (GtkCList *clist) GTK_CLIST_UNSET_FLAG (clist, CLIST_IN_DRAG); gtk_grab_remove (GTK_WIDGET (clist)); - gdk_pointer_ungrab (gdk_time_get()); + gdk_pointer_ungrab (GDK_CURRENT_TIME); + clist->drag_pos = -1; if (clist->x_drag >= 0 && clist->x_drag <= clist->clist_window_width - 1) draw_xor_line (clist); @@ -5529,39 +5533,13 @@ static gint gtk_clist_key_press (GtkWidget * widget, GdkEventKey * event) { - GtkCList *clist; - gboolean handled = FALSE; - g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (GTK_IS_CLIST (widget), FALSE); g_return_val_if_fail (event != NULL, FALSE); - clist = GTK_CLIST (widget); - - - if (event->keyval == GDK_Escape && GTK_CLIST_IN_DRAG (clist)) - { - GTK_CLIST_UNSET_FLAG (clist, CLIST_IN_DRAG); - gtk_grab_remove (widget); - gdk_pointer_ungrab (event->time); - - if (clist->x_drag >= 0 && clist->x_drag <= clist->clist_window_width - 1) - draw_xor_line (clist); - - if (GTK_CLIST_ADD_MODE (clist)) - { - gdk_gc_set_line_attributes (clist->xor_gc, 1, GDK_LINE_ON_OFF_DASH, - 0, 0); - gdk_gc_set_dashes (clist->xor_gc, 0, "\4\4", 2); - } - return TRUE; - } - - if (GTK_WIDGET_CLASS (parent_class)->key_press_event) - handled = GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event); - - if (handled) - return handled; + if (GTK_WIDGET_CLASS (parent_class)->key_press_event && + GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event)) + return TRUE; switch (event->keyval) { diff --git a/gtk/gtkcombo.c b/gtk/gtkcombo.c index 03b24e1ecc..a392df9637 100644 --- a/gtk/gtkcombo.c +++ b/gtk/gtkcombo.c @@ -607,7 +607,7 @@ gtk_combo_list_key_press (GtkWidget * widget, GdkEventKey * event, GtkCombo * co { combo->current_button = 0; GTK_BUTTON (combo->button)->in_button = FALSE; - gtk_button_released (combo->button); + gtk_button_released (GTK_BUTTON (combo->button)); gtk_grab_remove (combo->button); } return TRUE;