diff options
author | Owen Taylor <otaylor@redhat.com> | 1999-01-15 16:00:39 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 1999-01-15 16:00:39 +0000 |
commit | 2e99e7713dc73ea5b7a000ab03b4d64176b9ad40 (patch) | |
tree | b53b62d8cc9bf47aa3b9c77015a260eb8fe09b09 | |
parent | 3bba8439685024f9fbfd9d1880da95f4cd9ce09f (diff) | |
download | gdk-pixbuf-2e99e7713dc73ea5b7a000ab03b4d64176b9ad40.tar.gz |
nparams for selection_get should be 3, not 2. [ From Damon Chaplin
Fri Jan 15 10:22:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_class_init):
nparams for selection_get should be 3, not 2.
[ From Damon Chaplin <damon@karuna.freeserve.co.uk> ]
* gtk/gtkeventbox.c (gtk_event_box_paint): Add a paint
routine so queued redraws work inside event boxes.
Thu Jan 14 17:47:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable): Only
redraw character under cursor when not displaying
highlighted selection.
* gdk/gdkrgb.c (gdk_rgb_init): Add in a cast to
gpointer to make IRIX cc happy.
Thu Jan 14 12:29:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcheckbutton.c (gtk_check_button_draw): Restructure
the drawing code to remove a bit of duplication -
and to remove a call to gtk_widget_draw_focus()
that queues a redraw when an expose occurs.
* gtk/gtklabel.c (gtk_label_expose): Fix up handling
of ypadding.
* gtk/gtknotebook.c (gtk_notebook_draw): If we redraw
the whole widget, also redraw the corresponding
areas of the child widget. (have_visible_child
still has some problems)
* gdk/gdkpixmap.c: Change some g_new's to g_new0 so
that fields unused for pixmaps get initialzized
sanely.
* gdk/gdk.h gdk/gdkwindow.c gdk/gdkprivate.h: Add new calls
gdk_window_is_visible() and gdk_window_is_viewable()
and a mapped flag to the window private structure.
* gtk/gtkbin.c gtk/gtkclist.c gtk/gtkfixed.c gtk/gtkitem.c
gtk/gtklayout.c gtk/gtklist.c gtk/gtkmenushell.c
gtk/gtknotebook.c gtk/gtkpaned.c gtk/gtktree.c
gtk/gtktreeitem.c gtk/gtkviewport.c:
Map windows after mapping children.
* gtk/gtkwidget.c (gtk_widget_clip_rect): Handle
rectangles completely clipped away correctly.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Don't
call gtk_widget_draw if width or height is 0.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Don't
rely on GTK_REDRAW_PENDING after we've cleared
it. (This was causing draw-combining to not
happen at all).
* gtk/gtkbin.c gtk/gtkscale.c: Remove uneccessary calls
to gtk_widget_queue_draw() when mapping.
-rw-r--r-- | ChangeLog | 91 | ||||
-rw-r--r-- | ChangeLog.pre-2-0 | 91 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 91 | ||||
-rw-r--r-- | ChangeLog.pre-2-2 | 91 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 91 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 91 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 91 | ||||
-rw-r--r-- | gdk/gdk.h | 9 | ||||
-rw-r--r-- | gdk/gdkpixmap.c | 6 | ||||
-rw-r--r-- | gdk/gdkprivate.h | 1 | ||||
-rw-r--r-- | gdk/gdkrgb.c | 2 | ||||
-rw-r--r-- | gdk/gdkwindow.c | 58 | ||||
-rw-r--r-- | gdk/x11/gdkpixmap-x11.c | 6 | ||||
-rw-r--r-- | gdk/x11/gdkwindow-x11.c | 58 | ||||
-rw-r--r-- | gtk/gtkbin.c | 8 | ||||
-rw-r--r-- | gtk/gtkcheckbutton.c | 55 | ||||
-rw-r--r-- | gtk/gtkclist.c | 8 | ||||
-rw-r--r-- | gtk/gtkentry.c | 5 | ||||
-rw-r--r-- | gtk/gtkeventbox.c | 26 | ||||
-rw-r--r-- | gtk/gtkfixed.c | 4 | ||||
-rw-r--r-- | gtk/gtkhandlebox.c | 12 | ||||
-rw-r--r-- | gtk/gtkitem.c | 4 | ||||
-rw-r--r-- | gtk/gtklabel.c | 2 | ||||
-rw-r--r-- | gtk/gtklayout.c | 7 | ||||
-rw-r--r-- | gtk/gtklist.c | 4 | ||||
-rw-r--r-- | gtk/gtkmenushell.c | 3 | ||||
-rw-r--r-- | gtk/gtknotebook.c | 23 | ||||
-rw-r--r-- | gtk/gtkpaned.c | 4 | ||||
-rw-r--r-- | gtk/gtkscale.c | 3 | ||||
-rw-r--r-- | gtk/gtktree.c | 4 | ||||
-rw-r--r-- | gtk/gtktreeitem.c | 4 | ||||
-rw-r--r-- | gtk/gtkviewport.c | 4 | ||||
-rw-r--r-- | gtk/gtkwidget.c | 40 | ||||
-rw-r--r-- | gtk/testgtkrc | 2 | ||||
-rw-r--r-- | tests/testgtkrc | 2 |
35 files changed, 902 insertions, 99 deletions
@@ -1,3 +1,94 @@ +Fri Jan 15 10:22:21 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkwidget.c (gtk_widget_class_init): + nparams for selection_get should be 3, not 2. + [ From Damon Chaplin <damon@karuna.freeserve.co.uk> ] + + * gtk/gtkeventbox.c (gtk_event_box_paint): Add a paint + routine so queued redraws work inside event boxes. + +Thu Jan 14 17:47:37 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable): Only + redraw character under cursor when not displaying + highlighted selection. + + * gdk/gdkrgb.c (gdk_rgb_init): Add in a cast to + gpointer to make IRIX cc happy. + +Thu Jan 14 12:29:50 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkcheckbutton.c (gtk_check_button_draw): Restructure + the drawing code to remove a bit of duplication - + and to remove a call to gtk_widget_draw_focus() + that queues a redraw when an expose occurs. + + * gtk/gtklabel.c (gtk_label_expose): Fix up handling + of ypadding. + + * gtk/gtknotebook.c (gtk_notebook_draw): If we redraw + the whole widget, also redraw the corresponding + areas of the child widget. (have_visible_child + still has some problems) + + * gdk/gdkpixmap.c: Change some g_new's to g_new0 so + that fields unused for pixmaps get initialzized + sanely. + + * gdk/gdk.h gdk/gdkwindow.c gdk/gdkprivate.h: Add new calls + gdk_window_is_visible() and gdk_window_is_viewable() + and a mapped flag to the window private structure. + + * gtk/gtkbin.c gtk/gtkclist.c gtk/gtkfixed.c gtk/gtkitem.c + gtk/gtklayout.c gtk/gtklist.c gtk/gtkmenushell.c + gtk/gtknotebook.c gtk/gtkpaned.c gtk/gtktree.c + gtk/gtktreeitem.c gtk/gtkviewport.c: + Map windows after mapping children. + + * gtk/gtkwidget.c (gtk_widget_clip_rect): Handle + rectangles completely clipped away correctly. + + * gtk/gtkwidget.c (gtk_widget_idle_draw): Don't + call gtk_widget_draw if width or height is 0. + + * gtk/gtkwidget.c (gtk_widget_idle_draw): Don't + rely on GTK_REDRAW_PENDING after we've cleared + it. (This was causing draw-combining to not + happen at all). + + * gtk/gtkbin.c gtk/gtkscale.c: Remove uneccessary calls + to gtk_widget_queue_draw() when mapping. + +Thu Jan 14 11:29:53 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c (gtk_drag_get_event_action): Make + MOD1-drag also do action ask. + + * gtk/gtkdnd.c (gtk_drag_button_release_cb): Send the + button-release event we simulate to get grabs released, + with a window of GDK_ROOT_PARENT instead of the actual + widget. This is a bad hack in some sense, but seems + to work nicely. (It's sort of like what you would + if you grabbed on button press, then the user + released outside of the widget.) + +Thu Jan 14 20:29:16 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkstyle.[ch] (gtk_style_apply_default_background): + Change copy_area => !set_bg. Use tile instead of + gdk_window_copy_area when drawing without !set_bg. + + This does mess up timj's neat check-button example, + but is consistent with how we interpret background + pixmaps everywhere else in the default scheme. + + Restructure code for clarity. + +Thu Jan 14 19:19:51 1999 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkevents.c: Do all event processing in + dispatch() instead of prepare() and check(). + Wed Jan 13 22:34:29 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkhandlebox.c diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 59534b261..c5c3f2829 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,94 @@ +Fri Jan 15 10:22:21 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkwidget.c (gtk_widget_class_init): + nparams for selection_get should be 3, not 2. + [ From Damon Chaplin <damon@karuna.freeserve.co.uk> ] + + * gtk/gtkeventbox.c (gtk_event_box_paint): Add a paint + routine so queued redraws work inside event boxes. + +Thu Jan 14 17:47:37 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable): Only + redraw character under cursor when not displaying + highlighted selection. + + * gdk/gdkrgb.c (gdk_rgb_init): Add in a cast to + gpointer to make IRIX cc happy. + +Thu Jan 14 12:29:50 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkcheckbutton.c (gtk_check_button_draw): Restructure + the drawing code to remove a bit of duplication - + and to remove a call to gtk_widget_draw_focus() + that queues a redraw when an expose occurs. + + * gtk/gtklabel.c (gtk_label_expose): Fix up handling + of ypadding. + + * gtk/gtknotebook.c (gtk_notebook_draw): If we redraw + the whole widget, also redraw the corresponding + areas of the child widget. (have_visible_child + still has some problems) + + * gdk/gdkpixmap.c: Change some g_new's to g_new0 so + that fields unused for pixmaps get initialzized + sanely. + + * gdk/gdk.h gdk/gdkwindow.c gdk/gdkprivate.h: Add new calls + gdk_window_is_visible() and gdk_window_is_viewable() + and a mapped flag to the window private structure. + + * gtk/gtkbin.c gtk/gtkclist.c gtk/gtkfixed.c gtk/gtkitem.c + gtk/gtklayout.c gtk/gtklist.c gtk/gtkmenushell.c + gtk/gtknotebook.c gtk/gtkpaned.c gtk/gtktree.c + gtk/gtktreeitem.c gtk/gtkviewport.c: + Map windows after mapping children. + + * gtk/gtkwidget.c (gtk_widget_clip_rect): Handle + rectangles completely clipped away correctly. + + * gtk/gtkwidget.c (gtk_widget_idle_draw): Don't + call gtk_widget_draw if width or height is 0. + + * gtk/gtkwidget.c (gtk_widget_idle_draw): Don't + rely on GTK_REDRAW_PENDING after we've cleared + it. (This was causing draw-combining to not + happen at all). + + * gtk/gtkbin.c gtk/gtkscale.c: Remove uneccessary calls + to gtk_widget_queue_draw() when mapping. + +Thu Jan 14 11:29:53 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c (gtk_drag_get_event_action): Make + MOD1-drag also do action ask. + + * gtk/gtkdnd.c (gtk_drag_button_release_cb): Send the + button-release event we simulate to get grabs released, + with a window of GDK_ROOT_PARENT instead of the actual + widget. This is a bad hack in some sense, but seems + to work nicely. (It's sort of like what you would + if you grabbed on button press, then the user + released outside of the widget.) + +Thu Jan 14 20:29:16 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkstyle.[ch] (gtk_style_apply_default_background): + Change copy_area => !set_bg. Use tile instead of + gdk_window_copy_area when drawing without !set_bg. + + This does mess up timj's neat check-button example, + but is consistent with how we interpret background + pixmaps everywhere else in the default scheme. + + Restructure code for clarity. + +Thu Jan 14 19:19:51 1999 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkevents.c: Do all event processing in + dispatch() instead of prepare() and check(). + Wed Jan 13 22:34:29 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkhandlebox.c diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 59534b261..c5c3f2829 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,94 @@ +Fri Jan 15 10:22:21 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkwidget.c (gtk_widget_class_init): + nparams for selection_get should be 3, not 2. + [ From Damon Chaplin <damon@karuna.freeserve.co.uk> ] + + * gtk/gtkeventbox.c (gtk_event_box_paint): Add a paint + routine so queued redraws work inside event boxes. + +Thu Jan 14 17:47:37 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable): Only + redraw character under cursor when not displaying + highlighted selection. + + * gdk/gdkrgb.c (gdk_rgb_init): Add in a cast to + gpointer to make IRIX cc happy. + +Thu Jan 14 12:29:50 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkcheckbutton.c (gtk_check_button_draw): Restructure + the drawing code to remove a bit of duplication - + and to remove a call to gtk_widget_draw_focus() + that queues a redraw when an expose occurs. + + * gtk/gtklabel.c (gtk_label_expose): Fix up handling + of ypadding. + + * gtk/gtknotebook.c (gtk_notebook_draw): If we redraw + the whole widget, also redraw the corresponding + areas of the child widget. (have_visible_child + still has some problems) + + * gdk/gdkpixmap.c: Change some g_new's to g_new0 so + that fields unused for pixmaps get initialzized + sanely. + + * gdk/gdk.h gdk/gdkwindow.c gdk/gdkprivate.h: Add new calls + gdk_window_is_visible() and gdk_window_is_viewable() + and a mapped flag to the window private structure. + + * gtk/gtkbin.c gtk/gtkclist.c gtk/gtkfixed.c gtk/gtkitem.c + gtk/gtklayout.c gtk/gtklist.c gtk/gtkmenushell.c + gtk/gtknotebook.c gtk/gtkpaned.c gtk/gtktree.c + gtk/gtktreeitem.c gtk/gtkviewport.c: + Map windows after mapping children. + + * gtk/gtkwidget.c (gtk_widget_clip_rect): Handle + rectangles completely clipped away correctly. + + * gtk/gtkwidget.c (gtk_widget_idle_draw): Don't + call gtk_widget_draw if width or height is 0. + + * gtk/gtkwidget.c (gtk_widget_idle_draw): Don't + rely on GTK_REDRAW_PENDING after we've cleared + it. (This was causing draw-combining to not + happen at all). + + * gtk/gtkbin.c gtk/gtkscale.c: Remove uneccessary calls + to gtk_widget_queue_draw() when mapping. + +Thu Jan 14 11:29:53 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c (gtk_drag_get_event_action): Make + MOD1-drag also do action ask. + + * gtk/gtkdnd.c (gtk_drag_button_release_cb): Send the + button-release event we simulate to get grabs released, + with a window of GDK_ROOT_PARENT instead of the actual + widget. This is a bad hack in some sense, but seems + to work nicely. (It's sort of like what you would + if you grabbed on button press, then the user + released outside of the widget.) + +Thu Jan 14 20:29:16 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkstyle.[ch] (gtk_style_apply_default_background): + Change copy_area => !set_bg. Use tile instead of + gdk_window_copy_area when drawing without !set_bg. + + This does mess up timj's neat check-button example, + but is consistent with how we interpret background + pixmaps everywhere else in the default scheme. + + Restructure code for clarity. + +Thu Jan 14 19:19:51 1999 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkevents.c: Do all event processing in + dispatch() instead of prepare() and check(). + Wed Jan 13 22:34:29 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkhandlebox.c diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 59534b261..c5c3f2829 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,94 @@ +Fri Jan 15 10:22:21 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkwidget.c (gtk_widget_class_init): + nparams for selection_get should be 3, not 2. + [ From Damon Chaplin <damon@karuna.freeserve.co.uk> ] + + * gtk/gtkeventbox.c (gtk_event_box_paint): Add a paint + routine so queued redraws work inside event boxes. + +Thu Jan 14 17:47:37 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable): Only + redraw character under cursor when not displaying + highlighted selection. + + * gdk/gdkrgb.c (gdk_rgb_init): Add in a cast to + gpointer to make IRIX cc happy. + +Thu Jan 14 12:29:50 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkcheckbutton.c (gtk_check_button_draw): Restructure + the drawing code to remove a bit of duplication - + and to remove a call to gtk_widget_draw_focus() + that queues a redraw when an expose occurs. + + * gtk/gtklabel.c (gtk_label_expose): Fix up handling + of ypadding. + + * gtk/gtknotebook.c (gtk_notebook_draw): If we redraw + the whole widget, also redraw the corresponding + areas of the child widget. (have_visible_child + still has some problems) + + * gdk/gdkpixmap.c: Change some g_new's to g_new0 so + that fields unused for pixmaps get initialzized + sanely. + + * gdk/gdk.h gdk/gdkwindow.c gdk/gdkprivate.h: Add new calls + gdk_window_is_visible() and gdk_window_is_viewable() + and a mapped flag to the window private structure. + + * gtk/gtkbin.c gtk/gtkclist.c gtk/gtkfixed.c gtk/gtkitem.c + gtk/gtklayout.c gtk/gtklist.c gtk/gtkmenushell.c + gtk/gtknotebook.c gtk/gtkpaned.c gtk/gtktree.c + gtk/gtktreeitem.c gtk/gtkviewport.c: + Map windows after mapping children. + + * gtk/gtkwidget.c (gtk_widget_clip_rect): Handle + rectangles completely clipped away correctly. + + * gtk/gtkwidget.c (gtk_widget_idle_draw): Don't + call gtk_widget_draw if width or height is 0. + + * gtk/gtkwidget.c (gtk_widget_idle_draw): Don't + rely on GTK_REDRAW_PENDING after we've cleared + it. (This was causing draw-combining to not + happen at all). + + * gtk/gtkbin.c gtk/gtkscale.c: Remove uneccessary calls + to gtk_widget_queue_draw() when mapping. + +Thu Jan 14 11:29:53 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c (gtk_drag_get_event_action): Make + MOD1-drag also do action ask. + + * gtk/gtkdnd.c (gtk_drag_button_release_cb): Send the + button-release event we simulate to get grabs released, + with a window of GDK_ROOT_PARENT instead of the actual + widget. This is a bad hack in some sense, but seems + to work nicely. (It's sort of like what you would + if you grabbed on button press, then the user + released outside of the widget.) + +Thu Jan 14 20:29:16 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkstyle.[ch] (gtk_style_apply_default_background): + Change copy_area => !set_bg. Use tile instead of + gdk_window_copy_area when drawing without !set_bg. + + This does mess up timj's neat check-button example, + but is consistent with how we interpret background + pixmaps everywhere else in the default scheme. + + Restructure code for clarity. + +Thu Jan 14 19:19:51 1999 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkevents.c: Do all event processing in + dispatch() instead of prepare() and check(). + Wed Jan 13 22:34:29 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkhandlebox.c diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 59534b261..c5c3f2829 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,94 @@ +Fri Jan 15 10:22:21 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkwidget.c (gtk_widget_class_init): + nparams for selection_get should be 3, not 2. + [ From Damon Chaplin <damon@karuna.freeserve.co.uk> ] + + * gtk/gtkeventbox.c (gtk_event_box_paint): Add a paint + routine so queued redraws work inside event boxes. + +Thu Jan 14 17:47:37 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable): Only + redraw character under cursor when not displaying + highlighted selection. + + * gdk/gdkrgb.c (gdk_rgb_init): Add in a cast to + gpointer to make IRIX cc happy. + +Thu Jan 14 12:29:50 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkcheckbutton.c (gtk_check_button_draw): Restructure + the drawing code to remove a bit of duplication - + and to remove a call to gtk_widget_draw_focus() + that queues a redraw when an expose occurs. + + * gtk/gtklabel.c (gtk_label_expose): Fix up handling + of ypadding. + + * gtk/gtknotebook.c (gtk_notebook_draw): If we redraw + the whole widget, also redraw the corresponding + areas of the child widget. (have_visible_child + still has some problems) + + * gdk/gdkpixmap.c: Change some g_new's to g_new0 so + that fields unused for pixmaps get initialzized + sanely. + + * gdk/gdk.h gdk/gdkwindow.c gdk/gdkprivate.h: Add new calls + gdk_window_is_visible() and gdk_window_is_viewable() + and a mapped flag to the window private structure. + + * gtk/gtkbin.c gtk/gtkclist.c gtk/gtkfixed.c gtk/gtkitem.c + gtk/gtklayout.c gtk/gtklist.c gtk/gtkmenushell.c + gtk/gtknotebook.c gtk/gtkpaned.c gtk/gtktree.c + gtk/gtktreeitem.c gtk/gtkviewport.c: + Map windows after mapping children. + + * gtk/gtkwidget.c (gtk_widget_clip_rect): Handle + rectangles completely clipped away correctly. + + * gtk/gtkwidget.c (gtk_widget_idle_draw): Don't + call gtk_widget_draw if width or height is 0. + + * gtk/gtkwidget.c (gtk_widget_idle_draw): Don't + rely on GTK_REDRAW_PENDING after we've cleared + it. (This was causing draw-combining to not + happen at all). + + * gtk/gtkbin.c gtk/gtkscale.c: Remove uneccessary calls + to gtk_widget_queue_draw() when mapping. + +Thu Jan 14 11:29:53 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c (gtk_drag_get_event_action): Make + MOD1-drag also do action ask. + + * gtk/gtkdnd.c (gtk_drag_button_release_cb): Send the + button-release event we simulate to get grabs released, + with a window of GDK_ROOT_PARENT instead of the actual + widget. This is a bad hack in some sense, but seems + to work nicely. (It's sort of like what you would + if you grabbed on button press, then the user + released outside of the widget.) + +Thu Jan 14 20:29:16 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkstyle.[ch] (gtk_style_apply_default_background): + Change copy_area => !set_bg. Use tile instead of + gdk_window_copy_area when drawing without !set_bg. + + This does mess up timj's neat check-button example, + but is consistent with how we interpret background + pixmaps everywhere else in the default scheme. + + Restructure code for clarity. + +Thu Jan 14 19:19:51 1999 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkevents.c: Do all event processing in + dispatch() instead of prepare() and check(). + Wed Jan 13 22:34:29 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkhandlebox.c diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 59534b261..c5c3f2829 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,94 @@ +Fri Jan 15 10:22:21 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkwidget.c (gtk_widget_class_init): + nparams for selection_get should be 3, not 2. + [ From Damon Chaplin <damon@karuna.freeserve.co.uk> ] + + * gtk/gtkeventbox.c (gtk_event_box_paint): Add a paint + routine so queued redraws work inside event boxes. + +Thu Jan 14 17:47:37 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable): Only + redraw character under cursor when not displaying + highlighted selection. + + * gdk/gdkrgb.c (gdk_rgb_init): Add in a cast to + gpointer to make IRIX cc happy. + +Thu Jan 14 12:29:50 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkcheckbutton.c (gtk_check_button_draw): Restructure + the drawing code to remove a bit of duplication - + and to remove a call to gtk_widget_draw_focus() + that queues a redraw when an expose occurs. + + * gtk/gtklabel.c (gtk_label_expose): Fix up handling + of ypadding. + + * gtk/gtknotebook.c (gtk_notebook_draw): If we redraw + the whole widget, also redraw the corresponding + areas of the child widget. (have_visible_child + still has some problems) + + * gdk/gdkpixmap.c: Change some g_new's to g_new0 so + that fields unused for pixmaps get initialzized + sanely. + + * gdk/gdk.h gdk/gdkwindow.c gdk/gdkprivate.h: Add new calls + gdk_window_is_visible() and gdk_window_is_viewable() + and a mapped flag to the window private structure. + + * gtk/gtkbin.c gtk/gtkclist.c gtk/gtkfixed.c gtk/gtkitem.c + gtk/gtklayout.c gtk/gtklist.c gtk/gtkmenushell.c + gtk/gtknotebook.c gtk/gtkpaned.c gtk/gtktree.c + gtk/gtktreeitem.c gtk/gtkviewport.c: + Map windows after mapping children. + + * gtk/gtkwidget.c (gtk_widget_clip_rect): Handle + rectangles completely clipped away correctly. + + * gtk/gtkwidget.c (gtk_widget_idle_draw): Don't + call gtk_widget_draw if width or height is 0. + + * gtk/gtkwidget.c (gtk_widget_idle_draw): Don't + rely on GTK_REDRAW_PENDING after we've cleared + it. (This was causing draw-combining to not + happen at all). + + * gtk/gtkbin.c gtk/gtkscale.c: Remove uneccessary calls + to gtk_widget_queue_draw() when mapping. + +Thu Jan 14 11:29:53 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c (gtk_drag_get_event_action): Make + MOD1-drag also do action ask. + + * gtk/gtkdnd.c (gtk_drag_button_release_cb): Send the + button-release event we simulate to get grabs released, + with a window of GDK_ROOT_PARENT instead of the actual + widget. This is a bad hack in some sense, but seems + to work nicely. (It's sort of like what you would + if you grabbed on button press, then the user + released outside of the widget.) + +Thu Jan 14 20:29:16 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkstyle.[ch] (gtk_style_apply_default_background): + Change copy_area => !set_bg. Use tile instead of + gdk_window_copy_area when drawing without !set_bg. + + This does mess up timj's neat check-button example, + but is consistent with how we interpret background + pixmaps everywhere else in the default scheme. + + Restructure code for clarity. + +Thu Jan 14 19:19:51 1999 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkevents.c: Do all event processing in + dispatch() instead of prepare() and check(). + Wed Jan 13 22:34:29 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkhandlebox.c diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 59534b261..c5c3f2829 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,94 @@ +Fri Jan 15 10:22:21 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkwidget.c (gtk_widget_class_init): + nparams for selection_get should be 3, not 2. + [ From Damon Chaplin <damon@karuna.freeserve.co.uk> ] + + * gtk/gtkeventbox.c (gtk_event_box_paint): Add a paint + routine so queued redraws work inside event boxes. + +Thu Jan 14 17:47:37 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable): Only + redraw character under cursor when not displaying + highlighted selection. + + * gdk/gdkrgb.c (gdk_rgb_init): Add in a cast to + gpointer to make IRIX cc happy. + +Thu Jan 14 12:29:50 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkcheckbutton.c (gtk_check_button_draw): Restructure + the drawing code to remove a bit of duplication - + and to remove a call to gtk_widget_draw_focus() + that queues a redraw when an expose occurs. + + * gtk/gtklabel.c (gtk_label_expose): Fix up handling + of ypadding. + + * gtk/gtknotebook.c (gtk_notebook_draw): If we redraw + the whole widget, also redraw the corresponding + areas of the child widget. (have_visible_child + still has some problems) + + * gdk/gdkpixmap.c: Change some g_new's to g_new0 so + that fields unused for pixmaps get initialzized + sanely. + + * gdk/gdk.h gdk/gdkwindow.c gdk/gdkprivate.h: Add new calls + gdk_window_is_visible() and gdk_window_is_viewable() + and a mapped flag to the window private structure. + + * gtk/gtkbin.c gtk/gtkclist.c gtk/gtkfixed.c gtk/gtkitem.c + gtk/gtklayout.c gtk/gtklist.c gtk/gtkmenushell.c + gtk/gtknotebook.c gtk/gtkpaned.c gtk/gtktree.c + gtk/gtktreeitem.c gtk/gtkviewport.c: + Map windows after mapping children. + + * gtk/gtkwidget.c (gtk_widget_clip_rect): Handle + rectangles completely clipped away correctly. + + * gtk/gtkwidget.c (gtk_widget_idle_draw): Don't + call gtk_widget_draw if width or height is 0. + + * gtk/gtkwidget.c (gtk_widget_idle_draw): Don't + rely on GTK_REDRAW_PENDING after we've cleared + it. (This was causing draw-combining to not + happen at all). + + * gtk/gtkbin.c gtk/gtkscale.c: Remove uneccessary calls + to gtk_widget_queue_draw() when mapping. + +Thu Jan 14 11:29:53 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkdnd.c (gtk_drag_get_event_action): Make + MOD1-drag also do action ask. + + * gtk/gtkdnd.c (gtk_drag_button_release_cb): Send the + button-release event we simulate to get grabs released, + with a window of GDK_ROOT_PARENT instead of the actual + widget. This is a bad hack in some sense, but seems + to work nicely. (It's sort of like what you would + if you grabbed on button press, then the user + released outside of the widget.) + +Thu Jan 14 20:29:16 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkstyle.[ch] (gtk_style_apply_default_background): + Change copy_area => !set_bg. Use tile instead of + gdk_window_copy_area when drawing without !set_bg. + + This does mess up timj's neat check-button example, + but is consistent with how we interpret background + pixmaps everywhere else in the default scheme. + + Restructure code for clarity. + +Thu Jan 14 19:19:51 1999 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkevents.c: Do all event processing in + dispatch() instead of prepare() and check(). + Wed Jan 13 22:34:29 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkhandlebox.c @@ -219,6 +219,15 @@ void gdk_window_set_child_shapes (GdkWindow *window); void gdk_window_merge_child_shapes (GdkWindow *window); /* + * Check if a window has been shown, and whether all it's + * parents up to a toplevel have been shown, respectively. + * Note that a window that is_viewable below is not necessarily + * viewable in the X sense. + */ +gboolean gdk_window_is_visible (GdkWindow *window); +gboolean gdk_window_is_viewable (GdkWindow *window); + +/* * The following function adds a global filter for all client * messages of type message_type */ diff --git a/gdk/gdkpixmap.c b/gdk/gdkpixmap.c index f76e097d3..8df3145d7 100644 --- a/gdk/gdkpixmap.c +++ b/gdk/gdkpixmap.c @@ -64,7 +64,7 @@ gdk_pixmap_new (GdkWindow *window, if (depth == -1) depth = gdk_window_get_visual (window)->depth; - private = g_new (GdkWindowPrivate, 1); + private = g_new0 (GdkWindowPrivate, 1); pixmap = (GdkPixmap*) private; private->xdisplay = window_private->xdisplay; @@ -106,7 +106,7 @@ gdk_bitmap_create_from_data (GdkWindow *window, if (window_private->destroyed) return NULL; - private = g_new (GdkWindowPrivate, 1); + private = g_new0 (GdkWindowPrivate, 1); pixmap = (GdkPixmap*) private; private->parent = NULL; @@ -158,7 +158,7 @@ gdk_pixmap_create_from_data (GdkWindow *window, if (depth == -1) depth = gdk_window_get_visual (window)->depth; - private = g_new (GdkWindowPrivate, 1); + private = g_new0 (GdkWindowPrivate, 1); pixmap = (GdkPixmap*) private; private->parent = NULL; diff --git a/gdk/gdkprivate.h b/gdk/gdkprivate.h index bc971a097..42b6a5ea4 100644 --- a/gdk/gdkprivate.h +++ b/gdk/gdkprivate.h @@ -63,6 +63,7 @@ struct _GdkWindowPrivate guint8 window_type; guint ref_count; guint destroyed : 2; + guint mapped : 1; gint extension_events; diff --git a/gdk/gdkrgb.c b/gdk/gdkrgb.c index 542e61d37..51c14399a 100644 --- a/gdk/gdkrgb.c +++ b/gdk/gdkrgb.c @@ -642,7 +642,7 @@ gdk_rgb_init (void) if (image_info->bitmap) /* Use malloc() instead of g_malloc since X will free() this mem */ static_image[i] = gdk_image_new_bitmap (image_info->visual, - malloc (IMAGE_WIDTH * IMAGE_HEIGHT >> 3), + (gpointer) malloc (IMAGE_WIDTH * IMAGE_HEIGHT >> 3), IMAGE_WIDTH, IMAGE_HEIGHT); else static_image[i] = gdk_image_new (GDK_IMAGE_FASTEST, diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index b0931484b..56e8cdfb8 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -277,6 +277,7 @@ gdk_window_new (GdkWindow *parent, private->xdisplay = parent_display; private->destroyed = FALSE; + private->mapped = FALSE; private->resize_count = 0; private->ref_count = 1; xattributes_mask = 0; @@ -511,6 +512,7 @@ gdk_window_foreign_new (guint32 anid) private->ref_count = 1; private->window_type = GDK_WINDOW_FOREIGN; private->destroyed = FALSE; + private->mapped = (attrs.map_state != IsUnmapped); private->extension_events = 0; private->colormap = NULL; @@ -716,6 +718,7 @@ gdk_window_show (GdkWindow *window) private = (GdkWindowPrivate*) window; if (!private->destroyed) { + private->mapped = TRUE; XRaiseWindow (private->xdisplay, private->xwindow); XMapWindow (private->xdisplay, private->xwindow); } @@ -730,7 +733,10 @@ gdk_window_hide (GdkWindow *window) private = (GdkWindowPrivate*) window; if (!private->destroyed) - XUnmapWindow (private->xdisplay, private->xwindow); + { + private->mapped = FALSE; + XUnmapWindow (private->xdisplay, private->xwindow); + } } void @@ -2470,6 +2476,55 @@ gdk_window_merge_child_shapes (GdkWindow *window) #endif } +/************************************************************* + * gdk_window_is_visible: + * Check if the given window is mapped. + * arguments: + * window: + * results: + * is the window mapped + *************************************************************/ + +gboolean +gdk_window_is_visible (GdkWindow *window) +{ + GdkWindowPrivate *private = (GdkWindowPrivate *)window; + + g_return_val_if_fail (window != NULL, FALSE); + + return private->mapped; +} + +/************************************************************* + * gdk_window_is_viewable: + * Check if the window and all ancestors of the window + * are mapped. (This is not necessarily "viewable" in + * the X sense, since we only check as far as we have + * GDK window parents, not to the root window) + * arguments: + * window: + * results: + * is the window viewable + *************************************************************/ + +gboolean +gdk_window_is_viewable (GdkWindow *window) +{ + GdkWindowPrivate *private = (GdkWindowPrivate *)window; + + g_return_val_if_fail (window != NULL, FALSE); + + while (private && (private != &gdk_root_parent)) + { + if (!private->mapped) + return FALSE; + + private = (GdkWindowPrivate *)private->parent; + } + + return TRUE; +} + void gdk_drawable_set_data (GdkDrawable *drawable, const gchar *key, @@ -2479,3 +2534,4 @@ gdk_drawable_set_data (GdkDrawable *drawable, g_dataset_set_data_full (drawable, key, data, destroy_func); } + diff --git a/gdk/x11/gdkpixmap-x11.c b/gdk/x11/gdkpixmap-x11.c index f76e097d3..8df3145d7 100644 --- a/gdk/x11/gdkpixmap-x11.c +++ b/gdk/x11/gdkpixmap-x11.c @@ -64,7 +64,7 @@ gdk_pixmap_new (GdkWindow *window, if (depth == -1) depth = gdk_window_get_visual (window)->depth; - private = g_new (GdkWindowPrivate, 1); + private = g_new0 (GdkWindowPrivate, 1); pixmap = (GdkPixmap*) private; private->xdisplay = window_private->xdisplay; @@ -106,7 +106,7 @@ gdk_bitmap_create_from_data (GdkWindow *window, if (window_private->destroyed) return NULL; - private = g_new (GdkWindowPrivate, 1); + private = g_new0 (GdkWindowPrivate, 1); pixmap = (GdkPixmap*) private; private->parent = NULL; @@ -158,7 +158,7 @@ gdk_pixmap_create_from_data (GdkWindow *window, if (depth == -1) depth = gdk_window_get_visual (window)->depth; - private = g_new (GdkWindowPrivate, 1); + private = g_new0 (GdkWindowPrivate, 1); pixmap = (GdkPixmap*) private; private->parent = NULL; diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index b0931484b..56e8cdfb8 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -277,6 +277,7 @@ gdk_window_new (GdkWindow *parent, private->xdisplay = parent_display; private->destroyed = FALSE; + private->mapped = FALSE; private->resize_count = 0; private->ref_count = 1; xattributes_mask = 0; @@ -511,6 +512,7 @@ gdk_window_foreign_new (guint32 anid) private->ref_count = 1; private->window_type = GDK_WINDOW_FOREIGN; private->destroyed = FALSE; + private->mapped = (attrs.map_state != IsUnmapped); private->extension_events = 0; private->colormap = NULL; @@ -716,6 +718,7 @@ gdk_window_show (GdkWindow *window) private = (GdkWindowPrivate*) window; if (!private->destroyed) { + private->mapped = TRUE; XRaiseWindow (private->xdisplay, private->xwindow); XMapWindow (private->xdisplay, private->xwindow); } @@ -730,7 +733,10 @@ gdk_window_hide (GdkWindow *window) private = (GdkWindowPrivate*) window; if (!private->destroyed) - XUnmapWindow (private->xdisplay, private->xwindow); + { + private->mapped = FALSE; + XUnmapWindow (private->xdisplay, private->xwindow); + } } void @@ -2470,6 +2476,55 @@ gdk_window_merge_child_shapes (GdkWindow *window) #endif } +/************************************************************* + * gdk_window_is_visible: + * Check if the given window is mapped. + * arguments: + * window: + * results: + * is the window mapped + *************************************************************/ + +gboolean +gdk_window_is_visible (GdkWindow *window) +{ + GdkWindowPrivate *private = (GdkWindowPrivate *)window; + + g_return_val_if_fail (window != NULL, FALSE); + + return private->mapped; +} + +/************************************************************* + * gdk_window_is_viewable: + * Check if the window and all ancestors of the window + * are mapped. (This is not necessarily "viewable" in + * the X sense, since we only check as far as we have + * GDK window parents, not to the root window) + * arguments: + * window: + * results: + * is the window viewable + *************************************************************/ + +gboolean +gdk_window_is_viewable (GdkWindow *window) +{ + GdkWindowPrivate *private = (GdkWindowPrivate *)window; + + g_return_val_if_fail (window != NULL, FALSE); + + while (private && (private != &gdk_root_parent)) + { + if (!private->mapped) + return FALSE; + + private = (GdkWindowPrivate *)private->parent; + } + + return TRUE; +} + void gdk_drawable_set_data (GdkDrawable *drawable, const gchar *key, @@ -2479,3 +2534,4 @@ gdk_drawable_set_data (GdkDrawable *drawable, g_dataset_set_data_full (drawable, key, data, destroy_func); } + diff --git a/gtk/gtkbin.c b/gtk/gtkbin.c index 30d60fbc3..b5e5005fe 100644 --- a/gtk/gtkbin.c +++ b/gtk/gtkbin.c @@ -119,15 +119,13 @@ gtk_bin_map (GtkWidget *widget) GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED); bin = GTK_BIN (widget); - if (!GTK_WIDGET_NO_WINDOW (widget)) - gdk_window_show (widget->window); - else - gtk_widget_queue_draw (widget); - if (bin->child && GTK_WIDGET_VISIBLE (bin->child) && !GTK_WIDGET_MAPPED (bin->child)) gtk_widget_map (bin->child); + + if (!GTK_WIDGET_NO_WINDOW (widget)) + gdk_window_show (widget->window); } static void diff --git a/gtk/gtkcheckbutton.c b/gtk/gtkcheckbutton.c index b77a373b9..1e69eb56d 100644 --- a/gtk/gtkcheckbutton.c +++ b/gtk/gtkcheckbutton.c @@ -37,6 +37,8 @@ static void gtk_check_button_size_allocate (GtkWidget *widget, GtkAllocation *allocation); static gint gtk_check_button_expose (GtkWidget *widget, GdkEventExpose *event); +static void gtk_check_button_paint (GtkWidget *widget, + GdkRectangle *area); static void gtk_check_button_draw_indicator (GtkCheckButton *check_button, GdkRectangle *area); static void gtk_real_check_button_draw_indicator (GtkCheckButton *check_button, @@ -119,6 +121,37 @@ gtk_check_button_new_with_label (const gchar *label) return check_button; } +/* This should only be called when toggle_button->draw_indicator + * is true. + */ +static void +gtk_check_button_paint (GtkWidget *widget, + GdkRectangle *area) +{ + GtkCheckButton *check_button; + + g_return_if_fail (widget != NULL); + g_return_if_fail (GTK_IS_CHECK_BUTTON (widget)); + + check_button = GTK_CHECK_BUTTON (widget); + + if (GTK_WIDGET_DRAWABLE (widget)) + { + gint border_width; + + gtk_check_button_draw_indicator (check_button, area); + + border_width = GTK_CONTAINER (widget)->border_width; + if (GTK_WIDGET_HAS_FOCUS (widget)) + gtk_paint_focus (widget->style, widget->window, + NULL, widget, "checkbutton", + border_width + widget->allocation.x, + border_width + widget->allocation.y, + widget->allocation.width - 2 * border_width - 1, + widget->allocation.height - 2 * border_width - 1); + } +} + static void gtk_check_button_draw (GtkWidget *widget, GdkRectangle *area) @@ -140,21 +173,9 @@ gtk_check_button_draw (GtkWidget *widget, { if (toggle_button->draw_indicator) { - gint border_width; - - gtk_check_button_draw_indicator (check_button, area); - - border_width = GTK_CONTAINER (widget)->border_width; - if (GTK_WIDGET_HAS_FOCUS (widget)) - gtk_paint_focus (widget->style, widget->window, - NULL, widget, "checkbutton", - border_width + widget->allocation.x, - border_width + widget->allocation.y, - widget->allocation.width - 2 * border_width - 1, - widget->allocation.height - 2 * border_width - 1); - - if (bin->child && GTK_WIDGET_NO_WINDOW (bin->child) && - gtk_widget_intersect (bin->child, area, &child_area)) + gtk_check_button_paint (widget, area); + + if (bin->child && gtk_widget_intersect (bin->child, area, &child_area)) gtk_widget_draw (bin->child, &child_area); } else @@ -280,14 +301,12 @@ gtk_check_button_expose (GtkWidget *widget, { if (toggle_button->draw_indicator) { - gtk_check_button_draw_indicator (check_button, &event->area); + gtk_check_button_paint (widget, &event->area); child_event = *event; if (bin->child && GTK_WIDGET_NO_WINDOW (bin->child) && gtk_widget_intersect (bin->child, &event->area, &child_event.area)) gtk_widget_event (bin->child, (GdkEvent*) &child_event); - - gtk_widget_draw_focus (widget); } else { diff --git a/gtk/gtkclist.c b/gtk/gtkclist.c index 0a0e176d5..c6cbcc7a0 100644 --- a/gtk/gtkclist.c +++ b/gtk/gtkclist.c @@ -4615,10 +4615,6 @@ gtk_clist_map (GtkWidget *widget) { GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED); - gdk_window_show (widget->window); - gdk_window_show (clist->title_window); - gdk_window_show (clist->clist_window); - /* map column buttons */ for (i = 0; i < clist->columns; i++) if (clist->column[i].button && @@ -4631,6 +4627,10 @@ gtk_clist_map (GtkWidget *widget) if (clist->column[i].window && clist->column[i].button) gdk_window_show (clist->column[i].window); + gdk_window_show (clist->title_window); + gdk_window_show (clist->clist_window); + gdk_window_show (widget->window); + /* unfreeze the list */ clist->freeze_count = 0; } diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index cdb06877f..67cf4624f 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -1457,12 +1457,13 @@ gtk_entry_draw_cursor_on_drawable (GtkEntry *entry, GdkDrawable *drawable) /* Draw the character under the cursor again */ - if (editable->current_pos < entry->text_length) + if ((editable->current_pos < entry->text_length) && + (editable->selection_start_pos == editable->selection_end_pos)) gdk_draw_text_wc (drawable, widget->style->font, widget->style->fg_gc[GTK_WIDGET_STATE (widget)], xoffset, yoffset, entry->text + editable->current_pos, 1); - } + } #ifdef USE_XIM diff --git a/gtk/gtkeventbox.c b/gtk/gtkeventbox.c index c4dccd925..3880a050a 100644 --- a/gtk/gtkeventbox.c +++ b/gtk/gtkeventbox.c @@ -27,10 +27,12 @@ static void gtk_event_box_size_request (GtkWidget *widget, GtkRequisition *requisition); static void gtk_event_box_size_allocate (GtkWidget *widget, GtkAllocation *allocation); -static void gtk_event_box_draw (GtkWidget *widget, - GdkRectangle *area); -static gint gtk_event_box_expose (GtkWidget *widget, - GdkEventExpose *event); +static void gtk_event_box_paint (GtkWidget *widget, + GdkRectangle *area); +static void gtk_event_box_draw (GtkWidget *widget, + GdkRectangle *area); +static gint gtk_event_box_expose (GtkWidget *widget, + GdkEventExpose *event); GtkType @@ -182,8 +184,18 @@ gtk_event_box_size_allocate (GtkWidget *widget, } static void +gtk_event_box_paint (GtkWidget *widget, + GdkRectangle *area) +{ + gtk_paint_flat_box (widget->style, widget->window, + widget->state, GTK_SHADOW_NONE, + area, widget, "eventbox", + 0, 0, -1, -1); +} + +static void gtk_event_box_draw (GtkWidget *widget, - GdkRectangle *area) + GdkRectangle *area) { GtkBin *bin; GdkRectangle tmp_area; @@ -198,6 +210,8 @@ gtk_event_box_draw (GtkWidget *widget, tmp_area = *area; tmp_area.x -= GTK_CONTAINER (widget)->border_width; tmp_area.y -= GTK_CONTAINER (widget)->border_width; + + gtk_event_box_paint (widget, &tmp_area); if (bin->child) { @@ -222,6 +236,8 @@ gtk_event_box_expose (GtkWidget *widget, { bin = GTK_BIN (widget); + gtk_event_box_paint (widget, &event->area); + child_event = *event; if (bin->child && GTK_WIDGET_NO_WINDOW (bin->child) && diff --git a/gtk/gtkfixed.c b/gtk/gtkfixed.c index 8e51bb2e6..ef75f7728 100644 --- a/gtk/gtkfixed.c +++ b/gtk/gtkfixed.c @@ -197,8 +197,6 @@ gtk_fixed_map (GtkWidget *widget) GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED); fixed = GTK_FIXED (widget); - gdk_window_show (widget->window); - children = fixed->children; while (children) { @@ -209,6 +207,8 @@ gtk_fixed_map (GtkWidget *widget) !GTK_WIDGET_MAPPED (child->widget)) gtk_widget_map (child->widget); } + + gdk_window_show (widget->window); } static void diff --git a/gtk/gtkhandlebox.c b/gtk/gtkhandlebox.c index de0f01250..ff72ce08d 100644 --- a/gtk/gtkhandlebox.c +++ b/gtk/gtkhandlebox.c @@ -259,8 +259,10 @@ gtk_handle_box_map (GtkWidget *widget) bin = GTK_BIN (widget); hb = GTK_HANDLE_BOX (widget); - gdk_window_show (hb->bin_window); - gdk_window_show (widget->window); + if (bin->child && + GTK_WIDGET_VISIBLE (bin->child) && + !GTK_WIDGET_MAPPED (bin->child)) + gtk_widget_map (bin->child); if (hb->child_detached && !hb->float_window_mapped) { @@ -268,10 +270,8 @@ gtk_handle_box_map (GtkWidget *widget) hb->float_window_mapped = TRUE; } - if (bin->child && - GTK_WIDGET_VISIBLE (bin->child) && - !GTK_WIDGET_MAPPED (bin->child)) - gtk_widget_map (bin->child); + gdk_window_show (hb->bin_window); + gdk_window_show (widget->window); } static void diff --git a/gtk/gtkitem.c b/gtk/gtkitem.c index febdff8a7..92547af4a 100644 --- a/gtk/gtkitem.c +++ b/gtk/gtkitem.c @@ -147,14 +147,14 @@ gtk_item_map (GtkWidget *widget) GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED); - gdk_window_show (widget->window); - bin = GTK_BIN (widget); if (bin->child && GTK_WIDGET_VISIBLE (bin->child) && !GTK_WIDGET_MAPPED (bin->child)) gtk_widget_map (bin->child); + + gdk_window_show (widget->window); } static void diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index 0c53fa73f..13e9679fb 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -929,7 +929,7 @@ gtk_label_expose (GtkWidget *widget, y = (widget->allocation.y + (widget->allocation.height - - widget->requisition.height - 2 * misc->ypad) * misc->yalign + - widget->requisition.height) * misc->yalign + misc->ypad + 0.5); for (word = label->words; word; word = word->next) { diff --git a/gtk/gtklayout.c b/gtk/gtklayout.c index e2616f1dd..e56b3eeea 100644 --- a/gtk/gtklayout.c +++ b/gtk/gtklayout.c @@ -456,9 +456,6 @@ gtk_layout_map (GtkWidget *widget) GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED); - gdk_window_show (widget->window); - gdk_window_show (layout->bin_window); - tmp_list = layout->children; while (tmp_list) { @@ -475,7 +472,9 @@ gtk_layout_map (GtkWidget *widget) tmp_list = tmp_list->next; } - + + gdk_window_show (layout->bin_window); + gdk_window_show (widget->window); } static void diff --git a/gtk/gtklist.c b/gtk/gtklist.c index 0a2f0c3a7..c0d5f246c 100644 --- a/gtk/gtklist.c +++ b/gtk/gtklist.c @@ -435,8 +435,6 @@ gtk_list_map (GtkWidget *widget) GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED); list = GTK_LIST (widget); - gdk_window_show (widget->window); - children = list->children; while (children) { @@ -447,6 +445,8 @@ gtk_list_map (GtkWidget *widget) !GTK_WIDGET_MAPPED (child)) gtk_widget_map (child); } + + gdk_window_show (widget->window); } static void diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c index 7583ea71f..b044b7ef2 100644 --- a/gtk/gtkmenushell.c +++ b/gtk/gtkmenushell.c @@ -367,7 +367,6 @@ gtk_menu_shell_map (GtkWidget *widget) menu_shell = GTK_MENU_SHELL (widget); GTK_WIDGET_SET_FLAGS (menu_shell, GTK_MAPPED); - gdk_window_show (widget->window); children = menu_shell->children; while (children) @@ -378,6 +377,8 @@ gtk_menu_shell_map (GtkWidget *widget) if (GTK_WIDGET_VISIBLE (child) && !GTK_WIDGET_MAPPED (child)) gtk_widget_map (child); } + + gdk_window_show (widget->window); } static void diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index eea6d90a3..75d96dd7a 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -477,7 +477,6 @@ gtk_notebook_map (GtkWidget *widget) g_return_if_fail (GTK_IS_NOTEBOOK (widget)); GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED); - gdk_window_show (widget->window); notebook = GTK_NOTEBOOK (widget); @@ -503,6 +502,8 @@ gtk_notebook_map (GtkWidget *widget) gtk_widget_map (page->tab_label); } } + + gdk_window_show (widget->window); } static void @@ -878,6 +879,7 @@ gtk_notebook_draw (GtkWidget *widget, { GtkNotebook *notebook; GdkRectangle child_area; + GdkRectangle draw_area; g_return_if_fail (widget != NULL); g_return_if_fail (GTK_IS_NOTEBOOK (widget)); @@ -885,6 +887,8 @@ gtk_notebook_draw (GtkWidget *widget, notebook = GTK_NOTEBOOK (widget); + draw_area = *area; + if (GTK_WIDGET_DRAWABLE (widget)) { gboolean have_visible_child; @@ -893,22 +897,19 @@ gtk_notebook_draw (GtkWidget *widget, if (have_visible_child != notebook->have_visible_child) { - GdkRectangle full_area; - notebook->have_visible_child = have_visible_child; - full_area.x = 0; - full_area.y = 0; - full_area.width = widget->allocation.width; - full_area.height = widget->allocation.height; - gtk_notebook_paint (widget, &full_area); + draw_area.x = 0; + draw_area.y = 0; + draw_area.width = widget->allocation.width; + draw_area.height = widget->allocation.height; } - else - gtk_notebook_paint (widget, area); + + gtk_notebook_paint (widget, &draw_area); gtk_widget_draw_focus (widget); if (notebook->cur_page && GTK_WIDGET_VISIBLE (notebook->cur_page->child) && - gtk_widget_intersect (notebook->cur_page->child, area, &child_area)) + gtk_widget_intersect (notebook->cur_page->child, &draw_area, &child_area)) gtk_widget_draw (notebook->cur_page->child, &child_area); } else diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c index a55a6e5e6..6f86114fe 100644 --- a/gtk/gtkpaned.c +++ b/gtk/gtkpaned.c @@ -186,8 +186,6 @@ gtk_paned_map (GtkWidget *widget) GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED); paned = GTK_PANED (widget); - gdk_window_show (widget->window); - if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1) && !GTK_WIDGET_MAPPED (paned->child1)) @@ -196,6 +194,8 @@ gtk_paned_map (GtkWidget *widget) GTK_WIDGET_VISIBLE (paned->child2) && !GTK_WIDGET_MAPPED (paned->child2)) gtk_widget_map (paned->child2); + + gdk_window_show (widget->window); } static void diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c index ca3dffff7..d44a4681c 100644 --- a/gtk/gtkscale.c +++ b/gtk/gtkscale.c @@ -104,9 +104,6 @@ gtk_scale_map (GtkWidget *widget) GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED); range = GTK_RANGE (widget); - if (GTK_WIDGET_NO_WINDOW (widget)) - gtk_widget_queue_draw (widget); - gdk_window_show (range->trough); } diff --git a/gtk/gtktree.c b/gtk/gtktree.c index 058006ecd..6b1eb162e 100644 --- a/gtk/gtktree.c +++ b/gtk/gtktree.c @@ -562,8 +562,6 @@ gtk_tree_map (GtkWidget *widget) GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED); tree = GTK_TREE (widget); - gdk_window_show (widget->window); - if(GTK_IS_TREE(widget->parent)) { /* set root tree for this tree */ @@ -597,6 +595,8 @@ gtk_tree_map (GtkWidget *widget) gtk_widget_map (child); } } + + gdk_window_show (widget->window); } static gint diff --git a/gtk/gtktreeitem.c b/gtk/gtktreeitem.c index 8e99d59a5..1d6d44c2b 100644 --- a/gtk/gtktreeitem.c +++ b/gtk/gtktreeitem.c @@ -1006,8 +1006,6 @@ gtk_tree_item_map (GtkWidget *widget) GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED); - gdk_window_show (widget->window); - if(item->pixmaps_box && GTK_WIDGET_VISIBLE (item->pixmaps_box) && !GTK_WIDGET_MAPPED (item->pixmaps_box)) @@ -1017,6 +1015,8 @@ gtk_tree_item_map (GtkWidget *widget) GTK_WIDGET_VISIBLE (bin->child) && !GTK_WIDGET_MAPPED (bin->child)) gtk_widget_map (bin->child); + + gdk_window_show (widget->window); } static void diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c index 86769f1c9..168ff0317 100644 --- a/gtk/gtkviewport.c +++ b/gtk/gtkviewport.c @@ -382,12 +382,12 @@ gtk_viewport_map (GtkWidget *widget) GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED); bin = GTK_BIN (widget); - gdk_window_show (widget->window); - if (bin->child && GTK_WIDGET_VISIBLE (bin->child) && !GTK_WIDGET_MAPPED (bin->child)) gtk_widget_map (bin->child); + + gdk_window_show (widget->window); } static void diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index e3ca39afb..d909fdf59 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -573,7 +573,7 @@ gtk_widget_class_init (GtkWidgetClass *klass) object_class->type, GTK_SIGNAL_OFFSET (GtkWidgetClass, selection_get), gtk_marshal_NONE__POINTER_UINT_UINT, - GTK_TYPE_NONE, 2, + GTK_TYPE_NONE, 3, GTK_TYPE_SELECTION_DATA, GTK_TYPE_UINT, GTK_TYPE_UINT); @@ -1797,7 +1797,8 @@ gtk_widget_queue_draw_area (GtkWidget *widget, g_return_if_fail (widget != NULL); g_return_if_fail (GTK_IS_WIDGET (widget)); - gtk_widget_queue_draw_data (widget, x, y, width, height, NULL); + if (widget->window && gdk_window_is_viewable (widget->window)) + gtk_widget_queue_draw_data (widget, x, y, width, height, NULL); } void @@ -1806,7 +1807,8 @@ gtk_widget_queue_draw (GtkWidget *widget) g_return_if_fail (widget != NULL); g_return_if_fail (GTK_IS_WIDGET (widget)); - gtk_widget_queue_draw_data (widget, 0, 0, -1, -1, NULL); + if (widget->window && gdk_window_is_viewable (widget->window)) + gtk_widget_queue_draw_data (widget, 0, 0, -1, -1, NULL); } void @@ -1821,6 +1823,9 @@ gtk_widget_queue_clear_area (GtkWidget *widget, g_return_if_fail (widget != NULL); g_return_if_fail (GTK_IS_WIDGET (widget)); + if (!(widget->window && gdk_window_is_viewable (widget->window))) + return; + /* Find the correct widget */ if (GTK_WIDGET_NO_WINDOW (widget)) @@ -1966,18 +1971,18 @@ gtk_widget_clip_rect (GtkWidget *widget, if (rect->x < 0) { - rect->width += rect->x; + rect->width = (width > -rect->x) ? width + rect->x : 0; rect->x = 0; } if (rect->y < 0) { - rect->height += rect->y; + rect->height = (height > -rect->y) ? width + rect->y : 0; rect->y = 0; } if (rect->x + rect->width > width) - rect->width = width - rect->x; + rect->width = (width > rect->x) ? width - rect->x : 0; if (rect->y + rect->height > height) - rect->height = height - rect->y; + rect->height = (height > rect->y) ? height - rect->y : 0; } if (!window) @@ -2001,7 +2006,7 @@ gtk_widget_clip_rect (GtkWidget *widget, } static gint -gtk_widget_idle_draw (gpointer data) +gtk_widget_idle_draw (gpointer cb_data) { GSList *widget_list; GSList *old_queue; @@ -2035,7 +2040,13 @@ gtk_widget_idle_draw (gpointer data) gtk_object_set_data_by_id (GTK_OBJECT (widget), draw_data_tmp_key_id, draw_data_list); - + + /* XXX: Since we are unsetting this flag here, further + * down the only way we can check if a redraw is queued + * on a given widget is by calling gtk_object_get_data. + * for speed purposes we might well want a private + * flag GTK_REDRAW_PROCESSING or something. + */ GTK_PRIVATE_UNSET_FLAG (widget, GTK_REDRAW_PENDING); while (draw_data_list) @@ -2149,8 +2160,8 @@ gtk_widget_idle_draw (gpointer data) if (parent) parent = parent->parent; - - if (parent && GTK_WIDGET_REDRAW_PENDING (parent)) + + if (parent) parent_list = gtk_object_get_data_by_id (GTK_OBJECT (parent), draw_data_tmp_key_id); else @@ -2191,7 +2202,8 @@ gtk_widget_idle_draw (gpointer data) while (draw_data_list) { GtkDrawData *data = draw_data_list->data; - gtk_widget_draw (widget, &data->rect); + if ((data->rect.width != 0) || (data->rect.height != 0)) + gtk_widget_draw (widget, &data->rect); if (draw_data_list->next) draw_data_list = draw_data_list->next; @@ -2379,8 +2391,8 @@ gtk_widget_size_allocate (GtkWidget *widget, needs_draw = TRUE; } } - else if (widget->allocation.width != real_allocation.width || - widget->allocation.height != real_allocation.height) + else if ((widget->allocation.width != real_allocation.width || + widget->allocation.height != real_allocation.height)) { needs_draw = TRUE; } diff --git a/gtk/testgtkrc b/gtk/testgtkrc index 5d43b97b4..04f7e1f57 100644 --- a/gtk/testgtkrc +++ b/gtk/testgtkrc @@ -26,7 +26,7 @@ class "GtkWidget" style "defaultfont" style "window" { - # bg_pixmap[NORMAL] = "marble.xpm" +# bg_pixmap[NORMAL] = "marble.xpm" } style "scale" diff --git a/tests/testgtkrc b/tests/testgtkrc index 5d43b97b4..04f7e1f57 100644 --- a/tests/testgtkrc +++ b/tests/testgtkrc @@ -26,7 +26,7 @@ class "GtkWidget" style "defaultfont" style "window" { - # bg_pixmap[NORMAL] = "marble.xpm" +# bg_pixmap[NORMAL] = "marble.xpm" } style "scale" |