get dirty
[winnie] / src / window.cc
index a0388fe..59302d4 100644 (file)
@@ -92,14 +92,15 @@ void Window::invalidate()
 
 void Window::draw(const Rect &dirty_region)
 {
-       Rect intersect = rect_intersection(rect, dirty_region);
+       Rect abs_rect = get_absolute_rect();
+       Rect intersect = rect_intersection(abs_rect, dirty_region);
        if(intersect.width && intersect.height) {
                if(callbacks.display) {
                        callbacks.display(this);
                }
                dirty = false;
 
-               draw_children(rect);
+               draw_children(abs_rect);
        }
 }
 
@@ -142,6 +143,11 @@ bool Window::get_focusable() const
        return focusable;
 }
 
+bool Window::get_dirty() const
+{
+       return dirty;
+}
+
 void Window::set_display_callback(DisplayFuncType func)
 {
        callbacks.display = func;