diff --git a/libs/gtkmm2ext/pixfader.cc b/libs/gtkmm2ext/pixfader.cc index e3a6036bcb..005e9dcefd 100644 --- a/libs/gtkmm2ext/pixfader.cc +++ b/libs/gtkmm2ext/pixfader.cc @@ -188,13 +188,35 @@ PixFader::on_expose_event (GdkEventExpose* ev) Cairo::RefPtr context = get_window()->create_cairo_context(); cairo_t* cr = context->cobj(); - cairo_rectangle (cr, ev->area.x, ev->area.y, ev->area.width, ev->area.height); - cairo_clip (cr); - if (!pattern) { create_patterns(); } + if (!pattern) { + + /* this isn't supposed to be happen, but some wackiness whereby + the pixfader ends up with a 1xN or Nx1 size allocation + leads to it. the basic wackiness needs fixing but we + shouldn't crash. just fill in the expose area with + our bg color. + */ + + Gdk::Color c = get_style()->get_bg (get_state()); + float br, bg, bb; + + br = c.get_red_p (); + bg = c.get_green_p (); + bb = c.get_blue_p (); + cairo_set_source_rgb (cr, br, bg, bb); + cairo_rectangle (cr, ev->area.x, ev->area.y, ev->area.width, ev->area.height); + cairo_fill (cr); + + return true; + } + + cairo_rectangle (cr, ev->area.x, ev->area.y, ev->area.width, ev->area.height); + cairo_clip (cr); + int ds = display_span (); float w = get_width(); float h = get_height();