From d1eb9f9843d50847c5559ec7ba4b2e93605dc1b0 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 29 Aug 2014 10:11:25 -0600 Subject: [PATCH] racket/gui gtk: workaround problem with async IBus input method Affects Ubuntu 13.10 and 14.04, especially with multiple processors. original commit: 3a716b98c0c932465a0e9bd75e9086afd75b32d0 --- pkgs/gui-pkgs/gui-lib/mred/private/wx/gtk/queue.rkt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/gui-pkgs/gui-lib/mred/private/wx/gtk/queue.rkt b/pkgs/gui-pkgs/gui-lib/mred/private/wx/gtk/queue.rkt index 184e2b34..026c00d8 100644 --- a/pkgs/gui-pkgs/gui-lib/mred/private/wx/gtk/queue.rkt +++ b/pkgs/gui-pkgs/gui-lib/mred/private/wx/gtk/queue.rkt @@ -24,6 +24,15 @@ ;; ------------------------------------------------------------ ;; Gtk initialization +;; When IBus is used for GtkIMContext (see "canvas.rkt"), recent +;; versions may use a asynchronous mode that somehow doesn't +;; cooperate with `g_main_context_query` Specifically, the +;; asynchronous result doesn't wake up a sleeping Racket main +;; thread, and so the effect of a key is delayed. The following +;; enviornment variable is consulted by IBus on startup to +;; disable asynchronous mode. +(putenv "IBUS_ENABLE_SYNC_MODE" "y") + (define-gtk gtk_init_check (_fun (_ptr io _int) (_ptr io _gcpointer) -> _gboolean)) (define-gdk gdk_set_program_class (_fun _string -> _void))