diff options
author | Timur Sultanov <tssultanov@outlook.com> | 2022-04-03 02:06:35 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-07-21 16:40:47 +0200 |
commit | 9906f41e016994b35a05239550fe96e519442f26 (patch) | |
tree | 6076cff47e1c67047ef0a7b365facf3f24212430 /Userland/Services/WindowServer/KeymapSwitcher.cpp | |
parent | db11cfa2c573536f1df0c04b5a0a7166f2de26e8 (diff) | |
download | serenity-9906f41e016994b35a05239550fe96e519442f26.zip |
Keymap+WindowServer: Add context menu to keymap applet
Adding a context menu which lists configured keymaps and allows
setting the active keymap
Diffstat (limited to 'Userland/Services/WindowServer/KeymapSwitcher.cpp')
-rw-r--r-- | Userland/Services/WindowServer/KeymapSwitcher.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Services/WindowServer/KeymapSwitcher.cpp b/Userland/Services/WindowServer/KeymapSwitcher.cpp index 11a21c7c6b..3290395ea0 100644 --- a/Userland/Services/WindowServer/KeymapSwitcher.cpp +++ b/Userland/Services/WindowServer/KeymapSwitcher.cpp @@ -53,7 +53,7 @@ void KeymapSwitcher::refresh() on_keymap_change(current_keymap); if (m_keymaps.find(current_keymap).is_end()) { - setkeymap(m_keymaps.first()); + set_keymap(m_keymaps.first()); } } @@ -75,7 +75,7 @@ void KeymapSwitcher::next_keymap() if (it.is_end()) { auto first_keymap = m_keymaps.first(); dbgln("Cannot find current keymap in the keymap list - setting first available ({})", first_keymap); - setkeymap(first_keymap); + set_keymap(first_keymap); } else { it++; @@ -84,7 +84,7 @@ void KeymapSwitcher::next_keymap() } dbgln("Setting system keymap to: {}", *it); - setkeymap(*it); + set_keymap(*it); } } @@ -100,7 +100,7 @@ String KeymapSwitcher::get_current_keymap() const return keymap_object.get("keymap"sv).to_string(); } -void KeymapSwitcher::setkeymap(const AK::String& keymap) +void KeymapSwitcher::set_keymap(const AK::String& keymap) { if (Core::Process::spawn("/bin/keymap"sv, Array { "-m", keymap.characters() }).is_error()) dbgln("Failed to call /bin/keymap, error: {} ({})", errno, strerror(errno)); |