1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

WindowServer: Support two window switcher modes: all or current desktop

When using the Super+Tab hotkey then all windows will be displayed,
and we will switch to another virtual desktop if needed.

When using the Alt+Tab hotkey then only the windows on the current
desktop will be displayed.
This commit is contained in:
Tom 2021-07-01 20:42:48 -06:00 committed by Andreas Kling
parent 7984c2836d
commit 6472ee0eff
4 changed files with 50 additions and 9 deletions

View file

@ -1567,8 +1567,12 @@ void WindowManager::process_key_event(KeyEvent& event)
return;
}
if (event.type() == Event::KeyDown && ((event.modifiers() == Mod_Super && event.key() == Key_Tab) || (event.modifiers() == (Mod_Super | Mod_Shift) && event.key() == Key_Tab)))
m_switcher.show();
if (event.type() == Event::KeyDown) {
if ((event.modifiers() == Mod_Super && event.key() == Key_Tab) || (event.modifiers() == (Mod_Super | Mod_Shift) && event.key() == Key_Tab))
m_switcher.show(WindowSwitcher::Mode::ShowAllWindows);
else if ((event.modifiers() == Mod_Alt && event.key() == Key_Tab) || (event.modifiers() == (Mod_Alt | Mod_Shift) && event.key() == Key_Tab))
m_switcher.show(WindowSwitcher::Mode::ShowCurrentDesktop);
}
if (m_switcher.is_visible()) {
m_switcher.on_key_event(event);
return;