|
4 | 4 | #include <hyprland/src/desktop/Window.hpp> |
5 | 5 | #include <hyprland/src/helpers/MiscFunctions.hpp> |
6 | 6 | #include <hyprland/src/managers/SeatManager.hpp> |
| 7 | +#include <hyprland/src/render/Renderer.hpp> |
7 | 8 | #include <pango/pangocairo.h> |
8 | 9 |
|
9 | 10 | #include "globals.hpp" |
| 11 | +#include "BarPassElement.hpp" |
10 | 12 |
|
11 | 13 | CHyprBar::CHyprBar(PHLWINDOW pWindow) : IHyprWindowDecoration(pWindow) { |
12 | 14 | m_pWindow = pWindow; |
@@ -56,7 +58,8 @@ std::string CHyprBar::getDisplayName() { |
56 | 58 | } |
57 | 59 |
|
58 | 60 | void CHyprBar::onMouseDown(SCallbackInfo& info, IPointer::SButtonEvent e) { |
59 | | - if (!m_pWindow->m_pWorkspace->isVisible() || !g_pInputManager->m_dExclusiveLSes.empty() || (g_pSeatManager->seatGrab && !g_pSeatManager->seatGrab->accepts(m_pWindow->m_pWLSurface->resource()))) |
| 61 | + if (!m_pWindow->m_pWorkspace->isVisible() || !g_pInputManager->m_dExclusiveLSes.empty() || |
| 62 | + (g_pSeatManager->seatGrab && !g_pSeatManager->seatGrab->accepts(m_pWindow->m_pWLSurface->resource()))) |
60 | 63 | return; |
61 | 64 |
|
62 | 65 | const auto WINDOWATCURSOR = g_pCompositor->vectorToWindowUnified(g_pInputManager->getMouseCoordsInternal(), RESERVED_EXTENTS | INPUT_EXTENTS | ALLOW_FLOATING); |
@@ -399,6 +402,13 @@ void CHyprBar::draw(PHLMONITOR pMonitor, const float& a) { |
399 | 402 | if (!PWINDOW->m_sWindowData.decorate.valueOrDefault()) |
400 | 403 | return; |
401 | 404 |
|
| 405 | + auto data = CBarPassElement::SBarData{this, a}; |
| 406 | + g_pHyprRenderer->m_sRenderPass.add(makeShared<CBarPassElement>(data)); |
| 407 | +} |
| 408 | + |
| 409 | +void CHyprBar::renderPass(PHLMONITOR pMonitor, const float& a) { |
| 410 | + const auto PWINDOW = m_pWindow.lock(); |
| 411 | + |
402 | 412 | static auto* const PCOLOR = (Hyprlang::INT* const*)HyprlandAPI::getConfigValue(PHANDLE, "plugin:hyprbars:bar_color")->getDataStaticPtr(); |
403 | 413 | static auto* const PHEIGHT = (Hyprlang::INT* const*)HyprlandAPI::getConfigValue(PHANDLE, "plugin:hyprbars:bar_height")->getDataStaticPtr(); |
404 | 414 | static auto* const PPRECEDENCE = (Hyprlang::INT* const*)HyprlandAPI::getConfigValue(PHANDLE, "plugin:hyprbars:bar_precedence_over_border")->getDataStaticPtr(); |
|
0 commit comments