From 67acf993141b21b538624bcdc25382632db6452a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 23 Feb 2021 09:05:44 +0100 Subject: [PATCH] remote-desktop/session: Add CapsLockState and NumLockState properties Will be used by remote desktop services that want to try to affect the end result of these. We cannot let it set these directly, as these needs to be done using virtual key events to not cause issues in all the XKB state tracking, so remote desktop services try to deal with this themself if they need to. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1342 Part-of: --- src/backends/meta-remote-desktop-session.c | 11 +++++++++++ src/org.gnome.Mutter.RemoteDesktop.xml | 3 +++ 2 files changed, 14 insertions(+) diff --git a/src/backends/meta-remote-desktop-session.c b/src/backends/meta-remote-desktop-session.c index ad9b7672a..4429c3567 100644 --- a/src/backends/meta-remote-desktop-session.c +++ b/src/backends/meta-remote-desktop-session.c @@ -253,6 +253,10 @@ meta_remote_desktop_session_new (MetaRemoteDesktop *remote_desktop, const char *peer_name, GError **error) { + MetaBackend *backend = meta_remote_desktop_get_backend (remote_desktop); + ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend); + ClutterSeat *seat = clutter_backend_get_default_seat (clutter_backend); + ClutterKeymap *keymap = clutter_seat_get_keymap (seat); GDBusInterfaceSkeleton *interface_skeleton; MetaRemoteDesktopSession *session; @@ -271,6 +275,13 @@ meta_remote_desktop_session_new (MetaRemoteDesktop *remote_desktop, return NULL; } + g_object_bind_property (keymap, "caps-lock-state", + session, "caps-lock-state", + G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE); + g_object_bind_property (keymap, "num-lock-state", + session, "num-lock-state", + G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE); + return session; } diff --git a/src/org.gnome.Mutter.RemoteDesktop.xml b/src/org.gnome.Mutter.RemoteDesktop.xml index 43657f9ed..7bae10e43 100644 --- a/src/org.gnome.Mutter.RemoteDesktop.xml +++ b/src/org.gnome.Mutter.RemoteDesktop.xml @@ -343,6 +343,9 @@ + + +