diff --git a/src/ui/window.cpp b/src/ui/window.cpp index 6991c54c5..bf252b83c 100644 --- a/src/ui/window.cpp +++ b/src/ui/window.cpp @@ -592,9 +592,11 @@ void Window::moveWindow(const gfx::Rect& rect, bool use_blit) #define FLAGS (DrawableRegionFlags)(kCutTopWindows | kUseChildArea) Manager* manager = this->manager(); - Message* msg; - manager->dispatchMessages(); + // Discard enqueued kWinMoveMessage for this window because we are + // going to send a new kWinMoveMessage with the latest window + // bounds. + manager->removeMessagesFor(this, kWinMoveMessage); // Get the window's current position Rect old_pos = bounds(); @@ -605,7 +607,7 @@ void Window::moveWindow(const gfx::Rect& rect, bool use_blit) Rect man_pos = manager->bounds(); // Send a kWinMoveMessage message to the window - msg = new Message(kWinMoveMessage); + Message* msg = new Message(kWinMoveMessage); msg->addRecipient(this); manager->enqueueMessage(msg);