From aa64af95fedaadc97dce02d4a37d6bad05961c86 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 22 Mar 2022 18:29:13 +0100 Subject: handle inhibit --- src/events/Misc.cpp | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'src/events/Misc.cpp') 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 -- cgit v1.2.3