feat: add ei_text support#2073
Conversation
539f67d to
be439bf
Compare
9f697c8 to
e3bcccc
Compare
7dfa52e to
f8389e9
Compare
f8389e9 to
a749609
Compare
5ef94bd to
af81aba
Compare
|
This may not be changed by this PR, but testing with https://github.com/pop-os/cosmic-osk, virtual-keyboard input doesn't really seem "isolated"? Shift or caps lock on a physical keyboard seems to capitalize input when pressing a key on the OSK. And holding shift on the OSK likewise affects input on the physical keyboard. That's not supposed to happen here, right? Also, since https://wayland.app/protocols/virtual-keyboard-unstable-v1#zwp_virtual_keyboard_v1:request:modifiers is sent from the client to the server, is the virtual-keyboard protocol not supposed to update the xkb state automatically on handling May need to compare other implementations. |
|
|
||
| let mut guard = self.arc.internal.lock().unwrap(); | ||
| let seat = self.get_seat(data); | ||
| let modifiers = mods_changed.then_some(mods); |
There was a problem hiding this comment.
I guess we also need to pass modifiers to the keyboard grab if the last key press was on a different isolated keyboard state, or non-isolated? (Likewise input_forward for normal input.)
We probably need to track somewhere what the last send modifiers were.
There was a problem hiding this comment.
I added something to track it. It gets reset on set_focus.
`ei_device.region` needs u32 instead of i32. We cast it later. This allows us to later support negative values which is necessary for moving the cursor passed the left edge of the middle screen.
cba6091 to
c952ea8
Compare
I think the idea was that shortcuts that the compositor should intercept (such as super+t) work even if you're holding shift on the physical keyboard. Modifiers otherwise go to the client. But with the latest commit I implemented
Gnome and KDE don't use zwp_virtual_keyboard. I think the only implementation would be wl_roots and it just uses the shared keyboard state for the seat (so do Gnome and KDE with their virtual keyboards). So, maybe for the virtual keyboard we want to do the same as everybody else and share it with the physical keyboard. Also had to add pop-os/cosmic-comp@990525a to make sure esc works in cosmic-osk. What do you think? |
|
Yeah, I guess if Though the client can also use For libei, Gnome is probably the implementation to reference, but hopefully the intended behavior of libei is better specified. |
|
Oh, it's separate from this, but I guess sending |
|
Alright, I'm rewriting everything to be more in line with the protocol and other compositors.
Concerns: The reason we had isolated keyboard stuff, was because if a remote user holds down "super" you can't do anything anymore on your local machine! You can't even click on "quit" (on Rustdesk for example) to kick the remote user off because that just drags the window. You can't type, that would just do all the super+* shortcuts. But apparently that's by design. |
|
I've made some changes to I guess it's not really explicit with libei/xdg-desktop-portal if the modifier state should be independent. Libei itself provides a way to expose devices, but isn't explict about what exactly they represent, and https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.impl.portal.RemoteDesktop.html#org-freedesktop-impl-portal-remotedesktop-connecttoeis doesn't really provide additional details. But we probably want |
|
If we decide we don't need |
Description
Adds
Textcapability to the seat. Also addsTextKeySymandTextUtf8as EiInputEvents.Checklist