summaryrefslogtreecommitdiff
path: root/src/events/Misc.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-03-22 18:29:13 +0100
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-03-22 18:29:13 +0100
commitaa64af95fedaadc97dce02d4a37d6bad05961c86 (patch)
treec2c7fd4e72651135f574722c1e1dc1b9c7de0a20 /src/events/Misc.cpp
parentdb4b4ec0d3a09b9194b102509b432b5d92b798c6 (diff)
handle inhibit
Diffstat (limited to 'src/events/Misc.cpp')
-rw-r--r--src/events/Misc.cpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/events/Misc.cpp b/src/events/Misc.cpp
index f31ca3b9..545c4995 100644
--- a/src/events/Misc.cpp
+++ b/src/events/Misc.cpp
@@ -27,12 +27,12 @@ void Events::listener_outputMgrTest(wl_listener* listener, void* data) {
void Events::listener_requestSetPrimarySel(wl_listener* listener, void* data) {
const auto EVENT = (wlr_seat_request_set_primary_selection_event*)data;
- wlr_seat_set_primary_selection(g_pCompositor->m_sWLRSeat, EVENT->source, EVENT->serial);
+ wlr_seat_set_primary_selection(g_pCompositor->m_sSeat.seat, EVENT->source, EVENT->serial);
}
void Events::listener_requestSetSel(wl_listener* listener, void* data) {
const auto EVENT = (wlr_seat_request_set_selection_event*)data;
- wlr_seat_set_selection(g_pCompositor->m_sWLRSeat, EVENT->source, EVENT->serial);
+ wlr_seat_set_selection(g_pCompositor->m_sSeat.seat, EVENT->source, EVENT->serial);
}
void Events::listener_readyXWayland(wl_listener* listener, void* data) {
@@ -55,7 +55,7 @@ void Events::listener_readyXWayland(wl_listener* listener, void* data) {
ATOM.second = reply->atom;
}
- wlr_xwayland_set_seat(g_pXWaylandManager->m_sWLRXWayland, g_pCompositor->m_sWLRSeat);
+ wlr_xwayland_set_seat(g_pXWaylandManager->m_sWLRXWayland, g_pCompositor->m_sSeat.seat);
const auto XCURSOR = wlr_xcursor_manager_get_xcursor(g_pCompositor->m_sWLRXCursorMgr, "left_ptr", 1);
if (XCURSOR) {
@@ -68,15 +68,28 @@ void Events::listener_readyXWayland(wl_listener* listener, void* data) {
void Events::listener_requestDrag(wl_listener* listener, void* data) {
const auto E = (wlr_seat_request_start_drag_event*)data;
- if (!wlr_seat_validate_pointer_grab_serial(g_pCompositor->m_sWLRSeat, E->origin, E->serial)) {
+ if (!wlr_seat_validate_pointer_grab_serial(g_pCompositor->m_sSeat.seat, E->origin, E->serial)) {
Debug::log(LOG, "Ignoring drag and drop request: serial mismatch.");
wlr_data_source_destroy(E->drag->source);
return;
}
- wlr_seat_start_pointer_drag(g_pCompositor->m_sWLRSeat, E->drag, E->serial);
+ wlr_seat_start_pointer_drag(g_pCompositor->m_sSeat.seat, E->drag, E->serial);
}
void Events::listener_startDrag(wl_listener* listener, void* data) {
// TODO: draw the drag icon
+}
+
+void Events::listener_InhibitActivate(wl_listener* listener, void* data) {
+ g_pCompositor->m_sSeat.exclusiveClient = g_pCompositor->m_sWLRInhibitMgr->active_client;
+
+ Debug::log(LOG, "Activated exclusive for %x.", g_pCompositor->m_sSeat.exclusiveClient);
+}
+
+void Events::listener_InhibitDeactivate(wl_listener* listener, void* data) {
+ g_pCompositor->m_sSeat.exclusiveClient = nullptr;
+ g_pInputManager->refocus();
+
+ Debug::log(LOG, "Deactivated exclusive.");
} \ No newline at end of file