From 3279f3b0556dae138f680000d77bf0ed51e6993f Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Wed, 3 May 2006 22:30:52 +0000 Subject: [PATCH] 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 --- src/kits/interface/View.cpp | 3 +-- src/kits/interface/Window.cpp | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/kits/interface/View.cpp b/src/kits/interface/View.cpp index a9f17586fe..99a13223aa 100644 --- a/src/kits/interface/View.cpp +++ b/src/kits/interface/View.cpp @@ -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; diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp index e7b0c24d98..2e2819eb5d 100644 --- a/src/kits/interface/Window.cpp +++ b/src/kits/interface/Window.cpp @@ -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();