mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-06 15:54:41 +00:00
Discard enqueued kWinMoveMessage messages (fix #1006)
When we're moving or resizing a window, sending several kWinMoveMessage doesn't make sense. So we discard all kWinMoveMessage and re-enqueue a new one with the latest window bounds.
This commit is contained in:
parent
9c032013f2
commit
b5ace78bdf
@ -592,9 +592,11 @@ void Window::moveWindow(const gfx::Rect& rect, bool use_blit)
|
|||||||
#define FLAGS (DrawableRegionFlags)(kCutTopWindows | kUseChildArea)
|
#define FLAGS (DrawableRegionFlags)(kCutTopWindows | kUseChildArea)
|
||||||
|
|
||||||
Manager* manager = this->manager();
|
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
|
// Get the window's current position
|
||||||
Rect old_pos = bounds();
|
Rect old_pos = bounds();
|
||||||
@ -605,7 +607,7 @@ void Window::moveWindow(const gfx::Rect& rect, bool use_blit)
|
|||||||
Rect man_pos = manager->bounds();
|
Rect man_pos = manager->bounds();
|
||||||
|
|
||||||
// Send a kWinMoveMessage message to the window
|
// Send a kWinMoveMessage message to the window
|
||||||
msg = new Message(kWinMoveMessage);
|
Message* msg = new Message(kWinMoveMessage);
|
||||||
msg->addRecipient(this);
|
msg->addRecipient(this);
|
||||||
manager->enqueueMessage(msg);
|
manager->enqueueMessage(msg);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user