diff options
author | Matthias Clasen <mclasen@redhat.com> | 2016-10-26 14:28:17 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2016-10-26 14:33:07 -0400 |
commit | e2e8231ca9dc52fcfe5d850555a8b0ae21577522 (patch) | |
tree | 2fc4c5ab6198f340b19b83a95d7b52f8417b7cca /gtk/gtkcolorplane.c | |
parent | 75358e4d8dce3790a55649ba867833118c56a64d (diff) | |
download | gtk+-e2e8231ca9dc52fcfe5d850555a8b0ae21577522.tar.gz |
color chooser: Fix a problem with show-editor=TRUE
For some reason we end up allocating the colorplane widget
before it is realized, and then never initialize the surface.
Fix this by explicitly doing it on realize.
https://bugzilla.gnome.org/show_bug.cgi?id=773474
Diffstat (limited to 'gtk/gtkcolorplane.c')
-rw-r--r-- | gtk/gtkcolorplane.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gtk/gtkcolorplane.c b/gtk/gtkcolorplane.c index 0e37406812..cfb9a5983b 100644 --- a/gtk/gtkcolorplane.c +++ b/gtk/gtkcolorplane.c @@ -182,6 +182,14 @@ plane_size_allocate (GtkWidget *widget, } static void +plane_realize (GtkWidget *widget) +{ + GTK_WIDGET_CLASS (gtk_color_plane_parent_class)->realize (widget); + + create_surface (GTK_COLOR_PLANE (widget)); +} + +static void set_cross_cursor (GtkWidget *widget, gboolean enabled) { @@ -491,6 +499,7 @@ gtk_color_plane_class_init (GtkColorPlaneClass *class) widget_class->draw = plane_draw; widget_class->size_allocate = plane_size_allocate; + widget_class->realize = plane_realize; widget_class->key_press_event = plane_key_press; g_object_class_install_property (object_class, |