From 1d5eda80b33d6ce80a972e54896e3f1303ac3fd2 Mon Sep 17 00:00:00 2001 From: LionHeartP Date: Thu, 11 Jun 2026 20:44:41 +0300 Subject: [PATCH] hyprbars: fix build after hyprland monitor refactor pt.2 --- hyprbars/barDeco.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hyprbars/barDeco.cpp b/hyprbars/barDeco.cpp index 895f7e84..d073489a 100644 --- a/hyprbars/barDeco.cpp +++ b/hyprbars/barDeco.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include "globals.hpp" #include "BarPassElement.hpp" @@ -184,7 +185,13 @@ void CHyprBar::handleDownEvent(Event::SCallbackInfo& info, std::optionalgetMonitorFromName(!e.device->m_boundOutput.empty() ? e.device->m_boundOutput : ""); + PHLMONITOR PMONITOR = nullptr; + for(auto& m : State::monitorState()->monitors()) { + if(m->m_name == (!e.device->m_boundOutput.empty() ? e.device->m_boundOutput : "")) { + PMONITOR = m; + break; + } + } PMONITOR = PMONITOR ? PMONITOR : Desktop::focusState()->monitor(); COORDS = Vector2D(PMONITOR->m_position.x + e.pos.x * PMONITOR->m_size.x, PMONITOR->m_position.y + e.pos.y * PMONITOR->m_size.y) - assignedBoxGlobal().pos(); } @@ -247,7 +254,7 @@ void CHyprBar::handleUpEvent(Event::SCallbackInfo& info) { g_pKeybindManager->changeMouseBindMode(MBIND_INVALID); m_bDraggingThis = false; if (m_bTouchEv) - Config::Actions::floatWindow(Config::Actions::eTogglableAction::TOGGLE_ACTION_DISABLE); + (void)Config::Actions::floatWindow(Config::Actions::eTogglableAction::TOGGLE_ACTION_DISABLE); Log::logger->log(Log::DEBUG, "[hyprbars] Dragging ended on {:x}", (uintptr_t)m_pWindow.lock().get()); }