mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:47:45 +00:00
Ignore WM_Invalidate events if there is an unprocessed one in the queue.
This commit is contained in:
parent
1c63a37bc9
commit
36e0ab3f18
1 changed files with 13 additions and 1 deletions
|
@ -74,11 +74,23 @@ int WSEventLoop::exec()
|
||||||
|
|
||||||
void WSEventLoop::post_event(WSEventReceiver* receiver, OwnPtr<WSEvent>&& event)
|
void WSEventLoop::post_event(WSEventReceiver* receiver, OwnPtr<WSEvent>&& event)
|
||||||
{
|
{
|
||||||
//ASSERT_INTERRUPTS_ENABLED();
|
ASSERT_INTERRUPTS_ENABLED();
|
||||||
LOCKER(m_lock);
|
LOCKER(m_lock);
|
||||||
#ifdef WSEVENTLOOP_DEBUG
|
#ifdef WSEVENTLOOP_DEBUG
|
||||||
dbgprintf("WSEventLoop::post_event: {%u} << receiver=%p, event=%p\n", m_queued_events.size(), receiver, event.ptr());
|
dbgprintf("WSEventLoop::post_event: {%u} << receiver=%p, event=%p\n", m_queued_events.size(), receiver, event.ptr());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (event->type() == WSEvent::WM_Invalidate) {
|
||||||
|
for (auto& queued_event : m_queued_events) {
|
||||||
|
if (receiver == queued_event.receiver && queued_event.event->type() == WSEvent::WM_Invalidate) {
|
||||||
|
#ifdef WSEVENTLOOP_DEBUG
|
||||||
|
dbgprintf("Swallow WM_Invalidate\n");
|
||||||
|
#endif
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_queued_events.append({ receiver, move(event) });
|
m_queued_events.append({ receiver, move(event) });
|
||||||
|
|
||||||
if (current != m_server_process)
|
if (current != m_server_process)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue