Comments (7)
This is a change in fcitx that breaks existing programs. They need to fix it there. At the very least they should not be making breaking changes in minor updates.
As for kitty, you can simply add
wayland_enable_ime no
to workaround it. IME is a god awful hack, that causes endless bugs, increased latency and even application crashes. That's why it was disabled by default under kitty in X11, maybe I should be doing that in Wayland too. Unless you actually need to type East Asian languages using it, I strongly recommend turning it off, or downgrade fcitx5 to whatever version before they introduced this bug.
As for the actual bug, I have no idea why @wengxt thinks it's a kitty issue. wl_keyboard.leave is an event sent by the compositor not the application. So kitty isnt "doing" it. And text input is not triggered by keyboard enter/leave, see the keyboardHandleEnter and keyboardHandleLeave functions. Text input is enabled/disabled by the tex tinput enter and leave functions, see text_input_enter and text_input_leave in wl_text_input.c. And regardless of the number of keyboards in a system, in Wayland I know of no way other than keyboard enter and leave events to track keyboard focus. If you do, please enlighten me.
Maybe @wengxt can explain some more.
I am closing since I dont see how this is a bug in kitty, but feel free to continue posting, I am open to being convinced.
from kitty.
On compositor using zwp input method v2, there may be multiple wl_keyboard objects, one represent the real phyiscal keyboard, one represent the “virtual keyboard object” created by input method.
Input method may choose to create, or delete the virtual keyboard object at literally any time. At least it seems on sway, sway will send a wl_keyboard.leave at that time. I think what sway doing makes totally sense.
What kitty doing wrong here, is that kitty assume that wl_keyboard.leave means the window lost focus. and send text-input-v3.enable/disable.
- wl_keyboard.leave does means window lost focus in some cases, but obviously, not all cases. Especially when there are multiple wl_keyboard objects.
- there is text-input-v3.enter/leave that kitty should be using to trigger focus change for text-input-v3, not wl_keyboard.leave
from kitty.
Briefly reading the existing code,
on wayland text-input-v3.enter/leave should be only source of GLFW_IME_UPDATE_FOCUS. You don't really need to match it with keyboard focus, especially it text-input-v3.enter already carries the surface object.
from kitty.
from kitty.
from kitty.
Sorry I was confused by some app that bind two seat.
Yeah, there's only one wl_keyboard, but maybe then it's sway to be blamed, when there's no focus change but just virtual keyboard got destroyed and it send a wl_keyboard.enter/leave.
Though I can see why sway's doing this, because it want to clear the key pressed state that was once associated with previous keyboard.
But still, the my statement about text-input-v3.enter still holds. IME focus, and keyboard focus are two separate things. If the event you are calling is IME_FOCUS change, then you should stick to ime focus. Or, if you want to assume the keyboard focus is a prerequisite of ime focus, actually that's also fine and is what compositor do. The easiest fix for the issue would be
_glfwPlatformUpdateIMEState, remove the enable/disable in case GLFW_IME_UPDATE_FOCUS, only keep them as a reply to text-input-v3.enter/leave.
hande_text_input_enter() {
text_input_focus = true
// keep existing code here
// send_enter & commit
}
hande_text_input_leave() {
text_input_focus = false
// keep existing code here
}
_glfwPlatformUpdateIMEState
case GLFW_IME_UPDATE_FOCUS:
if text_input_focus:
// Remove the enable/disable() here
set_content_type .... etc
from kitty.
I am OK with changing GLFW_IME_UPDATE_FOCUS to rely on the text
input focus rather than the window focus. That seems harmless, since it
only affects IME handling, and wnt break anything for people not using
the IME.
from kitty.
Related Issues (20)
- I seem to be missing a lot of symbols HOT 5
- Aspect ratio not computed when giving only one of `r` or `c` to display image
- When moving mouse over inactive Kitty windows, text is selected as if the mouse button is pressed HOT 1
- kitty: incorrectly acts like mouse button is pressed HOT 1
- Prompt not visible after resetting the terminal HOT 1
- cursor not hiding in Wayland session HOT 2
- Open new tab next to current instead of at the end of the list of open tabs. HOT 1
- focus_visible_window breaks if interrupted by mouse click
- KITTY_DATA_START dump after second ssh onto server HOT 4
- per window background color HOT 2
- kitty randomly hangs after recent system updating HOT 3
- "map <shoutcut> clear_terminal to_cursor active" doesn't seem to be working properly. HOT 1
- Option for alternate rendering of shade characters HOT 4
- Enter key outputs ^M instead of executing command during apt upgrade prompt HOT 1
- Kitten not matching on tab titles with spaces? HOT 1
- Clarification difference between `show_key` and `show-key` HOT 2
- Feature Request: Foreground opacity HOT 1
- panic in `kitten diff` when running under shpool and scrolling with mouse wheel HOT 5
- test_ssh_copy failure on riscv64 and ppc64el HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kitty.