-
Notifications
You must be signed in to change notification settings - Fork 651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GTK regression: ibus 1.5.31 dead keys on Wayland broken #5494
Comments
I haven't confirmed this but multiple people have reported it, so we should look at it for 1.1.1 |
It also breaks if ibus/fcitx aren't installed/used, and I assume 1.1.0 didn't intend to introduce ibus as a hard dependency. Also running arch + wayland (hyprland), so no GNOME. |
Indeed there is a regression with the |
I'm running GNOME on Wayland without |
In the case of IMContextSimple, I suspect the input does not get committed here: With ibus 1.5.27-5 from Debian, I have an ugly workaround that seems to fix it in my environment (it probably breaks some others, ask a professional before using it), FWIW: --- a/src/apprt/gtk/Surface.zig
+++ b/src/apprt/gtk/Surface.zig
@@ -1932,23 +1932,7 @@ fn gtkInputCommit(
const self = userdataSelf(ud.?);
const str = std.mem.sliceTo(bytes, 0);
- // If we're in a keyEvent (i.e. a keyboard event) and we're not composing,
- // then this is just a normal key press resulting in UTF-8 text. We
- // want the keyEvent to handle this so that the UTF-8 text can be associated
- // with a keyboard event.
- if (!self.im_composing and self.in_keyevent) {
- if (str.len > self.im_buf.len) {
- log.warn("not enough buffer space for input method commit", .{});
- return;
- }
-
- // Copy our committed text to the buffer
- @memcpy(self.im_buf[0..str.len], str);
- self.im_len = @intCast(str.len);
-
- // log.debug("input commit len={}", .{self.im_len});
- return;
- }
+ if (str.len == 0) return;
// If we reach this point from above it means we're composing OR
// not in a keypress. In either case, we want to commit the text |
It seems that the bug can be reproduced just by stopping the ibus daemon ( Searching for the cause, I found out that, when ibus is off, the dead key commit is treated as a normal key commit like pressing The solution I found is this: --- a/src/apprt/gtk/Surface.zig
+++ b/src/apprt/gtk/Surface.zig
@@ -1713,7 +1713,7 @@ pub fn keyEvent(
// Example: enable Japanese input method, press "konn" and then
// press enter. The final enter should not be encoded and "konn"
// (in hiragana) should be written as "こん".
- if (was_composing) return true;
+ if (was_composing and self.im_len == 0) return true;
// Not composing and our input method buffer is empty. This could
// mean that the input method reacted to this event by activating |
happening on Cosmic popos (wayland) as well
|
[Gnome on Wayland; Arch Linux] my CTRL + shift + T shortcut for toggling window decorations stopped working with |
I confirm that this patch fixes the issue on my Gentoo system. Thanks @Diego-0110! |
Also noticing this issue on GNOME + Wayland without ibus installed. All dead keys have stopped working after upgrading to |
no wayland here still eats up the `in nixos. |
I confirm that this patch resolves the same issue on swaywm on Fedora.
|
I ran into the same issue, somehow decided to bisect before looking at similar issues (actually, no, but didn't think I had the problem for all dead keys, I only noticed it when trying a Config: EndeavourOS, no Bisect result was this commit: 52936b9b681e92f7bab37c3ec341be0013f591da (if that can help). |
Okay looking into this. Someone may have stated this earlier I didn't read all the comments. I'm going to look into ibus 1.5.31 and no ibus separately. Starting with no ibus because it's easier to just stop it. Here are the GTK events (no Ghostty stuff here): With no ibus on Wayland (broken):
With ibus (1.5.30) on Wayland (working):
Lord. |
Fixes #5494 When ibus/fcitx is not running (the GTK "simple" input method is active), the preedit end event triggers _before_ the commit event. For both ibus/fcitx, the opposite is true. We were relying on this ordering. This commit changes the GTK input handling to not rely on this ordering. Instead, we encode our composing state into the boolean state of whether a key event is pressed. This happens before ANY input method events are triggered. Tested dead key handling on: X11/Wayland, ibus/fcitx/none.
Fix up in #5550 |
Fixes #5494 When ibus/fcitx is not running (the GTK "simple" input method is active), the preedit end event triggers _before_ the commit event. For both ibus/fcitx, the opposite is true. We were relying on this ordering. This commit changes the GTK input handling to not rely on this ordering. Instead, we encode our composing state into the boolean state of whether a key event is pressed. This happens before ANY input method events are triggered. Tested dead key handling on: X11/Wayland, ibus/fcitx/none.
Fixes #5494 When ibus/fcitx is not running (the GTK "simple" input method is active), the preedit end event triggers _before_ the commit event. For both ibus/fcitx, the opposite is true. We were relying on this ordering. This commit changes the GTK input handling to not rely on this ordering. Instead, we encode our composing state into the boolean state of whether a key event is pressed. This happens before ANY input method events are triggered. Tested dead key handling on: X11/Wayland, ibus/fcitx/none.
Fixes #5494 When ibus/fcitx is not running (the GTK "simple" input method is active), the preedit end event triggers _before_ the commit event. For both ibus/fcitx, the opposite is true. We were relying on this ordering. This commit changes the GTK input handling to not rely on this ordering. Instead, we encode our composing state into the boolean state of whether a key event is pressed. This happens before ANY input method events are triggered. Tested dead key handling on: X11/Wayland, ibus/fcitx/none.
Fixes #5494 When ibus/fcitx is not running (the GTK "simple" input method is active), the preedit end event triggers _before_ the commit event. For both ibus/fcitx, the opposite is true. We were relying on this ordering. This commit changes the GTK input handling to not rely on this ordering. Instead, we encode our composing state into the boolean state of whether a key event is pressed. This happens before ANY input method events are triggered. Tested dead key handling on: X11/Wayland, ibus/fcitx/none.
Amazing, testing this later. Thank you so much for all you do! ❤️ |
1.1.0 breaks dead keys on ibus
1.5.31
in Hyprland (non-GNOME). The initial modifier character shows but the final character eats up input. Example:I had to downgrade to 1.0.1. I'm running on Arch with the following:
ibus versions:
Other GTK4/Adwaita apps are working fine, so are browsers, etc. I'm running on Hyprland, but I assume this happens in other places too.
I'll try GNOME and report back.EDIT: 1.1.0 works in GNOME, but not Hyprland.So, I kept digging. The difference between GNOME and Hyprland on the same system is that Hyprland doesn't start ibus, so the changes between 1.0.3 and 1.1.0 are dependent on ibus being running. Digging further...
Originally posted by @tomaspinho in #5324 (comment)
The text was updated successfully, but these errors were encountered: