diff --git a/minigui.d b/minigui.d index c3a3d5a..9c23bca 100644 --- a/minigui.d +++ b/minigui.d @@ -8171,6 +8171,8 @@ class Window : Widget { dispatchCharEvent(e); }, ); + + this.inputProxy.populateXic(); // done //+/ } diff --git a/simpledisplay.d b/simpledisplay.d index efbf9b1..1733a5a 100644 --- a/simpledisplay.d +++ b/simpledisplay.d @@ -14764,17 +14764,7 @@ mixin DynamicLoad!(XRandr, "Xrandr", 2, XRandrLibrarySuccessfullyLoaded) XRandrL // input context //TODO: create this only for top-level windows, and reuse that? - if (XDisplayConnection.xim !is null) { - xic = XCreateIC(XDisplayConnection.xim, - /*XNInputStyle*/"inputStyle".ptr, XIMPreeditNothing|XIMStatusNothing, - /*XNClientWindow*/"clientWindow".ptr, window, - /*XNFocusWindow*/"focusWindow".ptr, window, - null); - if (xic is null) { - import core.stdc.stdio : stderr, fprintf; - fprintf(stderr, "XCreateIC failed for window %u\n", cast(uint)window); - } - } + populateXic(); if (sdpyWindowClassStr is null) loadBinNameToWindowClassName(); if (sdpyWindowClassStr is null) sdpyWindowClass = "DSimpleWindow"; @@ -14947,6 +14937,20 @@ mixin DynamicLoad!(XRandr, "Xrandr", 2, XRandrLibrarySuccessfullyLoaded) XRandrL } } + void populateXic() { + if (XDisplayConnection.xim !is null) { + xic = XCreateIC(XDisplayConnection.xim, + /*XNInputStyle*/"inputStyle".ptr, XIMPreeditNothing|XIMStatusNothing, + /*XNClientWindow*/"clientWindow".ptr, window, + /*XNFocusWindow*/"focusWindow".ptr, window, + null); + if (xic is null) { + import core.stdc.stdio : stderr, fprintf; + fprintf(stderr, "XCreateIC failed for window %u\n", cast(uint)window); + } + } + } + void selectDefaultInput(bool forceIncludeMouseMotion) { auto mask = EventMask.ExposureMask | EventMask.KeyPressMask |