1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 23:28:11 +00:00

WindowServer: Fix alt shortcut navigation for non-default keymaps

Some keymaps will bind key presses with the alt modifier to characters
other than the unmodified one, in which case you couldn't activate the
alt shortcuts in the menu bar before.

We now ask the current keymap for the code point that is mapped to the
pressed (unmodified) key instead.
This commit is contained in:
Julian Offenhäuser 2023-03-20 20:45:36 +01:00 committed by Sam Atkins
parent e59137d4f6
commit e32ab161ae
3 changed files with 30 additions and 17 deletions

View file

@ -25,7 +25,7 @@ RefPtr<Core::ConfigFile> g_config;
ErrorOr<int> serenity_main(Main::Arguments)
{
TRY(Core::System::pledge("stdio video thread sendfd recvfd accept rpath wpath cpath unix proc sigaction exec tty"));
TRY(Core::System::pledge("stdio video thread sendfd recvfd accept rpath wpath cpath unix proc getkeymap sigaction exec tty"));
TRY(Core::System::unveil("/res", "r"));
TRY(Core::System::unveil("/tmp", "cw"));
TRY(Core::System::unveil("/etc/WindowServer.ini", "rwc"));
@ -42,7 +42,7 @@ ErrorOr<int> serenity_main(Main::Arguments)
act.sa_flags = SA_NOCLDWAIT;
act.sa_handler = SIG_IGN;
TRY(Core::System::sigaction(SIGCHLD, &act, nullptr));
TRY(Core::System::pledge("stdio video thread sendfd recvfd accept rpath wpath cpath unix proc exec tty"));
TRY(Core::System::pledge("stdio video thread sendfd recvfd accept rpath wpath cpath unix proc getkeymap exec tty"));
WindowServer::g_config = TRY(Core::ConfigFile::open("/etc/WindowServer.ini", Core::ConfigFile::AllowWriting::Yes));
auto theme_name = WindowServer::g_config->read_entry("Theme", "Name", "Default");
@ -73,7 +73,7 @@ ErrorOr<int> serenity_main(Main::Arguments)
WindowServer::EventLoop loop;
TRY(Core::System::pledge("stdio video thread sendfd recvfd accept rpath wpath cpath unix proc exec"));
TRY(Core::System::pledge("stdio video thread sendfd recvfd accept rpath wpath cpath unix proc getkeymap exec"));
// First check which screens are explicitly configured
{