diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2021-10-15 04:46:46 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2021-10-15 04:46:46 +0300 |
commit | 50679b111d10b21dae655123b219d51e5f5b17ef (patch) | |
tree | 80f52f22c8c9046258be4f4b9a24b5bcfb0592f0 /src/interface-gtk | |
parent | 3bafc5df177159a3fc888f8f0b8888574362bd20 (diff) | |
download | sciteco-50679b111d10b21dae655123b219d51e5f5b17ef.tar.gz |
Gtk: solve the key-repeat problem once and for all (or improved on it at least)
* Keeping a key pressed could still result in missing graphics updates and thus
visual feedback.
* Now try to process all Gdk events after thawing the window.
It no longer appears to happen.
* On the downside, key processing is much slower now which may result
in keys being queued up and processed some time even after releasing it.
There may be workarounds for that as well...
Diffstat (limited to 'src/interface-gtk')
-rw-r--r-- | src/interface-gtk/interface.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/interface-gtk/interface.c b/src/interface-gtk/interface.c index a6369f1..154c950 100644 --- a/src/interface-gtk/interface.c +++ b/src/interface-gtk/interface.c @@ -1189,7 +1189,8 @@ teco_interface_key_pressed_cb(GtkWidget *widget, GdkEventKey *event, gpointer us * This should give the UI a chance to update after every keypress. * Would also be possible but tricky to implement with an idle watcher. */ - gtk_main_iteration_do(FALSE); + while (gtk_events_pending()) + gtk_main_iteration_do(FALSE); } while (!g_queue_is_empty(teco_interface.event_queue)); recursed = FALSE; |