From 5dc3fec277aa543b2cdb2305f56bc2ac15efa8e4 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 6 Nov 2022 12:20:11 +0100 Subject: Matrix/4chan: fix text input not being in order if typing text fast (for example xdotool --- depends/mglpp | 2 +- src/Text.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/depends/mglpp b/depends/mglpp index d04c987..0108af4 160000 --- a/depends/mglpp +++ b/depends/mglpp @@ -1 +1 @@ -Subproject commit d04c98708fd46524c0861baf65e9e4ff62d48792 +Subproject commit 0108af496da089dbee70ce80d778dfb5c238460b diff --git a/src/Text.cpp b/src/Text.cpp index 0b6347d..26574bf 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -1289,6 +1289,15 @@ namespace QuickMedia dirtyText = true; dirtyCaret = true; } + + // TODO: Dont do this here! it's slow, but it's needed to process the change before the next event + updateGeometry(); + + if(editable && (dirtyCaret || caretMoveDirection != CaretMoveDirection::NONE)) { + updateCaret(); + dirtyCaret = false; + caretMoveDirection = CaretMoveDirection::NONE; + } } bool Text::draw(mgl::Window &target) -- cgit v1.2.3