diff options
author | Sebastian Geerken <devnull@localhost> | 2013-08-22 21:48:24 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2013-08-22 21:48:24 +0200 |
commit | 0557624de7bdc626f89a03c3b6939e5a06f7d023 (patch) | |
tree | 8463e7a5da4a5603ab2fb1083e4234a8fc59d8eb | |
parent | 18f250c8b0a2918224118d068cebc844e75a1f52 (diff) |
More tests.
-rw-r--r-- | dw/layout.cc | 4 | ||||
-rw-r--r-- | dw/layout.hh | 13 | ||||
-rw-r--r-- | dw/widget.cc | 1 | ||||
-rw-r--r-- | dw/widget.hh | 1 |
4 files changed, 14 insertions, 5 deletions
diff --git a/dw/layout.cc b/dw/layout.cc index c26ae57b..9e705055 100644 --- a/dw/layout.cc +++ b/dw/layout.cc @@ -661,6 +661,8 @@ void Layout::setBgColor (style::Color *color) void Layout::resizeIdle () { + enterQueueResize (); + //static int calls = 0; //printf ("Layout::resizeIdle calls = %d\n", ++calls); @@ -747,6 +749,8 @@ void Layout::resizeIdle () updateAnchor (); //printf ("Layout::resizeIdle end\n"); + + leaveQueueResize (); } void Layout::setSizeHints () diff --git a/dw/layout.hh b/dw/layout.hh index 730c35f1..2055b751 100644 --- a/dw/layout.hh +++ b/dw/layout.hh @@ -211,12 +211,15 @@ private: void queueResize (); void removeWidget (); - /* For tests regarding the respective Widget methods. Accessed by - respective methods (enter..., leave..., ...Entered) defined in - Widget. */ + /* For tests regarding the respective Layout and (mostly) Widget + methods. Accessed by respective methods (enter..., leave..., + ...Entered) defined here and in Widget. */ - int queueResizeCounter, sizeAllocateCounter, sizeRequestCounter, - getExtremesCounter; + int resizeIdleCounter, queueResizeCounter, sizeAllocateCounter, + sizeRequestCounter, getExtremesCounter; + + void enterQueueResize () { resizeIdleCounter++; } + void leaveQueueResize () { resizeIdleCounter--; } public: Layout (Platform *platform); diff --git a/dw/widget.cc b/dw/widget.cc index 902a585d..f1f47f9e 100644 --- a/dw/widget.cc +++ b/dw/widget.cc @@ -272,6 +272,7 @@ void Widget::sizeAllocate (Allocation *allocation) assert (!queueResizeEntered ()); assert (!sizeRequestEntered ()); assert (!getExtremesEntered ()); + assert (resizeIdleEntered ()); enterSizeAllocate (); diff --git a/dw/widget.hh b/dw/widget.hh index 1b0b7b60..7dd12267 100644 --- a/dw/widget.hh +++ b/dw/widget.hh @@ -262,6 +262,7 @@ public: { deleteCallbackFunc = func; deleteCallbackData = data; } private: + bool resizeIdleEntered () { return layout && layout->resizeIdleCounter; } void enterQueueResize () { if (layout) layout->queueResizeCounter++; } void leaveQueueResize () { if (layout) layout->queueResizeCounter--; } |