Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@RecursiveG
Copy link

According to https://www.x.org/releases/current/doc/man/man3/XFilterEvent.3.xhtml,
an event should be discarded if XFilterEvent returns True. Fix #1794.

@daipom
Copy link

daipom commented Jun 24, 2022

This fix is necessary for input-method to work properly on X11. (#2130)

Since I thought I would need to make this kind of fix in #2130, I checked the behavior regarding this.
This fix only changes the timing of calling _glfwInputKey.

A simple key-press of a key consists of 6 events as follows.
(I added some debug-prints to x11_window.c and used tests/events.c to confirm the behavior)

Env: Ubuntu 20.04 LTS, X11, ibus

Without this fix:

-- 1st event --
XFilterEvent: TRUE
Event-type: KeyPress
00000006 to 1 at 2.546: Key 0x0041 Scancode 0x0026 (A) (a) (with no mods) was pressed
-- 2st event --
XFilterEvent: TRUE
Skipped since XFindContext == 0
-- 3st event --
XFilterEvent: FALSE
Event-type: KeyPress
00000007 to 1 at 2.549: Character 0x00000061 (a) input
-- 4st event --
XFilterEvent: TRUE
Event-type: KeyRelease
00000008 to 1 at 2.624: Key 0x0041 Scancode 0x0026 (A) (a) (with no mods) was released
-- 5st event --
XFilterEvent: TRUE
Skipped since XFindContext == 0
-- 6st event --
XFilterEvent: FALSE
Event-type: KeyRelease

With this fix:

-- 1st event --
XFilterEvent: TRUE
Skipped by this fix
-- 2st event --
XFilterEvent: TRUE
Skipped by this fix
-- 3st event --
XFilterEvent: FALSE
Event-type: KeyPress
00000020 to 1 at 26.553: Key 0x0041 Scancode 0x0026 (A) (a) (with no mods) was pressed
00000021 to 1 at 26.553: Character 0x00000061 (a) input
-- 4st event --
XFilterEvent: TRUE
Skipped by this fix
-- 5st event --
XFilterEvent: TRUE
Skipped by this fix
-- 6st event --
XFilterEvent: FALSE
00000022 to 1 at 26.651: Key 0x0041 Scancode 0x0026 (A) (a) (with no mods) was released

Thus, this fix ensures that _glfwInputKey and _glfwInputChar occur simultaneously in a single glfwPollEvents or glfwWaitEvents, as mentioned in #1794.

This fix does not affect the repeat logic.

While it may affect several events other than KeyPress/Release, we should not process the filtered events without a special reason. (https://www.x.org/releases/current/doc/libX11/libX11/libX11.html#Event_Filtering_b)

@daipom
Copy link

daipom commented Jun 24, 2022

We can remove this if.

glfw/src/x11_window.c

Lines 1286 to 1318 in 679106e

if (!filtered)
{
int count;
Status status;
char buffer[100];
char* chars = buffer;
count = Xutf8LookupString(window->x11.ic,
&event->xkey,
buffer, sizeof(buffer) - 1,
NULL, &status);
if (status == XBufferOverflow)
{
chars = _glfw_calloc(count + 1, 1);
count = Xutf8LookupString(window->x11.ic,
&event->xkey,
chars, count,
NULL, &status);
}
if (status == XLookupChars || status == XLookupBoth)
{
const char* c = chars;
chars[count] = '\0';
while (c - chars < count)
_glfwInputChar(window, decodeUTF8(&c), mods, plain);
}
if (chars != buffer)
_glfw_free(chars);
}
}

We can remove this too.

glfw/src/x11_window.c

Lines 1559 to 1560 in 679106e

if (filtered)
return;

daipom added a commit to clear-code/glfw that referenced this pull request Nov 22, 2022
This commit re-organizes 7d288f1.

* Load missing XIM related function symbols.
* Generalize platform-specific features to _GLFWplatform.
* Change the defalut input style to over-the-spot style.
* Rename `decodeUTF8()` to `_glfwDecodeUTF8()` to make it as internal API.
    * It will be also needed to implment input method for Wayland.
* Refactor code shapes and variable names.

About over-the-spot style and on-the-spot style on X11:

* In over-the-spot mode, almost all APIs are disabled since applications only
  need to specify the preedit candidate window position by `glfwSetPreeditCursorPos()`.
* We can change the style by enabling `GLFW_X11_ONTHESPOT` init hint, but it
  has the following problems.
    * Status APIs don't work because status callbacks don't work.
      (at least in my ibus environment).
    * Can't specify the candidate window position.

Known problems:

* Some keys (arrow, Enter, BackSpace, ...) are passed to applications during preediting.
    * This will be fixed in PR glfw#1972 : glfw#1972

Co-authored-by: Takuro Ashie <[email protected]>
daipom added a commit to clear-code/glfw that referenced this pull request Nov 29, 2022
This commit re-organizes 9875657.

* Load missing XIM related function symbols.
* Generalize platform-specific features to _GLFWplatform.
* Change the defalut input style to over-the-spot style.
* Rename `decodeUTF8()` to `_glfwDecodeUTF8()` to make it as internal API.
    * It will be also needed to implment input method for Wayland.
* Refactor code shapes and variable names.

About over-the-spot style and on-the-spot style on X11:

* In over-the-spot mode, almost all APIs are disabled since applications only
  need to specify the preedit candidate window position by `glfwSetPreeditCursorPos()`.
* We can change the style by enabling `GLFW_X11_ONTHESPOT` init hint, but it
  has the following problems.
    * Status APIs don't work because status callbacks don't work.
      (at least in my ibus environment).
    * Can't specify the candidate window position.

Known problems:

* Some keys (arrow, Enter, BackSpace, ...) are passed to applications during preediting.
    * This will be fixed in PR glfw#1972 : glfw#1972

Co-authored-by: Takuro Ashie <[email protected]>
daipom added a commit to clear-code/glfw that referenced this pull request Nov 30, 2022
This commit re-organizes 0e79a0b.

* Load missing XIM related function symbols.
* Generalize platform-specific features to _GLFWplatform.
* Change the defalut input style to over-the-spot style.
* Rename `decodeUTF8()` to `_glfwDecodeUTF8()` to make it as internal API.
    * It will be also needed to implment input method for Wayland.
* Refactor code shapes and variable names.

About over-the-spot style and on-the-spot style on X11:

* In over-the-spot mode, almost all APIs are disabled since applications only
  need to specify the preedit candidate window position by `glfwSetPreeditCursorPos()`.
* We can change the style by enabling `GLFW_X11_ONTHESPOT` init hint, but it
  has the following problems.
    * Status APIs don't work because status callbacks don't work.
      (at least in my ibus environment).
    * Can't specify the candidate window position.

Known problems:

* Some keys (arrow, Enter, BackSpace, ...) are passed to applications during preediting.
    * This will be fixed in PR glfw#1972 : glfw#1972

Co-authored-by: Takuro Ashie <[email protected]>
daipom added a commit to clear-code/glfw that referenced this pull request Nov 30, 2022
This commit re-organizes 97ce3e5.

* Load missing XIM related function symbols.
* Generalize platform-specific features to _GLFWplatform.
* Change the defalut input style to over-the-spot style.
* Rename `decodeUTF8()` to `_glfwDecodeUTF8()` to make it as internal API.
    * It will be also needed to implment input method for Wayland.
* Refactor code shapes and variable names.

About over-the-spot style and on-the-spot style on X11:

* In over-the-spot mode, almost all APIs are disabled since applications only
  need to specify the preedit candidate window position by `glfwSetPreeditCursorPos()`.
* We can change the style by enabling `GLFW_X11_ONTHESPOT` init hint, but it
  has the following problems.
    * Status APIs don't work because status callbacks don't work.
      (at least in my ibus environment).
    * Can't specify the candidate window position.

Known problems:

* Some keys (arrow, Enter, BackSpace, ...) are passed to applications during preediting.
    * This will be fixed in PR glfw#1972 : glfw#1972

Co-authored-by: Takuro Ashie <[email protected]>
daipom added a commit to clear-code/glfw that referenced this pull request Dec 6, 2022
This commit re-organizes 748ae5d.

* Load missing XIM related function symbols.
* Generalize platform-specific features to _GLFWplatform.
* Change the defalut input style to over-the-spot style.
* Rename `decodeUTF8()` to `_glfwDecodeUTF8()` to make it as internal API.
    * It will be also needed to implment input method for Wayland.
* Refactor code shapes and variable names.

About over-the-spot style and on-the-spot style on X11:

* In over-the-spot mode, almost all APIs are disabled since applications only
  need to specify the preedit candidate window position by `glfwSetPreeditCursorPos()`.
* We can change the style by enabling `GLFW_X11_ONTHESPOT` init hint, but it
  has the following problems.
    * Status APIs don't work because status callbacks don't work.
      (at least in my ibus environment).
    * Can't specify the candidate window position.

Known problems:

* Some keys (arrow, Enter, BackSpace, ...) are passed to applications during preediting.
    * This will be fixed in PR glfw#1972 : glfw#1972

Co-authored-by: Takuro Ashie <[email protected]>
daipom added a commit to clear-code/glfw that referenced this pull request Dec 8, 2022
This fix is based on glfw#1972 by @RecursiveG.

This prevents key events for IME from being propagated to an
application.
daipom added a commit to clear-code/glfw that referenced this pull request Dec 13, 2022
This commit re-organizes 5fe385f.

* Load missing XIM related function symbols.
* Generalize platform-specific features to _GLFWplatform.
* Change the defalut input style to over-the-spot style.
* Rename `decodeUTF8()` to `_glfwDecodeUTF8()` to make it as internal API.
    * It will be also needed to implment input method for Wayland.
* Refactor code shapes and variable names.

About over-the-spot style and on-the-spot style on X11:

* In over-the-spot mode, almost all APIs are disabled since applications only
  need to specify the preedit candidate window position by `glfwSetPreeditCursorPos()`.
* We can change the style by enabling `GLFW_X11_ONTHESPOT` init hint, but it
  has the following problems.
    * Status APIs don't work because status callbacks don't work.
      (at least in my ibus environment).
    * Can't specify the candidate window position.

Known problems:

* Some keys (arrow, Enter, BackSpace, ...) are passed to applications during preediting.
    * This will be fixed in PR glfw#1972 : glfw#1972

Co-authored-by: Takuro Ashie <[email protected]>
daipom added a commit to clear-code/glfw that referenced this pull request Dec 14, 2022
This fix is based on glfw#1972 by @RecursiveG.

This prevents key events for IME from being propagated to an
application.
daipom added a commit to clear-code/glfw that referenced this pull request Dec 14, 2022
This commit re-organizes a63dc07.

* Load missing XIM related function symbols.
* Generalize platform-specific features to _GLFWplatform.
* Change the defalut input style to over-the-spot style.
* Rename `decodeUTF8()` to `_glfwDecodeUTF8()` to make it as internal API.
    * It will be also needed to implment input method for Wayland.
* Refactor code shapes and variable names.

About over-the-spot style and on-the-spot style on X11:

* In over-the-spot mode, almost all APIs are disabled since applications only
  need to specify the preedit candidate window position by `glfwSetPreeditCursorPos()`.
* We can change the style by enabling `GLFW_X11_ONTHESPOT` init hint, but it
  has the following problems.
    * Status APIs don't work because status callbacks don't work.
      (at least in my ibus environment).
    * Can't specify the candidate window position.

Known problems:

* Some keys (arrow, Enter, BackSpace, ...) are passed to applications during preediting.
    * This will be fixed in PR glfw#1972 : glfw#1972

Co-authored-by: Takuro Ashie <[email protected]>
daipom added a commit to clear-code/glfw that referenced this pull request Dec 14, 2022
This fix is based on glfw#1972 by @RecursiveG.

This prevents key events for IME from being propagated to an
application.
daipom added a commit to clear-code/glfw that referenced this pull request Dec 15, 2022
This commit re-organizes 07702c4.

* Load missing XIM related function symbols.
* Generalize platform-specific features to _GLFWplatform.
* Change the defalut input style to over-the-spot style.
* Rename `decodeUTF8()` to `_glfwDecodeUTF8()` to make it as internal API.
    * It will be also needed to implment input method for Wayland.
* Refactor code shapes and variable names.

About over-the-spot style and on-the-spot style on X11:

* In over-the-spot mode, almost all APIs are disabled since applications only
  need to specify the preedit candidate window position by `glfwSetPreeditCursorPos()`.
* We can change the style by enabling `GLFW_X11_ONTHESPOT` init hint, but it
  has the following problems.
    * Status APIs don't work because status callbacks don't work.
      (at least in my ibus environment).
    * Can't specify the candidate window position.

Known problems:

* Some keys (arrow, Enter, BackSpace, ...) are passed to applications during preediting.
    * This will be fixed in PR glfw#1972 : glfw#1972

Co-authored-by: Takuro Ashie <[email protected]>
daipom added a commit to clear-code/glfw that referenced this pull request Dec 15, 2022
This fix is based on glfw#1972 by @RecursiveG.

This prevents key events for IME from being propagated to an
application.
daipom added a commit to clear-code/glfw that referenced this pull request Dec 15, 2022
This fix is based on glfw#1972 by @RecursiveG.

This prevents key events for IME from being propagated to an
application.
daipom added a commit to clear-code/glfw that referenced this pull request Dec 15, 2022
This fix is based on glfw#1972 by @RecursiveG.

This prevents key events for IME from being propagated to an
application.
daipom added a commit to clear-code/glfw that referenced this pull request Dec 16, 2022
This commit re-organizes cf7618d.

* Load missing XIM related function symbols.
* Generalize platform-specific features to _GLFWplatform.
* Change the defalut input style to over-the-spot style.
* Rename `decodeUTF8()` to `_glfwDecodeUTF8()` to make it as internal API.
    * It will be also needed to implment input method for Wayland.
* Refactor code shapes and variable names.

About over-the-spot style and on-the-spot style on X11:

* In over-the-spot mode, almost all APIs are disabled since applications only
  need to specify the preedit candidate window position by `glfwSetPreeditCursorPos()`.
* We can change the style by enabling `GLFW_X11_ONTHESPOT` init hint, but it
  has the following problems.
    * Status APIs don't work because status callbacks don't work.
      (at least in my ibus environment).
    * Can't specify the candidate window position.

Known problems:

* Some keys (arrow, Enter, BackSpace, ...) are passed to applications during preediting.
    * This will be fixed in PR glfw#1972 : glfw#1972

Co-authored-by: Takuro Ashie <[email protected]>
daipom added a commit to clear-code/glfw that referenced this pull request Jan 13, 2023
This commit re-organizes 6e7f939.

* Load missing XIM related function symbols.
* Generalize platform-specific features to _GLFWplatform.
* Change the defalut input style to over-the-spot style.
* Rename `decodeUTF8()` to `_glfwDecodeUTF8()` to make it as internal API.
    * It will be also needed to implment input method for Wayland.
* Refactor code shapes and variable names.

About over-the-spot style and on-the-spot style on X11:

* In over-the-spot mode, almost all APIs are disabled since applications only
  need to specify the preedit candidate window position by `glfwSetPreeditCursorPos()`.
* We can change the style by enabling `GLFW_X11_ONTHESPOT` init hint, but it
  has the following problems.
    * Status APIs don't work because status callbacks don't work.
      (at least in my ibus environment).
    * Can't specify the candidate window position.

Known problems:

* Some keys (arrow, Enter, BackSpace, ...) are passed to applications during preediting.
    * This will be fixed in PR glfw#1972 : glfw#1972

Co-authored-by: Takuro Ashie <[email protected]>
bjorndm added a commit to bjorndm/glfwff that referenced this pull request Mar 2, 2023
* Apply shibukawa's fix of GLFW for Windows

This fix is based on shibukawa's fix:
  glfw#658
  shibukawa@d36a164

Some minor coding style changes are made, but not yet follow glfw's one,
and some comments doesn't follow recent changes. So further work is
needed.

Co-authored-by: Yoshiki Shibukawa <[email protected]>
Co-authored-by: Takuro Ashie <[email protected]>

* Win32: Support IME

This commit re-organizes 9d9af13.

* Use dynamic load for Imm32.
* Generalize platform-specific features to _GLFWplatform.
* Add caret-position info to preedit-callback.
* Add cursorWidth to preeditCursor and related APIs.
* Handle UTF16 data correctly.
* Handle GCS_RESULTSTR so that committed texts are processed correctly.
* Handle WM_IME_ENDCOMPOSITION to clear preedit.
* Handle WM_IME_SETCONTEXT.
    * https://learn.microsoft.com/en-us/windows/win32/intl/wm-ime-setcontext#remarks
* Refactor code shapes and variable names.

Co-authored-by: Takuro Ashie <[email protected]>

* Apply shibukawa's fix of GLFW for MacOS

This fix is based on shibukawa's fix:
  glfw#658
  shibukawa@d36a164

Co-authored-by: Yoshiki Shibukawa <[email protected]>
Co-authored-by: Takuro Ashie <[email protected]>

* macOS: Support IME

This commit re-organizes 31b12b7.

* Use dynamic load for TIS functions and stop using Carbon.
* Generalize platform-specific features to _GLFWplatform.
* Add caret-position info to preedit-callback.
* Handle UTF16 data correctly.
* Implement `firstRectForCharacterRange:actualRange:` to display preedit candidate window correctly.
* Suppress _glfwInputKey during preediting.
* Ensure preedit cleared after committed.
* Fix wrong length of markedRange.
* Improve IME status APIs.
* Refactor code shapes and variable names.

Co-authored-by: Takuro Ashie <[email protected]>
Co-authored-by: xfangfang <[email protected]>

* Apply shibukawa's fix of GLFW for X11

This fix is based on shibukawa's fix:
  glfw#658

The differences is the following.

* Remove `X_HAVE_UTF8_STRING` branching since the current logic doesn't use it
* Replace `XNDestroyCallback` for `XNPreeditAttributes` in `XCreateIC`

Co-authored-by: Yoshiki Shibukawa <[email protected]>
Co-authored-by: Takuro Ashie <[email protected]>

* X11: Support IME

This commit re-organizes 6e7f939.

* Load missing XIM related function symbols.
* Generalize platform-specific features to _GLFWplatform.
* Change the defalut input style to over-the-spot style.
* Rename `decodeUTF8()` to `_glfwDecodeUTF8()` to make it as internal API.
    * It will be also needed to implment input method for Wayland.
* Refactor code shapes and variable names.

About over-the-spot style and on-the-spot style on X11:

* In over-the-spot mode, almost all APIs are disabled since applications only
  need to specify the preedit candidate window position by `glfwSetPreeditCursorPos()`.
* We can change the style by enabling `GLFW_X11_ONTHESPOT` init hint, but it
  has the following problems.
    * Status APIs don't work because status callbacks don't work.
      (at least in my ibus environment).
    * Can't specify the candidate window position.

Known problems:

* Some keys (arrow, Enter, BackSpace, ...) are passed to applications during preediting.
    * This will be fixed in PR glfw#1972 : glfw#1972

Co-authored-by: Takuro Ashie <[email protected]>

* Wayland: Support text_input_unstable_v3 and text_input_unstable_v1

They are wayland protocols to support input methods:
https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/text-input/text-input-unstable-v3.xml
https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/text-input/text-input-unstable-v1.xml

text_input_unstable_v3 is widely supported by major desktop environment
on GNU/Linux such as GNOME or KDE.

text_input_unstable_v1 isn't so popular but Weston which is the
reference Wayland implementation supports only it and doesn't support
text_input_unstable_v3 so that we also implement it.

* tests: Add tests for IME features

Co-authored-by: Takuro Ashie <[email protected]>

* Apply shibukawa's document fix

This fix is from shibukawa's fix:
  glfw#658
  shibukawa@d36a164

* Doc: Improve document about IME features

* Win32: Support preedit candidate feature

You can use this feature when you need to manage the drawing of the
preedit candidates on the application side.

* Also add contributor of the IM patch.

* Indicate version in new funcion doc comments.

---------

Co-authored-by: Daijiro Fukuda <[email protected]>
Co-authored-by: Yoshiki Shibukawa <[email protected]>
Co-authored-by: Takuro Ashie <[email protected]>
Co-authored-by: xfangfang <[email protected]>
Co-authored-by: Björn DM <[email protected]>
daipom added a commit to clear-code/glfw that referenced this pull request Apr 7, 2023
This commit re-organizes 6e7f939.

* Load missing XIM related function symbols.
* Generalize platform-specific features to _GLFWplatform.
* Change the defalut input style to over-the-spot style.
* Rename `decodeUTF8()` to `_glfwDecodeUTF8()` to make it as internal API.
    * It will be also needed to implment input method for Wayland.
* Refactor code shapes and variable names.

About over-the-spot style and on-the-spot style on X11:

* In over-the-spot mode, almost all APIs are disabled since applications only
  need to specify the preedit candidate window position by `glfwSetPreeditCursorPos()`.
* We can change the style by enabling `GLFW_X11_ONTHESPOT` init hint, but it
  has the following problems.
    * Status APIs don't work because status callbacks don't work.
      (at least in my ibus environment).
    * Can't specify the candidate window position.

Known problems:

* Some keys (arrow, Enter, BackSpace, ...) are passed to applications during preediting.
    * This will be fixed in PR glfw#1972 : glfw#1972

Co-authored-by: Takuro Ashie <[email protected]>
Spasi pushed a commit to LWJGL-CI/glfw that referenced this pull request Dec 2, 2023
Spasi pushed a commit to LWJGL-CI/glfw that referenced this pull request Dec 16, 2023
Spasi pushed a commit to LWJGL-CI/glfw that referenced this pull request Dec 16, 2023
ashie added a commit to clear-code/glfw that referenced this pull request Jan 24, 2024
This commit re-organizes 6e7f939.

* Load missing XIM related function symbols.
* Generalize platform-specific features to _GLFWplatform.
* Change the defalut input style to over-the-spot style.
* Rename `decodeUTF8()` to `_glfwDecodeUTF8()` to make it as internal API.
    * It will be also needed to implment input method for Wayland.
* Refactor code shapes and variable names.

About over-the-spot style and on-the-spot style on X11:

* In over-the-spot mode, almost all APIs are disabled since applications only
  need to specify the preedit candidate window position by `glfwSetPreeditCursorPos()`.
* We can change the style by enabling `GLFW_X11_ONTHESPOT` init hint, but it
  has the following problems.
    * Status APIs don't work because status callbacks don't work.
      (at least in my ibus environment).
    * Can't specify the candidate window position.

Known problems:

* Some keys (arrow, Enter, BackSpace, ...) are passed to applications during preediting.
    * This will be fixed in PR glfw#1972 : glfw#1972

Co-authored-by: Takuro Ashie <[email protected]>
ashie added a commit to clear-code/glfw that referenced this pull request Jan 31, 2024
This commit re-organizes 6e7f939.

* Load missing XIM related function symbols.
* Generalize platform-specific features to _GLFWplatform.
* Change the defalut input style to over-the-spot style.
* Rename `decodeUTF8()` to `_glfwDecodeUTF8()` to make it as internal API.
    * It will be also needed to implment input method for Wayland.
* Refactor code shapes and variable names.

About over-the-spot style and on-the-spot style on X11:

* In over-the-spot mode, almost all APIs are disabled since applications only
  need to specify the preedit candidate window position by `glfwSetPreeditCursorPos()`.
* We can change the style by enabling `GLFW_X11_ONTHESPOT` init hint, but it
  has the following problems.
    * Status APIs don't work because status callbacks don't work.
      (at least in my ibus environment).
    * Can't specify the candidate window position.

Known problems:

* Some keys (arrow, Enter, BackSpace, ...) are passed to applications during preediting.
    * This will be fixed in PR glfw#1972 : glfw#1972

Co-authored-by: Takuro Ashie <[email protected]>
ashie added a commit to clear-code/glfw that referenced this pull request Feb 19, 2024
This commit re-organizes 6e7f939.

* Load missing XIM related function symbols.
* Generalize platform-specific features to _GLFWplatform.
* Change the defalut input style to over-the-spot style.
* Rename `decodeUTF8()` to `_glfwDecodeUTF8()` to make it as internal API.
    * It will be also needed to implment input method for Wayland.
* Refactor code shapes and variable names.

About over-the-spot style and on-the-spot style on X11:

* In over-the-spot mode, almost all APIs are disabled since applications only
  need to specify the preedit candidate window position by `glfwSetPreeditCursorPos()`.
* We can change the style by enabling `GLFW_X11_ONTHESPOT` init hint, but it
  has the following problems.
    * Status APIs don't work because status callbacks don't work.
      (at least in my ibus environment).
    * Can't specify the candidate window position.

Known problems:

* Some keys (arrow, Enter, BackSpace, ...) are passed to applications during preediting.
    * This will be fixed in PR glfw#1972 : glfw#1972

Co-authored-by: Takuro Ashie <[email protected]>
ashie added a commit to clear-code/glfw that referenced this pull request Feb 20, 2024
This commit re-organizes 6e7f939.

* Load missing XIM related function symbols.
* Generalize platform-specific features to _GLFWplatform.
* Change the defalut input style to over-the-spot style.
* Rename `decodeUTF8()` to `_glfwDecodeUTF8()` to make it as internal API.
    * It will be also needed to implment input method for Wayland.
* Refactor code shapes and variable names.

About over-the-spot style and on-the-spot style on X11:

* In over-the-spot mode, almost all APIs are disabled since applications only
  need to specify the preedit candidate window position by `glfwSetPreeditCursorPos()`.
* We can change the style by enabling `GLFW_X11_ONTHESPOT` init hint, but it
  has the following problems.
    * Status APIs don't work because status callbacks don't work.
      (at least in my ibus environment).
    * Can't specify the candidate window position.

Known problems:

* Some keys (arrow, Enter, BackSpace, ...) are passed to applications during preediting.
    * This will be fixed in PR glfw#1972 : glfw#1972

Co-authored-by: Takuro Ashie <[email protected]>
ashie added a commit to clear-code/glfw that referenced this pull request Mar 11, 2024
This commit re-organizes 6e7f939.

* Load missing XIM related function symbols.
* Generalize platform-specific features to _GLFWplatform.
* Change the defalut input style to over-the-spot style.
* Rename `decodeUTF8()` to `_glfwDecodeUTF8()` to make it as internal API.
    * It will be also needed to implment input method for Wayland.
* Refactor code shapes and variable names.

About over-the-spot style and on-the-spot style on X11:

* In over-the-spot mode, almost all APIs are disabled since applications only
  need to specify the preedit candidate window position by `glfwSetPreeditCursorPos()`.
* We can change the style by enabling `GLFW_X11_ONTHESPOT` init hint, but it
  has the following problems.
    * Status APIs don't work because status callbacks don't work.
      (at least in my ibus environment).
    * Can't specify the candidate window position.

Known problems:

* Some keys (arrow, Enter, BackSpace, ...) are passed to applications during preediting.
    * This will be fixed in PR glfw#1972 : glfw#1972

Co-authored-by: Takuro Ashie <[email protected]>
ashie added a commit to clear-code/glfw that referenced this pull request Mar 19, 2024
This commit re-organizes 6e7f939.

* Load missing XIM related function symbols.
* Generalize platform-specific features to _GLFWplatform.
* Change the defalut input style to over-the-spot style.
* Rename `decodeUTF8()` to `_glfwDecodeUTF8()` to make it as internal API.
    * It will be also needed to implment input method for Wayland.
* Refactor code shapes and variable names.

About over-the-spot style and on-the-spot style on X11:

* In over-the-spot mode, almost all APIs are disabled since applications only
  need to specify the preedit candidate window position by `glfwSetPreeditCursorPos()`.
* We can change the style by enabling `GLFW_X11_ONTHESPOT` init hint, but it
  has the following problems.
    * Status APIs don't work because status callbacks don't work.
      (at least in my ibus environment).
    * Can't specify the candidate window position.

Known problems:

* Some keys (arrow, Enter, BackSpace, ...) are passed to applications during preediting.
    * This will be fixed in PR glfw#1972 : glfw#1972

Co-authored-by: Takuro Ashie <[email protected]>
ashie added a commit to clear-code/glfw that referenced this pull request Apr 1, 2024
This commit re-organizes 6e7f939.

* Load missing XIM related function symbols.
* Generalize platform-specific features to _GLFWplatform.
* Change the defalut input style to over-the-spot style.
* Rename `decodeUTF8()` to `_glfwDecodeUTF8()` to make it as internal API.
    * It will be also needed to implment input method for Wayland.
* Refactor code shapes and variable names.

About over-the-spot style and on-the-spot style on X11:

* In over-the-spot mode, almost all APIs are disabled since applications only
  need to specify the preedit candidate window position by `glfwSetPreeditCursorPos()`.
* We can change the style by enabling `GLFW_X11_ONTHESPOT` init hint, but it
  has the following problems.
    * Status APIs don't work because status callbacks don't work.
      (at least in my ibus environment).
    * Can't specify the candidate window position.

Known problems:

* Some keys (arrow, Enter, BackSpace, ...) are passed to applications during preediting.
    * This will be fixed in PR glfw#1972 : glfw#1972

Co-authored-by: Takuro Ashie <[email protected]>
Spasi pushed a commit to LWJGL-CI/glfw that referenced this pull request May 6, 2024
Spasi pushed a commit to LWJGL-CI/glfw that referenced this pull request May 7, 2024
Spasi pushed a commit to LWJGL-CI/glfw that referenced this pull request May 7, 2024
Spasi pushed a commit to LWJGL-CI/glfw that referenced this pull request May 7, 2024
Spasi pushed a commit to LWJGL-CI/glfw that referenced this pull request Jul 13, 2024
Spasi pushed a commit to LWJGL-CI/glfw that referenced this pull request Dec 7, 2024
dragonflylee pushed a commit to dragonflylee/glfw that referenced this pull request Jan 3, 2025
This commit re-organizes 6e7f939.

* Load missing XIM related function symbols.
* Generalize platform-specific features to _GLFWplatform.
* Change the defalut input style to over-the-spot style.
* Rename `decodeUTF8()` to `_glfwDecodeUTF8()` to make it as internal API.
    * It will be also needed to implment input method for Wayland.
* Refactor code shapes and variable names.

About over-the-spot style and on-the-spot style on X11:

* In over-the-spot mode, almost all APIs are disabled since applications only
  need to specify the preedit candidate window position by `glfwSetPreeditCursorPos()`.
* We can change the style by enabling `GLFW_X11_ONTHESPOT` init hint, but it
  has the following problems.
    * Status APIs don't work because status callbacks don't work.
      (at least in my ibus environment).
    * Can't specify the candidate window position.

Known problems:

* Some keys (arrow, Enter, BackSpace, ...) are passed to applications during preediting.
    * This will be fixed in PR glfw#1972 : glfw#1972

Co-authored-by: Takuro Ashie <[email protected]>
ashie added a commit to clear-code/glfw that referenced this pull request Jan 14, 2025
This commit re-organizes 6e7f939.

* Load missing XIM related function symbols.
* Generalize platform-specific features to _GLFWplatform.
* Change the defalut input style to over-the-spot style.
* Rename `decodeUTF8()` to `_glfwDecodeUTF8()` to make it as internal API.
    * It will be also needed to implment input method for Wayland.
* Refactor code shapes and variable names.

About over-the-spot style and on-the-spot style on X11:

* In over-the-spot mode, almost all APIs are disabled since applications only
  need to specify the preedit candidate window position by `glfwSetPreeditCursorPos()`.
* We can change the style by enabling `GLFW_X11_ONTHESPOT` init hint, but it
  has the following problems.
    * Status APIs don't work because status callbacks don't work.
      (at least in my ibus environment).
    * Can't specify the candidate window position.

Known problems:

* Some keys (arrow, Enter, BackSpace, ...) are passed to applications during preediting.
    * This will be fixed in PR glfw#1972 : glfw#1972

Co-authored-by: Takuro Ashie <[email protected]>
Spasi pushed a commit to LWJGL-CI/glfw that referenced this pull request Jan 15, 2025
@j-romchain
Copy link

why hasn't this been merged yet???

@j-romchain
Copy link

it says there are no conflicts and its just been sitting here for YEARS without merging, why?

dougbinks pushed a commit to dougbinks/glfw that referenced this pull request Aug 19, 2025
This commit re-organizes 6e7f939.

* Load missing XIM related function symbols.
* Generalize platform-specific features to _GLFWplatform.
* Change the defalut input style to over-the-spot style.
* Rename `decodeUTF8()` to `_glfwDecodeUTF8()` to make it as internal API.
    * It will be also needed to implment input method for Wayland.
* Refactor code shapes and variable names.

About over-the-spot style and on-the-spot style on X11:

* In over-the-spot mode, almost all APIs are disabled since applications only
  need to specify the preedit candidate window position by `glfwSetPreeditCursorPos()`.
* We can change the style by enabling `GLFW_X11_ONTHESPOT` init hint, but it
  has the following problems.
    * Status APIs don't work because status callbacks don't work.
      (at least in my ibus environment).
    * Can't specify the candidate window position.

Known problems:

* Some keys (arrow, Enter, BackSpace, ...) are passed to applications during preediting.
    * This will be fixed in PR glfw#1972 : glfw#1972

Co-authored-by: Takuro Ashie <[email protected]>
dougbinks pushed a commit to dougbinks/glfw that referenced this pull request Aug 19, 2025
This commit re-organizes 6e7f939.

* Load missing XIM related function symbols.
* Generalize platform-specific features to _GLFWplatform.
* Change the defalut input style to over-the-spot style.
* Rename `decodeUTF8()` to `_glfwDecodeUTF8()` to make it as internal API.
    * It will be also needed to implment input method for Wayland.
* Refactor code shapes and variable names.

About over-the-spot style and on-the-spot style on X11:

* In over-the-spot mode, almost all APIs are disabled since applications only
  need to specify the preedit candidate window position by `glfwSetPreeditCursorPos()`.
* We can change the style by enabling `GLFW_X11_ONTHESPOT` init hint, but it
  has the following problems.
    * Status APIs don't work because status callbacks don't work.
      (at least in my ibus environment).
    * Can't specify the candidate window position.

Known problems:

* Some keys (arrow, Enter, BackSpace, ...) are passed to applications during preediting.
    * This will be fixed in PR glfw#1972 : glfw#1972

Co-authored-by: Takuro Ashie <[email protected]>
@lixiangwuxian
Copy link

lixiangwuxian commented Oct 17, 2025

Is glfw not actively maintained anymore?
Seems fyne in x11 need this patch to make ime works functionally.
@elmindreda may a review please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Key callback and char callback are called on different polls on some Linux machines

5 participants