Repository navigation
Conversation
|
Also see Smithay/smithay#2240. I'm not currently planning to test this PR locally, but I'll review the code tonight. |
pgaskin
left a comment
There was a problem hiding this comment.
This is a partial review from just skimming the code, I may have missed things.
Still missing (at least):
- Restoring the original keymap on
DeviceRemoved. - Other input mechanisms (like libei) still don't restore the keymap correctly.
- niri-wm/niri#4738
- libei doesn't get updated modifiers from a vk modifiers request.
Should probably also consider reusing the keymap memfds instead of making a new one each time.
| // Virtual keyboard event generated by IME client | ||
| keyboard | ||
| .input_forward_bypassing_grab(self, keycode, state, serial, time, true); | ||
| return; |
There was a problem hiding this comment.
This skips the numlock and xwayland stuff.
| if let Some((action, pattern)) = keyboard | ||
| .input( |
There was a problem hiding this comment.
Wrong KeyboardSource, need to use the one from the VK.
| if keyboard.is_grabbed() | ||
| && !(keyboard.has_grab(serial) | ||
| || keyboard.has_grab(grab.previous_serial().unwrap_or(serial))) | ||
| && !keyboard | ||
| .with_grab(|_, g| g.is::<InputMethodKeyboardGrab>()) | ||
| .unwrap_or(false) | ||
| { | ||
| grab.ungrab(PopupUngrabStrategy::All); | ||
| return; | ||
| } | ||
| Shell::set_focus( | ||
| self, | ||
| grab.current_grab().as_ref(), | ||
| &seat, | ||
| Some(serial), | ||
| false, | ||
| ); | ||
| keyboard.set_grab(self, PopupKeyboardGrab::new(&grab), serial); |
There was a problem hiding this comment.
Popup/IME grab replaces each other (last one wins); in niri, the IME grab takes precedence. Up to you.
There was a problem hiding this comment.
Without this change on cosmic-comp (unlike niri), popups are immediately dismissed while fcitx5 is running. So one way or another that needs to be prevented.
(Ultimately we probably need some way to have multiple grabs, or use something different than grabs here.)
There was a problem hiding this comment.
If only grabs supported passthrough and layering as part of the protocol, we wouldn't be having most of the the edge-cases we've hit so far...
3685e2d to
1491fef
Compare
Update for virtual-keyboard `KeymapFile` change from Smithay/smithay#2219, and libei keysym/UTF-8 change from Smithay/smithay#2233.
1491fef to
dca75cd
Compare
Smithay/smithay#2212 should make this unncessary.
Fixes popups (for instance menus in `cosmic-term`) not opening while `fcitx5` is running. Smithay may need some mechanism to allow multiple grabs at once in some way, but for now this should be an improvement.
This should be the correct behavior; if we ever actually have multi-seat.
dca75cd to
1fbb1ce
Compare
Fixes for some of the issues mentioned in #2959, in addition to popup grabs not working when fcitx5 is running.
I still need to update some things around libei input, the modifier restoration mentioned in that issue, and do some more testing.
Currently requires Smithay/smithay#2219.