diff --git a/input.cpp b/input.cpp --- a/input.cpp +++ b/input.cpp @@ -788,6 +788,12 @@ return ret; } } else if (event->type() == QEvent::KeyPress) { + auto seat = waylandServer()->seat(); + auto surface = seat->focusedKeyboardSurface(); + auto inhibitor = waylandServer()->keyboardShortcutsInhibitManager()->getShortcutsInhibitor(surface, seat); + if (inhibitor && inhibitor->isActive()) { + return false; + } return input()->shortcuts()->processKey(static_cast(event)->modifiersRelevantForGlobalShortcuts(), event->key()); } return false; diff --git a/wayland_server.h b/wayland_server.h --- a/wayland_server.h +++ b/wayland_server.h @@ -70,6 +70,7 @@ class LinuxDmabufUnstableV1Interface; class LinuxDmabufUnstableV1Buffer; class TabletManagerInterface; +class KeyboardShortcutsInhibitManagerInterface; } } @@ -125,6 +126,10 @@ KWayland::Server::XdgOutputManagerInterface *xdgOutputManager() const { return m_xdgOutputManager; } + KWayland::Server::KeyboardShortcutsInhibitManagerInterface *keyboardShortcutsInhibitManager() + { + return m_keyboardShortcutsInhibitManager; + } KWayland::Server::LinuxDmabufUnstableV1Interface *linuxDmabuf(); QList clients() const { @@ -266,6 +271,7 @@ KWayland::Server::XdgOutputManagerInterface *m_xdgOutputManager = nullptr; KWayland::Server::XdgDecorationManagerInterface *m_xdgDecorationManager = nullptr; KWayland::Server::LinuxDmabufUnstableV1Interface *m_linuxDmabuf = nullptr; + KWayland::Server::KeyboardShortcutsInhibitManagerInterface *m_keyboardShortcutsInhibitManager = nullptr; QSet m_linuxDmabufBuffers; struct { KWayland::Server::ClientConnection *client = nullptr; diff --git a/wayland_server.cpp b/wayland_server.cpp --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -316,7 +316,7 @@ ); m_tabletManager = m_display->createTabletManagerInterface(m_display); - + m_keyboardShortcutsInhibitManager = m_display->createKeyboardShortcutsInhibitManager(m_display); m_xdgShell = m_display->createXdgShell(XdgShellInterfaceVersion::Stable, m_display); m_xdgShell->create(); connect(m_xdgShell, &XdgShellInterface::surfaceCreated, this, &WaylandServer::createSurface);