diff --git a/ChangeLog b/ChangeLog index 218c473ca7..b106b2e9c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu Feb 18 00:27:46 1999 Tim Janik + + * gtk/gtkwidget.c (gtk_widget_queue_clear_area): only translate widget + relative coordinates to window relative if the widget is not a toplevel + (i.e. it has ->parent != NULL), otherwise the area size gets screwed up + for toplevels. + Tue Feb 16 14:25:44 CST 1999 Shawn T. Amundson * INSTALL diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 218c473ca7..b106b2e9c4 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,10 @@ +Thu Feb 18 00:27:46 1999 Tim Janik + + * gtk/gtkwidget.c (gtk_widget_queue_clear_area): only translate widget + relative coordinates to window relative if the widget is not a toplevel + (i.e. it has ->parent != NULL), otherwise the area size gets screwed up + for toplevels. + Tue Feb 16 14:25:44 CST 1999 Shawn T. Amundson * INSTALL diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 218c473ca7..b106b2e9c4 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,10 @@ +Thu Feb 18 00:27:46 1999 Tim Janik + + * gtk/gtkwidget.c (gtk_widget_queue_clear_area): only translate widget + relative coordinates to window relative if the widget is not a toplevel + (i.e. it has ->parent != NULL), otherwise the area size gets screwed up + for toplevels. + Tue Feb 16 14:25:44 CST 1999 Shawn T. Amundson * INSTALL diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 218c473ca7..b106b2e9c4 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,10 @@ +Thu Feb 18 00:27:46 1999 Tim Janik + + * gtk/gtkwidget.c (gtk_widget_queue_clear_area): only translate widget + relative coordinates to window relative if the widget is not a toplevel + (i.e. it has ->parent != NULL), otherwise the area size gets screwed up + for toplevels. + Tue Feb 16 14:25:44 CST 1999 Shawn T. Amundson * INSTALL diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 218c473ca7..b106b2e9c4 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,10 @@ +Thu Feb 18 00:27:46 1999 Tim Janik + + * gtk/gtkwidget.c (gtk_widget_queue_clear_area): only translate widget + relative coordinates to window relative if the widget is not a toplevel + (i.e. it has ->parent != NULL), otherwise the area size gets screwed up + for toplevels. + Tue Feb 16 14:25:44 CST 1999 Shawn T. Amundson * INSTALL diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 218c473ca7..b106b2e9c4 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,10 @@ +Thu Feb 18 00:27:46 1999 Tim Janik + + * gtk/gtkwidget.c (gtk_widget_queue_clear_area): only translate widget + relative coordinates to window relative if the widget is not a toplevel + (i.e. it has ->parent != NULL), otherwise the area size gets screwed up + for toplevels. + Tue Feb 16 14:25:44 CST 1999 Shawn T. Amundson * INSTALL diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 218c473ca7..b106b2e9c4 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,10 @@ +Thu Feb 18 00:27:46 1999 Tim Janik + + * gtk/gtkwidget.c (gtk_widget_queue_clear_area): only translate widget + relative coordinates to window relative if the widget is not a toplevel + (i.e. it has ->parent != NULL), otherwise the area size gets screwed up + for toplevels. + Tue Feb 16 14:25:44 CST 1999 Shawn T. Amundson * INSTALL diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 9c3a5a7cce..e725fb9dcd 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -1852,27 +1852,30 @@ gtk_widget_queue_clear_area (GtkWidget *widget, } else { - gint wx, wy, wwidth, wheight; - /* Translate widget relative to window-relative */ - - gdk_window_get_position (widget->window, &wx, &wy); - x -= wx - widget->allocation.x; - y -= wy - widget->allocation.y; - - gdk_window_get_size (widget->window, &wwidth, &wheight); - - if (x < 0) + if (widget->parent) { - width += x; x = 0; + gint wx, wy, wwidth, wheight; + /* Translate widget relative to window-relative */ + + gdk_window_get_position (widget->window, &wx, &wy); + x -= wx - widget->allocation.x; + y -= wy - widget->allocation.y; + + gdk_window_get_size (widget->window, &wwidth, &wheight); + + if (x < 0) + { + width += x; x = 0; + } + if (y < 0) + { + height += y; y = 0; + } + if (x + width > wwidth) + width = wwidth - x; + if (y + height > wheight) + height = wheight - y; } - if (y < 0) - { - height += y; y = 0; - } - if (x + width > wwidth) - width = wwidth - x; - if (y + height > wheight) - height = wheight - y; gtk_widget_queue_draw_data (widget, x, y, width, height, NULL); }