summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2013-07-03 15:49:12 +0200
committerSebastian Geerken <devnull@localhost>2013-07-03 15:49:12 +0200
commit8f86bdbd31d4b8a38fec04acbc3b853178495d4c (patch)
tree5c7ed2cddbfaa4a56d74ee1c6bec70c1345b11cf
parent8a4b80f989cabc0c83ed0a0c85189b5e84ad7fbe (diff)
Removed loop in Layout::resizeIdle, which made no sense, and probably caused too much redundant calls.
-rw-r--r--dw/layout.cc87
1 files changed, 43 insertions, 44 deletions
diff --git a/dw/layout.cc b/dw/layout.cc
index a974378f..3f493d8a 100644
--- a/dw/layout.cc
+++ b/dw/layout.cc
@@ -655,53 +655,52 @@ void Layout::resizeIdle ()
//static int calls = 0;
//MSG(" Layout::resizeIdle calls = %d\n", ++calls);
- while (resizeIdleId != -1) {
- // Reset already here, since in this function, queueResize() may be
- // called again.
- resizeIdleId = -1;
-
- if (topLevel) {
- Requisition requisition;
- Allocation allocation;
-
- topLevel->sizeRequest (&requisition);
-
- allocation.x = allocation.y = 0;
- allocation.width = requisition.width;
- allocation.ascent = requisition.ascent;
- allocation.descent = requisition.descent;
- topLevel->sizeAllocate (&allocation);
-
- canvasWidth = requisition.width;
- canvasAscent = requisition.ascent;
- canvasDescent = requisition.descent;
-
- emitter.emitCanvasSizeChanged (
- canvasWidth, canvasAscent, canvasDescent);
-
- // Tell the view about the new world size.
- view->setCanvasSize (canvasWidth, canvasAscent, canvasDescent);
- // view->queueDrawTotal (false);
-
- if (usesViewport) {
- int currHThickness = currHScrollbarThickness();
- int currVThickness = currVScrollbarThickness();
-
- if (!canvasHeightGreater &&
- canvasAscent + canvasDescent
- > viewportHeight - currHThickness) {
- canvasHeightGreater = true;
- setSizeHints ();
- /* May queue a new resize. */
- }
+ assert (resizeIdleId != -1);
- // Set viewport sizes.
- view->setViewportSize (viewportWidth, viewportHeight,
- currHThickness, currVThickness);
- }
+ // Reset already here, since in this function, queueResize() may be
+ // called again.
+ resizeIdleId = -1;
+
+ if (topLevel) {
+ Requisition requisition;
+ Allocation allocation;
+
+ topLevel->sizeRequest (&requisition);
+
+ allocation.x = allocation.y = 0;
+ allocation.width = requisition.width;
+ allocation.ascent = requisition.ascent;
+ allocation.descent = requisition.descent;
+ topLevel->sizeAllocate (&allocation);
+
+ canvasWidth = requisition.width;
+ canvasAscent = requisition.ascent;
+ canvasDescent = requisition.descent;
+
+ emitter.emitCanvasSizeChanged (canvasWidth, canvasAscent, canvasDescent);
+
+ // Tell the view about the new world size.
+ view->setCanvasSize (canvasWidth, canvasAscent, canvasDescent);
+ // view->queueDrawTotal (false);
+
+ if (usesViewport) {
+ int currHThickness = currHScrollbarThickness();
+ int currVThickness = currVScrollbarThickness();
+
+ if (!canvasHeightGreater &&
+ canvasAscent + canvasDescent
+ > viewportHeight - currHThickness) {
+ canvasHeightGreater = true;
+ setSizeHints ();
+ /* May queue a new resize. */
+ }
+
+ // Set viewport sizes.
+ view->setViewportSize (viewportWidth, viewportHeight,
+ currHThickness, currVThickness);
}
- // views are redrawn via Widget::resizeDrawImpl ()
+ // views are redrawn via Widget::resizeDrawImpl ()
}