hyprerror: make hyprerror reserve space (#8040)

This commit is contained in:
Vaxry
2024-10-08 21:20:25 +01:00
committed by GitHub
parent 60308a2bb5
commit 91299f7039
3 changed files with 45 additions and 4 deletions

View File

@@ -97,6 +97,16 @@ CHyprRenderer::CHyprRenderer() {
ensureCursorRenderingMode();
});
static auto P3 = g_pHookSystem->hookDynamic("focusedMon", [&](void* self, SCallbackInfo& info, std::any param) {
g_pEventLoopManager->doLater([this]() {
if (!g_pHyprError->active())
return;
for (auto& m : g_pCompositor->m_vMonitors) {
arrangeLayersForMonitor(m->ID);
}
});
});
m_pCursorTicker = wl_event_loop_add_timer(g_pCompositor->m_sWLEventLoop, cursorTicker, nullptr);
wl_event_source_timer_update(m_pCursorTicker, 500);
@@ -1757,6 +1767,13 @@ void CHyprRenderer::arrangeLayersForMonitor(const MONITORID& monitor) {
CBox usableArea = {PMONITOR->vecPosition.x, PMONITOR->vecPosition.y, PMONITOR->vecSize.x, PMONITOR->vecSize.y};
if (g_pHyprError->active() && g_pCompositor->m_pLastMonitor == PMONITOR->self) {
const auto HEIGHT = g_pHyprError->height();
PMONITOR->vecReservedTopLeft.y = HEIGHT;
usableArea.y += HEIGHT;
usableArea.h -= HEIGHT;
}
for (auto& la : PMONITOR->m_aLayerSurfaceLayers) {
std::stable_sort(la.begin(), la.end(), [](const PHLLSREF& a, const PHLLSREF& b) { return a->order > b->order; });
}