aboutsummaryrefslogtreecommitdiff
path: root/dw/layout.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dw/layout.cc')
-rw-r--r--dw/layout.cc26
1 files changed, 22 insertions, 4 deletions
diff --git a/dw/layout.cc b/dw/layout.cc
index 2845a8e9..60cea8e0 100644
--- a/dw/layout.cc
+++ b/dw/layout.cc
@@ -374,6 +374,14 @@ void Layout::addWidget (Widget *widget)
return;
}
+ // The toplevel widget always establishes a stacking context. It could
+ // already be set in Widget::setStyle().
+ if (widget->stackingContextMgr == NULL) {
+ widget->stackingContextMgr = new StackingContextMgr (widget);
+ DBG_OBJ_ASSOC (widget, widget->stackingContextMgr);
+ widget->stackingContextWidget = widget;
+ }
+
topLevel = widget;
widget->layout = this;
widget->container = NULL;
@@ -654,6 +662,9 @@ bool Layout::calcScrollInto (int requestedValue, int requestedSize,
void Layout::draw (View *view, Rectangle *area)
{
+ DBG_OBJ_ENTER ("draw", 0, "draw", "%d, %d, %d * %d",
+ area->x, area->y, area->width, area->height);
+
Rectangle widgetArea, intersection, widgetDrawArea;
// First of all, draw background image. (Unlike background *color*,
@@ -698,6 +709,8 @@ void Layout::draw (View *view, Rectangle *area)
view->finishDrawing (&intersection);
}
}
+
+ DBG_OBJ_LEAVE ();
}
int Layout::currHScrollbarThickness()
@@ -1093,12 +1106,17 @@ void Layout::leaveNotify (View *view, ButtonState state)
*/
Widget *Layout::getWidgetAtPoint (int x, int y)
{
- _MSG ("------------------------------------------------------------\n");
- _MSG ("widget at (%d, %d)\n", x, y);
+ DBG_OBJ_ENTER ("events", 0, "getWidgetAtPoint", "%d, %d", x, y);
+ Widget *widget;
+
if (topLevel && topLevel->wasAllocated ())
- return topLevel->getWidgetAtPoint (x, y, 0);
+ widget = topLevel->getWidgetAtPoint (x, y);
else
- return NULL;
+ widget = NULL;
+
+ DBG_OBJ_MSGF ("events", 0, "=> %p", widget);
+ DBG_OBJ_LEAVE ();
+ return widget;
}