lots of clock tweaks, but still, STILL! not done, really
[ardour.git] / libs / gtkmm2ext / utils.cc
index a08c9442a3dee7cfc95cde4f54be13a4db9931b5..a5768fad5ca05ed519019056eb5e8ce06e8201eb 100644 (file)
@@ -468,3 +468,23 @@ Gtkmm2ext::rounded_rectangle (Cairo::RefPtr<Cairo::Context> context, double x, d
 }
 
 #endif
+
+Glib::RefPtr<Gdk::Window>
+Gtkmm2ext::window_to_draw_on (Gtk::Widget& w, Gtk::Widget** parent)
+{
+       if (w.get_has_window()) {
+               return w.get_window();
+       }
+
+       (*parent) = w.get_parent();
+
+       while (*parent) {
+               if ((*parent)->get_has_window()) {
+                       return (*parent)->get_window ();
+               }
+               (*parent) = (*parent)->get_parent ();
+       }
+
+       return Glib::RefPtr<Gdk::Window> ();
+}
+