Skip to content

Instantly share code, notes, and snippets.

@mattn
Last active May 29, 2017 19:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattn/c2dacb314f6f9ea0275f to your computer and use it in GitHub Desktop.
Save mattn/c2dacb314f6f9ea0275f to your computer and use it in GitHub Desktop.
patch to enable XIM on glfw
diff --git a/v3.1/glfw/glfw/src/x11_window.c b/v3.1/glfw/glfw/src/x11_window.c
index 0380b58..560f730 100644
--- a/v3.1/glfw/glfw/src/x11_window.c
+++ b/v3.1/glfw/glfw/src/x11_window.c
@@ -912,12 +912,6 @@ static void processEvent(XEvent *event)
Status status;
wchar_t buffer[16];
- if (XFilterEvent(event, None))
- {
- // Discard intermediary (dead key) events for character input
- break;
- }
-
const int count = XwcLookupString(window->x11.ic,
&event->xkey,
buffer, sizeof(buffer),
@@ -1693,6 +1687,11 @@ void _glfwPlatformPollEvents(void)
{
XEvent event;
XNextEvent(_glfw.x11.display, &event);
+ if (XFilterEvent(&event, None))
+ {
+ continue;
+ }
+
processEvent(&event);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment