diff options
| author | Owen Taylor <otaylor@redhat.com> | 2000-05-18 03:15:08 +0000 |
|---|---|---|
| committer | Owen Taylor <otaylor@src.gnome.org> | 2000-05-18 03:15:08 +0000 |
| commit | b3ea50a7ce14615c6add77e176ccb05481fc7b50 (patch) | |
| tree | 8d948ba3e0eed0d87e646769fb7c14fb291582aa | |
| parent | 7a7faba61aa79b695b85561721c73f5ac773cbbc (diff) | |
| download | gtk+-b3ea50a7ce14615c6add77e176ccb05481fc7b50.tar.gz | |
Set upper to max of allocation and layout size, not just to the layout
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
| -rw-r--r-- | gdk/gdkevents.h | 4 | ||||
| -rw-r--r-- | gdk/gdkwindow.c | 12 | ||||
| -rw-r--r-- | gtk/gtkhscrollbar.c | 5 | ||||
| -rw-r--r-- | gtk/gtklayout.c | 4 | ||||
| -rw-r--r-- | gtk/gtkvscrollbar.c | 5 |
5 files changed, 23 insertions, 7 deletions
diff --git a/gdk/gdkevents.h b/gdk/gdkevents.h index 401ffbfd4b..20536f08bc 100644 --- a/gdk/gdkevents.h +++ b/gdk/gdkevents.h @@ -9,7 +9,9 @@ extern "C" { #endif /* __cplusplus */ -#define GDK_PRIORITY_EVENTS (G_PRIORITY_DEFAULT) +#define GDK_PRIORITY_EVENTS (G_PRIORITY_DEFAULT) +#define GDK_PRIORITY_REDRAW (G_PRIORITY_HIGH_IDLE + 20) + typedef struct _GdkEventAny GdkEventAny; typedef struct _GdkEventExpose GdkEventExpose; diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index 5525f978de..7e18bf2511 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -1080,8 +1080,6 @@ _gdk_window_draw_image (GdkDrawable *drawable, static GSList *update_windows = NULL; static guint update_idle = 0; -#define GDK_PRIORITY_REDRAW (G_PRIORITY_HIGH_IDLE + 20) - static void gdk_window_process_updates_internal (GdkWindow *window) { @@ -1187,11 +1185,21 @@ gdk_window_invalidate_rect (GdkWindow *window, GdkRectangle *rect, gboolean invalidate_children) { + GdkRectangle window_rect; GdkWindowPrivate *private = (GdkWindowPrivate *)window; g_return_if_fail (window != NULL); g_return_if_fail (GDK_IS_WINDOW (window)); + if (!rect) + { + window_rect.x = 0; + window_rect.y = 0; + window_rect.width = private->drawable.width; + window_rect.height = private->drawable.height; + rect = &window_rect; + } + if (private->update_area) { gdk_region_union_with_rect (private->update_area, rect); diff --git a/gtk/gtkhscrollbar.c b/gtk/gtkhscrollbar.c index 9ab5fa875d..c6e69384fc 100644 --- a/gtk/gtkhscrollbar.c +++ b/gtk/gtkhscrollbar.c @@ -418,7 +418,10 @@ gtk_hscrollbar_calc_slider_size (GtkHScrollbar *hscrollbar) gdk_window_get_size (range->slider, &slider_width, &slider_height); if (slider_width != width) - gdk_window_resize (range->slider, width, slider_height); + { + gdk_window_resize (range->slider, width, slider_height); + gdk_window_invalidate_rect (range->slider, NULL, FALSE); + } } } diff --git a/gtk/gtklayout.c b/gtk/gtklayout.c index 7542e17451..cae6bc95fc 100644 --- a/gtk/gtklayout.c +++ b/gtk/gtklayout.c @@ -595,13 +595,13 @@ gtk_layout_size_allocate (GtkWidget *widget, layout->hadjustment->page_size = allocation->width; layout->hadjustment->page_increment = allocation->width / 2; layout->hadjustment->lower = 0; - layout->hadjustment->upper = layout->width; + layout->hadjustment->upper = MAX (allocation->width, layout->width); gtk_signal_emit_by_name (GTK_OBJECT (layout->hadjustment), "changed"); layout->vadjustment->page_size = allocation->height; layout->vadjustment->page_increment = allocation->height / 2; layout->vadjustment->lower = 0; - layout->vadjustment->upper = layout->height; + layout->vadjustment->upper = MAX (allocation->height, layout->height); gtk_signal_emit_by_name (GTK_OBJECT (layout->vadjustment), "changed"); } diff --git a/gtk/gtkvscrollbar.c b/gtk/gtkvscrollbar.c index 082fb746ba..8fab70c22e 100644 --- a/gtk/gtkvscrollbar.c +++ b/gtk/gtkvscrollbar.c @@ -418,7 +418,10 @@ gtk_vscrollbar_calc_slider_size (GtkVScrollbar *vscrollbar) gdk_window_get_size (range->slider, &slider_width, &slider_height); if (slider_height != height) - gdk_window_resize (range->slider, slider_width, height); + { + gdk_window_resize (range->slider, slider_width, height); + gdk_window_invalidate_rect (range->slider, NULL, FALSE); + } } } |
