UI/Qt: Reserve the location shortcut

Let Ctrl+L bypass WebContent in the shortcut override path so the
browser chrome can focus the location editor immediately. This matches
Qt's other browser-owned tab and window shortcuts.
This commit is contained in:
Andreas Kling 2026-05-31 14:26:58 +02:00 committed by Andreas Kling
parent 8e8bced900
commit b04bc8b734

View file

@ -392,7 +392,7 @@ static Web::UIEvents::KeyCode get_keycode_from_qt_key_event(QKeyEvent const& eve
static bool is_browser_reserved_shortcut(QKeyEvent const& event)
{
// Browser chrome shortcuts that manage tabs or windows should not wait for
// Browser chrome shortcuts that manage tabs, windows, or focus should not wait for
// WebContent to decide whether the page wants to suppress them.
if (event.matches(QKeySequence::StandardKey::AddTab)
|| event.matches(QKeySequence::StandardKey::Close)
@ -406,7 +406,7 @@ static bool is_browser_reserved_shortcut(QKeyEvent const& event)
if (modifiers == (Qt::ControlModifier | Qt::ShiftModifier) && key == Qt::Key_T)
return true;
if (modifiers == Qt::ControlModifier && (key == Qt::Key_Tab || key == Qt::Key_PageDown))
if (modifiers == Qt::ControlModifier && (key == Qt::Key_L || key == Qt::Key_Tab || key == Qt::Key_PageDown))
return true;
if (modifiers == (Qt::ControlModifier | Qt::ShiftModifier) && (key == Qt::Key_Tab || key == Qt::Key_Backtab))