As explained at
Two GDK_KEY_PRESS events (A and B) were in the GTK event queue. GtkInstance::AnyInput consumed only A, because it broke from the first while loop as soon as it saw the first event of appropriate type. In the second while loop it put A back on the end of the GTK event loop, so that it now followed B. GtkSalFrame::signalKey (vcl/unx/gtk3/gtk3gtkframe.cxx) thus received the events in the wrong order.
Dropping the "break" also reveals that GtkInstance::AnyInput should obviously use a queue (i.e., deque) rather than a stack to hold the events it consumed and needs to re-enqueue.
This appears to be a regression introduced with 658954e8b50fc264428402dc5a95b0d6f690d191 "Resolves: fdo#48011 writer idle-callbacks are halting when events pending".
Change-Id: I87d601df118a20ea3dd59e9cebbcf5176db04be8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94202
a9a19777d53b Keep order of GDK input events intact
vcl/unx/gtk3/gtk3gtkinst.cxx | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)