wayland: implement keyboard_shortcuts_inhibit_v1

fixes #4568
This commit is contained in:
Vaxry
2024-02-27 23:14:56 +00:00
parent f26d7aa58d
commit e3373669e5
6 changed files with 42 additions and 0 deletions

View File

@@ -262,3 +262,20 @@ void Events::listener_newTearingHint(wl_listener* listener, void* data) {
},
NEWCTRL, "TearingController");
}
void Events::listener_newShortcutInhibitor(wl_listener* listener, void* data) {
const auto INHIBITOR = (wlr_keyboard_shortcuts_inhibitor_v1*)data;
const auto PINH = &g_pKeybindManager->m_lShortcutInhibitors.emplace_back();
PINH->hyprListener_destroy.initCallback(
&INHIBITOR->events.destroy,
[](void* owner, void* data) {
const auto OWNER = (SShortcutInhibitor*)owner;
g_pKeybindManager->m_lShortcutInhibitors.remove(*OWNER);
},
PINH, "ShortcutInhibitor");
PINH->pWlrInhibitor = INHIBITOR;
Debug::log(LOG, "New shortcut inhibitor for surface {:x}", (uintptr_t)INHIBITOR->surface);
}