From 9e2b6b31acd6184904b1f2a434e11299481092da Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Thu, 11 Jun 1998 04:36:22 +0000 Subject: [PATCH] Create/resize the pixmap on every expose CONFIGURE event, not just on the Thu Jun 11 00:34:51 1998 Owen Taylor * app/color_area.c (color_area_events): Create/resize the pixmap on every expose CONFIGURE event, not just on the first expose event. Thu Jun 11 00:02:15 1998 Owen Taylor * app/interface.c (create_toolbox): Create the color area before showing the window, so that the window gets created at the right size. [ This doesn't actually fix much, but it is better to do that way ] --- ChangeLog | 13 +++++++++++++ app/color_area.c | 25 +++++++++++++++++-------- app/display/gimpdisplayshell-draw.c | 2 +- app/display/gimpdisplayshell.c | 2 +- app/gui/color-area.c | 25 +++++++++++++++++-------- app/interface.c | 2 +- app/widgets/gimptoolbox-color-area.c | 25 +++++++++++++++++-------- 7 files changed, 67 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index 418e0f6be8..a4f2a49c27 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +Thu Jun 11 00:34:51 1998 Owen Taylor + + * app/color_area.c (color_area_events): Create/resize + the pixmap on every expose CONFIGURE event, not just + on the first expose event. + +Thu Jun 11 00:02:15 1998 Owen Taylor + + * app/interface.c (create_toolbox): Create the color + area before showing the window, so that the window gets + created at the right size. [ This doesn't actually fix + much, but it is better to do that way ] + Wed Jun 10 14:17:44 1998 Owen Taylor * app/disp_callbacks.c (gdisplay_origin_button_press): diff --git a/app/color_area.c b/app/color_area.c index 73ec4ccd0e..466f8bd914 100644 --- a/app/color_area.c +++ b/app/color_area.c @@ -208,15 +208,24 @@ color_area_events (GtkWidget *widget, switch (event->type) { - case GDK_EXPOSE: - if (!color_area_pixmap) - color_area_pixmap = gdk_pixmap_new (widget->window, - widget->allocation.width, - widget->allocation.height, -1); - if (!color_area_gc) - color_area_gc = gdk_gc_new (widget->window); + case GDK_CONFIGURE: + if (color_area_pixmap) + gdk_pixmap_unref (color_area_pixmap); - color_area_draw (); + color_area_pixmap = gdk_pixmap_new (widget->window, + widget->allocation.width, + widget->allocation.height, -1); + + break; + + case GDK_EXPOSE: + if (GTK_WIDGET_DRAWABLE (widget)) + { + if (!color_area_gc) + color_area_gc = gdk_gc_new (widget->window); + + color_area_draw (); + } break; case GDK_BUTTON_PRESS: diff --git a/app/display/gimpdisplayshell-draw.c b/app/display/gimpdisplayshell-draw.c index f5f21e33e4..d52e71e180 100644 --- a/app/display/gimpdisplayshell-draw.c +++ b/app/display/gimpdisplayshell-draw.c @@ -636,8 +636,8 @@ create_toolbox () create_tools (vbox); /*create_tool_label (vbox);*/ /*create_progress_area (vbox);*/ - gtk_widget_show (window); create_color_area (vbox); + gtk_widget_show (window); toolbox_shell = window; diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c index f5f21e33e4..d52e71e180 100644 --- a/app/display/gimpdisplayshell.c +++ b/app/display/gimpdisplayshell.c @@ -636,8 +636,8 @@ create_toolbox () create_tools (vbox); /*create_tool_label (vbox);*/ /*create_progress_area (vbox);*/ - gtk_widget_show (window); create_color_area (vbox); + gtk_widget_show (window); toolbox_shell = window; diff --git a/app/gui/color-area.c b/app/gui/color-area.c index 73ec4ccd0e..466f8bd914 100644 --- a/app/gui/color-area.c +++ b/app/gui/color-area.c @@ -208,15 +208,24 @@ color_area_events (GtkWidget *widget, switch (event->type) { - case GDK_EXPOSE: - if (!color_area_pixmap) - color_area_pixmap = gdk_pixmap_new (widget->window, - widget->allocation.width, - widget->allocation.height, -1); - if (!color_area_gc) - color_area_gc = gdk_gc_new (widget->window); + case GDK_CONFIGURE: + if (color_area_pixmap) + gdk_pixmap_unref (color_area_pixmap); - color_area_draw (); + color_area_pixmap = gdk_pixmap_new (widget->window, + widget->allocation.width, + widget->allocation.height, -1); + + break; + + case GDK_EXPOSE: + if (GTK_WIDGET_DRAWABLE (widget)) + { + if (!color_area_gc) + color_area_gc = gdk_gc_new (widget->window); + + color_area_draw (); + } break; case GDK_BUTTON_PRESS: diff --git a/app/interface.c b/app/interface.c index f5f21e33e4..d52e71e180 100644 --- a/app/interface.c +++ b/app/interface.c @@ -636,8 +636,8 @@ create_toolbox () create_tools (vbox); /*create_tool_label (vbox);*/ /*create_progress_area (vbox);*/ - gtk_widget_show (window); create_color_area (vbox); + gtk_widget_show (window); toolbox_shell = window; diff --git a/app/widgets/gimptoolbox-color-area.c b/app/widgets/gimptoolbox-color-area.c index 73ec4ccd0e..466f8bd914 100644 --- a/app/widgets/gimptoolbox-color-area.c +++ b/app/widgets/gimptoolbox-color-area.c @@ -208,15 +208,24 @@ color_area_events (GtkWidget *widget, switch (event->type) { - case GDK_EXPOSE: - if (!color_area_pixmap) - color_area_pixmap = gdk_pixmap_new (widget->window, - widget->allocation.width, - widget->allocation.height, -1); - if (!color_area_gc) - color_area_gc = gdk_gc_new (widget->window); + case GDK_CONFIGURE: + if (color_area_pixmap) + gdk_pixmap_unref (color_area_pixmap); - color_area_draw (); + color_area_pixmap = gdk_pixmap_new (widget->window, + widget->allocation.width, + widget->allocation.height, -1); + + break; + + case GDK_EXPOSE: + if (GTK_WIDGET_DRAWABLE (widget)) + { + if (!color_area_gc) + color_area_gc = gdk_gc_new (widget->window); + + color_area_draw (); + } break; case GDK_BUTTON_PRESS: