remove debug output from Pane code
[ardour.git] / libs / gtkmm2ext / cairo_widget.cc
index 0f34a3ffdbbff3ac828e4d71fe819975b4c8fd9f..fe93f1eb7cc384dc72f9f72c95332b1f3ab288bc 100644 (file)
@@ -30,8 +30,7 @@ static const char* has_cairo_widget_background_info = "has_cairo_widget_backgrou
 bool CairoWidget::_flat_buttons = false;
 bool CairoWidget::_widget_prelight = true;
 
-static void noop() { }
-sigc::slot<void> CairoWidget::focus_handler (sigc::ptr_fun (noop));
+sigc::slot<void,Gtk::Widget*> CairoWidget::focus_handler;
 
 void CairoWidget::set_source_rgb_a( cairo_t* cr, Gdk::Color col, float a)  //ToDo:  this one and the Canvas version should be in a shared file (?)
 {
@@ -61,7 +60,7 @@ CairoWidget::~CairoWidget ()
 bool
 CairoWidget::on_button_press_event (GdkEventButton*)
 {
-       focus_handler();
+       focus_handler (this);
        return false;
 }
 
@@ -183,15 +182,21 @@ CairoWidget::on_expose_event (GdkEventExpose *ev)
 #endif
 
        cr->rectangle (ev->area.x, ev->area.y, ev->area.width, ev->area.height);
-       cr->clip_preserve ();
 
-       /* paint expose area the color of the parent window bg
-       */
+       if (_need_bg) {
+               cr->clip_preserve ();
+
+               /* paint expose area the color of the parent window bg
+                */
 
-       Gdk::Color bg (get_parent_bg());
+               Gdk::Color bg (get_parent_bg());
 
-       cr->set_source_rgb (bg.get_red_p(), bg.get_green_p(), bg.get_blue_p());
-       cr->fill ();
+               cr->set_source_rgb (bg.get_red_p(), bg.get_green_p(), bg.get_blue_p());
+               cr->fill ();
+       } else {
+               std::cerr << get_name() << " skipped bg fill\n";
+               cr->clip ();
+       }
 
        cairo_rectangle_t expose_area;
        expose_area.x = ev->area.x;
@@ -388,7 +393,7 @@ CairoWidget::set_widget_prelight (bool yn)
 }
 
 void
-CairoWidget::set_focus_handler (sigc::slot<void> s)
+CairoWidget::set_focus_handler (sigc::slot<void,Gtk::Widget*> s)
 {
        focus_handler = s;
 }