[client] message: fix window resize event message handling
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled

This commit is contained in:
Geoffrey McRae
2026-05-31 22:16:02 +10:00
parent 69f44a003d
commit fc6a728bb7

View File

@@ -102,9 +102,13 @@ void lgMessage_process(void)
case LG_MSG_WINDOWSIZE:
{
// retain the last/latest windowsize event
if (windowSize)
if (!windowSize || windowSize->timestamp > event->timestamp)
{
free(windowSize);
windowSize = event;
windowSize = event;
}
else
free(event);
continue;
}
@@ -123,7 +127,7 @@ void lgMessage_process(void)
if (time - windowSize->timestamp < 500000)
{
// requeue the event for later
if (!ll_push(this.list, event))
if (!ll_push(this.list, windowSize))
{
DEBUG_ERROR("Failed to re-queue the windowSize event");
free(windowSize);