Detect recursions of UpdateIfNeeded. This is necessary as we may call hook functions (FrameResized(), FrameMoved()) that in turn could call UpdateIfNeeded again. This is the case for DarkSite which uses GetMouse() inside FrameResized(). This fixes resizing DarkSite and probably fixes bug 539 too.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17314 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2006-05-03 22:30:52 +00:00
parent 035eafc5f3
commit 3279f3b055
2 changed files with 6 additions and 2 deletions

View File

@ -1351,11 +1351,10 @@ BView::GetMouse(BPoint *location, uint32 *buttons, bool checkMessageQueue)
do_owner_check();
if (checkMessageQueue) {
Window()->UpdateIfNeeded();
BMessageQueue *queue = Window()->MessageQueue();
queue->Lock();
Window()->UpdateIfNeeded();
// Look out for mouse update messages
BMessage *msg;

View File

@ -1419,6 +1419,11 @@ BWindow::UpdateIfNeeded()
if (find_thread(NULL) != Thread())
return;
// if the queue is already locked we are called recursivly
// from our own dispatched update message
if (((const BMessageQueue *)MessageQueue())->IsLocked())
return;
// make sure all requests that would cause an update have
// arrived at the server
Sync();