aboutsummaryrefslogtreecommitdiff
path: root/dw/layout.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dw/layout.cc')
-rw-r--r--dw/layout.cc36
1 files changed, 30 insertions, 6 deletions
diff --git a/dw/layout.cc b/dw/layout.cc
index c2a53d08..c87606dd 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*,
@@ -693,11 +704,13 @@ void Layout::draw (View *view, Rectangle *area)
widgetDrawArea.width = intersection.width;
widgetDrawArea.height = intersection.height;
- topLevel->draw (view, &widgetDrawArea);
+ topLevel->drawToplevel (view, &widgetDrawArea);
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->getWidgetAtPointToplevel (x, y);
else
- return NULL;
+ widget = NULL;
+
+ DBG_OBJ_MSGF ("events", 0, "=> %p", widget);
+ DBG_OBJ_LEAVE ();
+ return widget;
}
@@ -1108,12 +1126,16 @@ Widget *Layout::getWidgetAtPoint (int x, int y)
*/
void Layout::moveToWidget (Widget *newWidgetAtPoint, ButtonState state)
{
+ DBG_OBJ_ENTER ("events", 0, "moveToWidget", "%p, %d",
+ newWidgetAtPoint, state);
+
Widget *ancestor, *w;
Widget **track;
int trackLen, i, i_a;
EventCrossing crossingEvent;
- _MSG("moveToWidget: wap=%p nwap=%p\n",widgetAtPoint,newWidgetAtPoint);
+ DBG_OBJ_MSGF ("events", 1, "(old) widgetAtPoint = %p", widgetAtPoint);
+
if (newWidgetAtPoint != widgetAtPoint) {
// The mouse pointer has been moved into another widget.
if (newWidgetAtPoint && widgetAtPoint)
@@ -1183,6 +1205,8 @@ void Layout::moveToWidget (Widget *newWidgetAtPoint, ButtonState state)
widgetAtPoint = newWidgetAtPoint;
updateCursor ();
}
+
+ DBG_OBJ_LEAVE ();
}
/**