From 3184f21f0a861119e008869fc00783d292835b32 Mon Sep 17 00:00:00 2001 From: Lars Hamann Date: Mon, 10 Aug 1998 17:56:43 +0000 Subject: [PATCH] Fix for resize bug. Call gtk_widget_size_allocate instead of Sun Aug 9 23:31:59 1998 Lars Hamann * gtk/gtkclist.c (adjust_scrollbars): Fix for resize bug. Call gtk_widget_size_allocate instead of gtk_widget_queue_resize if the visibility state of a scrollbar changes. --- 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 | 33 ++++++++++++++++++--------------- 8 files changed, 60 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0a202c477f..065a49e7e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sun Aug 9 23:31:59 1998 Lars Hamann + + * gtk/gtkclist.c (adjust_scrollbars): Fix for resize bug. Call + gtk_widget_size_allocate instead of gtk_widget_queue_resize + if the visibility state of a scrollbar changes. + Mon Aug 10 12:49:54 1998 Tim Janik * gtk/gtkhbbox.h: fixed an #include statement (reported by Eric Kidd). diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 0a202c477f..065a49e7e2 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,9 @@ +Sun Aug 9 23:31:59 1998 Lars Hamann + + * gtk/gtkclist.c (adjust_scrollbars): Fix for resize bug. Call + gtk_widget_size_allocate instead of gtk_widget_queue_resize + if the visibility state of a scrollbar changes. + Mon Aug 10 12:49:54 1998 Tim Janik * gtk/gtkhbbox.h: fixed an #include statement (reported by Eric Kidd). diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 0a202c477f..065a49e7e2 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Sun Aug 9 23:31:59 1998 Lars Hamann + + * gtk/gtkclist.c (adjust_scrollbars): Fix for resize bug. Call + gtk_widget_size_allocate instead of gtk_widget_queue_resize + if the visibility state of a scrollbar changes. + Mon Aug 10 12:49:54 1998 Tim Janik * gtk/gtkhbbox.h: fixed an #include statement (reported by Eric Kidd). diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 0a202c477f..065a49e7e2 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,9 @@ +Sun Aug 9 23:31:59 1998 Lars Hamann + + * gtk/gtkclist.c (adjust_scrollbars): Fix for resize bug. Call + gtk_widget_size_allocate instead of gtk_widget_queue_resize + if the visibility state of a scrollbar changes. + Mon Aug 10 12:49:54 1998 Tim Janik * gtk/gtkhbbox.h: fixed an #include statement (reported by Eric Kidd). diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 0a202c477f..065a49e7e2 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Sun Aug 9 23:31:59 1998 Lars Hamann + + * gtk/gtkclist.c (adjust_scrollbars): Fix for resize bug. Call + gtk_widget_size_allocate instead of gtk_widget_queue_resize + if the visibility state of a scrollbar changes. + Mon Aug 10 12:49:54 1998 Tim Janik * gtk/gtkhbbox.h: fixed an #include statement (reported by Eric Kidd). diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 0a202c477f..065a49e7e2 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Sun Aug 9 23:31:59 1998 Lars Hamann + + * gtk/gtkclist.c (adjust_scrollbars): Fix for resize bug. Call + gtk_widget_size_allocate instead of gtk_widget_queue_resize + if the visibility state of a scrollbar changes. + Mon Aug 10 12:49:54 1998 Tim Janik * gtk/gtkhbbox.h: fixed an #include statement (reported by Eric Kidd). diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 0a202c477f..065a49e7e2 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Sun Aug 9 23:31:59 1998 Lars Hamann + + * gtk/gtkclist.c (adjust_scrollbars): Fix for resize bug. Call + gtk_widget_size_allocate instead of gtk_widget_queue_resize + if the visibility state of a scrollbar changes. + Mon Aug 10 12:49:54 1998 Tim Janik * gtk/gtkhbbox.h: fixed an #include statement (reported by Eric Kidd). diff --git a/gtk/gtkclist.c b/gtk/gtkclist.c index 5f89745c24..03290d694e 100644 --- a/gtk/gtkclist.c +++ b/gtk/gtkclist.c @@ -2759,24 +2759,25 @@ 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); - gdk_pointer_grab (clist->column[i].window, FALSE, GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON1_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, NULL, NULL, event->time); gtk_grab_add (widget); + GTK_CLIST_SET_FLAG (clist, CLIST_IN_DRAG); + + if (!GTK_WIDGET_HAS_FOCUS (widget)) + gtk_widget_grab_focus (widget); + + clist->drag_pos = i; + clist->x_drag = (COLUMN_LEFT_XPIXEL(clist, i) + COLUMN_INSET + + clist->column[i].area.width + CELL_SPACING); if (GTK_CLIST_ADD_MODE (clist)) gdk_gc_set_line_attributes (clist->xor_gc, 1, GDK_LINE_SOLID, 0, 0); - draw_xor_line (clist); - clist->drag_pos = i; + return FALSE; } @@ -3274,9 +3275,7 @@ gtk_clist_size_allocate (GtkWidget * widget, /* column button allocation */ size_allocate_columns (clist); - - if (GTK_WIDGET_REALIZED (widget)) - size_allocate_title_buttons (clist); + size_allocate_title_buttons (clist); adjust_scrollbars (clist); @@ -4287,7 +4286,8 @@ adjust_scrollbars (GtkCList * clist) if (GTK_WIDGET_VISIBLE (clist->vscrollbar)) { gtk_widget_hide (clist->vscrollbar); - gtk_widget_queue_resize (GTK_WIDGET (clist)); + gtk_widget_size_allocate (GTK_WIDGET (clist), + >K_WIDGET (clist)->allocation); } } else @@ -4295,7 +4295,8 @@ adjust_scrollbars (GtkCList * clist) if (!GTK_WIDGET_VISIBLE (clist->vscrollbar)) { gtk_widget_show (clist->vscrollbar); - gtk_widget_queue_resize (GTK_WIDGET (clist)); + gtk_widget_size_allocate (GTK_WIDGET (clist), + >K_WIDGET (clist)->allocation); } } @@ -4305,7 +4306,8 @@ adjust_scrollbars (GtkCList * clist) if (GTK_WIDGET_VISIBLE (clist->hscrollbar)) { gtk_widget_hide (clist->hscrollbar); - gtk_widget_queue_resize (GTK_WIDGET (clist)); + gtk_widget_size_allocate (GTK_WIDGET (clist), + >K_WIDGET (clist)->allocation); } } else @@ -4313,7 +4315,8 @@ adjust_scrollbars (GtkCList * clist) if (!GTK_WIDGET_VISIBLE (clist->hscrollbar)) { gtk_widget_show (clist->hscrollbar); - gtk_widget_queue_resize (GTK_WIDGET (clist)); + gtk_widget_size_allocate (GTK_WIDGET (clist), + >K_WIDGET (clist)->allocation); } }