-
Notifications
You must be signed in to change notification settings - Fork 169
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
keyboard: do not send any press events which were not sent to the client #2167
Conversation
This is removed in 82275d4. I've just retested, and find the following issues:
This is caused by the following sequence of events:
One reason I removed it is the following sequence of events (this describes what happened before I removed the code, not current behavior; it seems to have changed):
With the |
I thought fcitx5-git was supposed to not do this anymore?? Also if this were to happen, wouldn't switcher exit immediately and not remain active? |
Ok nvm I figured out how to reproduce, now let's figure out what causes it ... |
It should be a bug in fcitx5. After fixing it, this issue is gone. I'll try some days to see if there are other issues. |
Nice catch, thanks for figuring it out ;) |
@lilydjwg Now the switcher test seems to be working even with the whole grab thing reverted. I'll push it to this branch, let me know if it breaks something. If it does, I'll write more tests so that we can catch such bugs automatically in the future :) |
OK, I'll test it soon. |
This prints in detail how we process keyboard key events.
This reverts commit 10fb8cb.
Only xdg-shell popups need the window geometry of their parent added to their position, im-popups are defined as surface-local coords.
9c6fda0
to
47320d5
Compare
I accidentally broke IM popup positioning in master but I pushed a fix to this branch so it should work fine I hope. |
Actually, I am confused. Now it seems like the last commit makes things worse :( |
I haven't tested the last commit yet I think we need to go back if we want to work with upstream fcitx5, which has a commit that recreates the virtual keyboard every time it has text focus. It brings back those key release events. In the long run to avoid these hacks, we may have to give up input method v2 and use input wayland v1 instead. Kwin uses input method v1 and it doesn't have any of these issues. |
:((( I feel like we're chasing a moving target and I'm not really a big fan of this.
+100000000 if it somehow manages to avoid these race conditions. |
I looked briefly at input-method-v1, might be worth supporting that instead of -v2. After all, -v2 is not even officially in wayland-protocols by the looks of it. |
I have some time this evening so I'll try to write a quick prototype for the -v1 protocol and see how it goes. |
The idea is that we try to guess which application the IM wants to send virtual keyboard keys based on the committed serials.
Actually, trying to see how input-method-v1 works made me realize how we might fix input-method-v2. The serials that we have in the protocol basically allow us to almost emulate the same behavior as activation contexts from v1. I tried to implement my idea in the last commit. Hopefully nothing is broken xD |
Also, an explanation of how things 'should' work afaiu:
|
Actually, it still doesn't work for some cases :((( I guess I should just get -v1 to work. |
I haven't got time to test, but there is another issue from fcitx5's change: every time it creates a virtual keyboard, it sends a keymap & repeat_info. This causes wlroots to broadcast them to all clients, and xwayland will spam the log with xkb warnings. I don't want them: I may be able to discard xwayland's stderr, but those repeated broadcast events will cause a lot of noise when debugging. |
With v2 there are two keyboards fighting each other. It's tricky to get things right. In v1 there is only one keyboard so it should be easier to handle. |
Im-v1 is implemented in #2172 |
Superseded by #2172 |
This was erroneously removed in #2113.
@lilydjwg Do you remember why you removed this check? It should definitely be there, because otherwise we send release events to clients who have not received enter events, this is a quick recipe for messing up the client state. I have verified that without this check Wayfire sends extra release events so the check is needed for sure. If this breaks something for IMs, we'll have to figure out a better way to solve the particular problem.
Fixes #2166