Skip to content
Browse files

widget: Process widget callbacks before widget display.

Previously, widget callbacks were not always called, even when displayed.

Fixes ticket:3844, "Drag select freezes build progress bar".
  • Loading branch information...
1 parent 39f43a9 commit c00c6f3c2053cbe0af907e92bd8798dbde7557ee @Cyp Cyp committed Mar 15, 2013
Showing with 8 additions and 3 deletions.
  1. +8 −3 lib/widget/widget.cpp
View
11 lib/widget/widget.cpp
@@ -749,9 +749,6 @@ WidgetTriggers const &widgRunScreen(W_SCREEN *psScreen)
/* Process the screen's widgets */
psScreen->psForm->runRecursive(&sContext);
- /* Process any user callback functions */
- psScreen->psForm->processCallbacksRecursive(&sContext);
-
deleteOldWidgets(); // Delete any widgets that called deleteLater() while being run.
/* Return the ID of a pressed button or finished edit box if any */
@@ -833,6 +830,14 @@ void widgDisplayScreen(W_SCREEN *psScreen)
debugLoc = debugLoc[1] == -1? debugSequence : debugLoc[0] == debugCode? debugLoc : debugLoc[1] == debugCode? debugLoc + 1 : debugSequence;
debugBoundingBoxes = debugBoundingBoxes ^ (debugLoc[1] == -1);
+ /* Process any user callback functions */
+ W_CONTEXT sContext;
+ sContext.xOffset = 0;
+ sContext.yOffset = 0;
+ sContext.mx = mouseX();
+ sContext.my = mouseY();
+ psScreen->psForm->processCallbacksRecursive(&sContext);
+
// Display the widgets.
psScreen->psForm->displayRecursive(0, 0);

0 comments on commit c00c6f3

Please sign in to comment.
Something went wrong with that request. Please try again.