-
Notifications
You must be signed in to change notification settings - Fork 8
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
WIP Add cosmic-keymap-unstable-v1
protocol
#28
base: main
Are you sure you want to change the base?
Conversation
I guess we should also figure out how input methods fit in here... |
A protocol to notify a client using it about group modifier changes regardless of focus should allow for a simple keyboard layout indicator. The question becomes how much the protocol should support outside of that single event, e.g. should it allow the client to set a new global group modifier or not. The keyboard |
Right, I think an extension object for a |
Yeah. I was thinking an extension object would be unnecessary if we just have a request to set the group and not any events. But I guess we need notification of the current group as well, so an extension object makes sense. (Still annoying the extra boilerplate that adds with wayland-rs... Need to find a better way to manage that.) We may need to revisit how this works in the future when we properly integrate input methods, but I guess that can be left out for now. I need to look more into how that works on Gnome, etc. |
FYI @Zamundaaa |
Includes example client using `cosmic-client-toolkit`.
This looks great. Do you intend to propose it upstream as well? In either case labwc will consider adding support for it. |
FWIW, KWin has an alternative mode where it just responds to locale1 settings too. Fedora KDE uses this for the live session. And COSMIC has this capability too (since it was implemented in pop-os/cosmic-settings-daemon#35). So what is this protocol for now? |
Compositors that don't want to depend on dbus for basic functionality. Additionally, at least from a quick glance of the linked PR the dbus interface appears to set the whole xkb config rather than just changing the group modifier. |
D-Bus is required for basic functionality already. It's been that way for (conservatively) at least 15 years. |
Maybe It simply provides the group number currently active in the keymap (which is exposed by I don't believe locale1 does anything like that, or would be intended to. That defines what keymap to use (with one or more groups).
Yeah, it seems like it could be reasonable to propose upstream, and I was thinking of doing so. It's a fairly clean and simple protocol if there aren't concerns about how it works. If labwc is interested I guess that's additional reason to. |
Maybe |
Test implementation of pop-os/cosmic-protocols#28 WARNING: Do not use this outside of protocol evaluation. The protocol might change which will cause the wayland connection to disconnect the client due to protocol mismatch.
Test implementation of pop-os/cosmic-protocols#28 WARNING: Do not use this outside of protocol evaluation. The protocol might change which will cause the wayland connection to disconnect clients due to protocol mismatch.
Includes example client using
cosmic-client-toolkit
.https://github.com/pop-os/cosmic-applets/tree/master/cosmic-applet-input-sources sets the keyboard layout by modifying
xkb_config
. But it should instead leave the keymap unchanged, and change the group. The applet also doesn't recognize when the group is changed by something else.KDE has a DBus protocol for this (https://invent.kde.org/plasma/plasma-workspace/-/blob/master/components/keyboardlayout/org.kde.KeyboardLayouts.xml?ref_type=heads). We could have one, but a Wayland protocol is easier to integrate into the compositor, and lets us just use
wl_keyboard.keymap
to get the current keymap and list of layouts. And privileged Wayland protocols match how our applets typically work.Zbus is however a bit less verbose that adding a wayland protocol.... something we should work on (Smithay/smithay#1327, etc.).
I guess this will also need an event for the active group, since
modifiers
(unlikekeymap)
is only being sent to focused windows).