Compare commits

...

9 Commits

Author SHA1 Message Date
Vaxry
360ede79d1 props: bump ver to 0.38.1 2024-04-06 15:24:13 +01:00
Vaxry
80f8524e65 compositor: fix ghost fadingOut windows remaining after cleanup 2024-04-06 15:16:16 +01:00
Vaxry
6e4c15e70a compositor: remove windows from fadingOut properly 2024-04-06 15:16:16 +01:00
Vaxry
ec73f033aa subsurface: init existing subsurfaces on children creations
fixes #5333
2024-04-06 15:16:16 +01:00
Vaxry
fb22c996eb CColor: fix getAsHex 2024-04-06 15:16:16 +01:00
Vaxry
ab468de95c renderer: avoid double-rendering ls-es on fadingOut
fixes #5295
2024-04-06 15:16:16 +01:00
Vaxry
013abd3fe3 input: allow focus to bottom layers on maximized in reserved 2024-04-06 15:16:15 +01:00
Vaxry
632a5c2171 renderer: block screen shader on screencopy 2024-04-06 15:15:03 +01:00
Jan Beich
02717bf8d1 hyprerror: align 32-bit types after 4c796683c0 (#5375)
src/hyprerror/HyprError.cpp:64:33: error: no matching function for call to 'min'
    const auto   VISLINECOUNT = std::min(LINECOUNT, *LINELIMIT);
                                ^~~~~~~~
/usr/include/c++/v1/__algorithm/min.h:40:1: note: candidate template ignored: deduced conflicting types for parameter '_Tp' ('int' vs. 'long long')
min(const _Tp& __a, const _Tp& __b)
^
/usr/include/c++/v1/__algorithm/min.h:51:1: note: candidate template ignored: could not match 'initializer_list<_Tp>' against 'int'
min(initializer_list<_Tp> __t, _Compare __comp)
^
/usr/include/c++/v1/__algorithm/min.h:60:1: note: candidate function template not viable: requires single argument '__t', but 2 arguments were provided
min(initializer_list<_Tp> __t)
^
/usr/include/c++/v1/__algorithm/min.h:31:1: note: candidate function template not viable: requires 3 arguments, but 2 were provided
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
2024-04-06 15:15:03 +01:00
13 changed files with 40 additions and 45 deletions

View File

@@ -1,3 +1,3 @@
{
"version": "0.38.0"
"version": "0.38.1"
}

View File

@@ -692,10 +692,10 @@ CMonitor* CCompositor::getMonitorFromVector(const Vector2D& point) {
}
void CCompositor::removeWindowFromVectorSafe(CWindow* pWindow) {
if (windowExists(pWindow) && !pWindow->m_bFadingOut)
if (windowExists(pWindow) && !pWindow->m_bFadingOut) {
std::erase_if(m_vWindows, [&](std::unique_ptr<CWindow>& el) { return el.get() == pWindow; });
std::erase_if(m_vWindowsFadingOut, [&](CWindow* el) { return el == pWindow; });
std::erase_if(m_vWindowsFadingOut, [&](CWindow* el) { return el == pWindow; });
}
}
bool CCompositor::windowExists(CWindow* pWindow) {
@@ -1459,19 +1459,14 @@ void CCompositor::cleanupFadingOut(const int& monid) {
if (w->m_iMonitorID != (long unsigned int)monid)
continue;
bool valid = windowExists(w);
if (!w->m_bFadingOut || w->m_fAlpha.value() == 0.f) {
if (!valid || !w->m_bFadingOut || w->m_fAlpha.value() == 0.f) {
if (valid) {
w->m_bFadingOut = false;
w->m_bFadingOut = false;
if (!w->m_bReadyToDelete)
continue;
if (!w->m_bReadyToDelete)
continue;
removeWindowFromVectorSafe(w);
}
std::erase(m_vWindowsFadingOut, w);
removeWindowFromVectorSafe(w);
Debug::log(LOG, "Cleanup: destroyed a window");
return;

View File

@@ -7,38 +7,24 @@ static void onNewSubsurface(void* owner, void* data);
CSubsurface::CSubsurface(CWindow* pOwner) : m_pWindowParent(pOwner) {
initSignals();
wlr_subsurface* wlrSubsurface;
wl_list_for_each(wlrSubsurface, &pOwner->m_pWLSurface.wlr()->current.subsurfaces_below, current.link) {
::onNewSubsurface(this, wlrSubsurface);
}
wl_list_for_each(wlrSubsurface, &pOwner->m_pWLSurface.wlr()->current.subsurfaces_above, current.link) {
::onNewSubsurface(this, wlrSubsurface);
}
initExistingSubsurfaces(pOwner->m_pWLSurface.wlr());
}
CSubsurface::CSubsurface(CPopup* pOwner) : m_pPopupParent(pOwner) {
initSignals();
wlr_subsurface* wlrSubsurface;
wl_list_for_each(wlrSubsurface, &pOwner->m_sWLSurface.wlr()->current.subsurfaces_below, current.link) {
::onNewSubsurface(this, wlrSubsurface);
}
wl_list_for_each(wlrSubsurface, &pOwner->m_sWLSurface.wlr()->current.subsurfaces_above, current.link) {
::onNewSubsurface(this, wlrSubsurface);
}
initExistingSubsurfaces(pOwner->m_sWLSurface.wlr());
}
CSubsurface::CSubsurface(wlr_subsurface* pSubsurface, CWindow* pOwner) : m_pSubsurface(pSubsurface), m_pWindowParent(pOwner) {
m_sWLSurface.assign(pSubsurface->surface, this);
initSignals();
initExistingSubsurfaces();
initExistingSubsurfaces(pSubsurface->surface);
}
CSubsurface::CSubsurface(wlr_subsurface* pSubsurface, CPopup* pOwner) : m_pSubsurface(pSubsurface), m_pPopupParent(pOwner) {
m_sWLSurface.assign(pSubsurface->surface, this);
initSignals();
initExistingSubsurfaces();
initExistingSubsurfaces(pSubsurface->surface);
}
CSubsurface::~CSubsurface() {
@@ -47,6 +33,8 @@ CSubsurface::~CSubsurface() {
if (!m_pSubsurface)
return;
m_pSubsurface->data = nullptr;
hyprListener_commitSubsurface.removeCallback();
hyprListener_destroySubsurface.removeCallback();
}
@@ -78,6 +66,7 @@ static void onUnmapSubsurface(void* owner, void* data) {
void CSubsurface::initSignals() {
if (m_pSubsurface) {
m_pSubsurface->data = this;
hyprListener_commitSubsurface.initCallback(&m_pSubsurface->surface->events.commit, &onCommitSubsurface, this, "CSubsurface");
hyprListener_destroySubsurface.initCallback(&m_pSubsurface->events.destroy, &onDestroySubsurface, this, "CSubsurface");
hyprListener_newSubsurface.initCallback(&m_pSubsurface->surface->events.new_subsurface, &::onNewSubsurface, this, "CSubsurface");
@@ -225,15 +214,12 @@ Vector2D CSubsurface::coordsGlobal() {
return coords;
}
void CSubsurface::initExistingSubsurfaces() {
if (m_pWindowParent)
return;
void CSubsurface::initExistingSubsurfaces(wlr_surface* pSurface) {
wlr_subsurface* wlrSubsurface;
wl_list_for_each(wlrSubsurface, &m_sWLSurface.wlr()->current.subsurfaces_below, current.link) {
wl_list_for_each(wlrSubsurface, &pSurface->current.subsurfaces_below, current.link) {
::onNewSubsurface(this, wlrSubsurface);
}
wl_list_for_each(wlrSubsurface, &m_sWLSurface.wlr()->current.subsurfaces_above, current.link) {
wl_list_for_each(wlrSubsurface, &pSurface->current.subsurfaces_above, current.link) {
::onNewSubsurface(this, wlrSubsurface);
}
}

View File

@@ -54,6 +54,6 @@ class CSubsurface {
bool m_bInert = false;
void initSignals();
void initExistingSubsurfaces();
void initExistingSubsurfaces(wlr_surface* pSurface);
void checkSiblingDamage();
};

View File

@@ -21,6 +21,6 @@ CColor::CColor(uint64_t hex) {
this->a = ALPHA(hex);
}
uint64_t CColor::getAsHex() {
return ((int)a) * 0x1000000 + ((int)r) * 0x10000 + ((int)g) * 0x100 + ((int)b) * 0x1;
uint32_t CColor::getAsHex() {
return (uint32_t)(a * 255.f) * 0x1000000 + (uint32_t)(r * 255.f) * 0x10000 + (uint32_t)(g * 255.f) * 0x100 + (uint32_t)(b * 255.f) * 0x1;
}

View File

@@ -10,7 +10,7 @@ class CColor {
float r = 0, g = 0, b = 0, a = 1.f;
uint64_t getAsHex();
uint32_t getAsHex();
CColor operator-(const CColor& c2) const {
return CColor(r - c2.r, g - c2.g, b - c2.b, a - c2.a);

View File

@@ -58,7 +58,7 @@ void CHyprError::createQueued() {
cairo_paint(CAIRO);
cairo_restore(CAIRO);
const auto LINECOUNT = 1 + std::count(m_szQueued.begin(), m_szQueued.end(), '\n');
const auto LINECOUNT = Hyprlang::INT{1} + std::count(m_szQueued.begin(), m_szQueued.end(), '\n');
static auto LINELIMIT = CConfigValue<Hyprlang::INT>("debug:error_limit");
const auto VISLINECOUNT = std::min(LINECOUNT, *LINELIMIT);

View File

@@ -267,11 +267,18 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
pFoundWindow = g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID);
}
} else {
// if we have a maximized window, allow focusing on a bar or something if in reserved area.
if (g_pCompositor->isPointOnReservedArea(mouseCoords, PMONITOR)) {
foundSurface =
g_pCompositor->vectorToLayerSurface(mouseCoords, &PMONITOR->m_aLayerSurfaceLayers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], &surfaceCoords, &pFoundLayerSurface);
}
pFoundWindow = g_pCompositor->vectorToWindowUnified(mouseCoords, RESERVED_EXTENTS | INPUT_EXTENTS | ALLOW_FLOATING);
if (!(pFoundWindow && pFoundWindow->m_bIsFloating && pFoundWindow->m_bCreatedOverFullscreen))
pFoundWindow = g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID);
}
} else {
pFoundWindow = g_pCompositor->vectorToWindowUnified(mouseCoords, RESERVED_EXTENTS | INPUT_EXTENTS | ALLOW_FLOATING);
}

View File

@@ -502,6 +502,7 @@ bool CScreencopyProtocolManager::copyFrameShm(SScreencopyFrame* frame, timespec*
return false;
}
g_pHyprOpenGL->m_RenderData.blockScreenShader = true;
g_pHyprRenderer->endRender();
g_pHyprRenderer->makeEGLCurrent();
@@ -547,6 +548,7 @@ bool CScreencopyProtocolManager::copyFrameDmabuf(SScreencopyFrame* frame) {
g_pHyprOpenGL->renderTexture(sourceTex, &monbox, 1);
g_pHyprOpenGL->setMonitorTransformEnabled(false);
g_pHyprOpenGL->m_RenderData.blockScreenShader = true;
g_pHyprRenderer->endRender();
wlr_texture_destroy(sourceTex);

View File

@@ -402,6 +402,7 @@ bool CToplevelExportProtocolManager::copyFrameShm(SScreencopyFrame* frame, times
return false;
}
g_pHyprOpenGL->m_RenderData.blockScreenShader = true;
g_pHyprRenderer->endRender();
g_pHyprRenderer->makeEGLCurrent();
@@ -441,6 +442,7 @@ bool CToplevelExportProtocolManager::copyFrameDmabuf(SScreencopyFrame* frame, ti
if (frame->overlayCursor)
g_pHyprRenderer->renderSoftwareCursors(PMONITOR, fakeDamage, g_pInputManager->getMouseCoordsInternal() - frame->pWindow->m_vRealPosition.value());
g_pHyprOpenGL->m_RenderData.blockScreenShader = true;
g_pHyprRenderer->endRender();
return true;
}

View File

@@ -365,7 +365,7 @@ void CHyprOpenGLImpl::end() {
}
m_bEndFrame = true;
m_bApplyFinalShader = true;
m_bApplyFinalShader = !m_RenderData.blockScreenShader;
if (m_RenderData.mouseZoomUseMouse)
m_RenderData.useNearestNeighbor = true;
@@ -388,6 +388,7 @@ void CHyprOpenGLImpl::end() {
m_RenderData.mouseZoomFactor = 1.f;
m_RenderData.mouseZoomUseMouse = true;
m_RenderData.forceIntrospection = false;
m_RenderData.blockScreenShader = false;
m_RenderData.currentFB = nullptr;
m_RenderData.mainFB = nullptr;
m_RenderData.outFB = nullptr;

View File

@@ -108,6 +108,7 @@ struct SCurrentRenderData {
bool mouseZoomUseMouse = true; // true by default
bool useNearestNeighbor = false;
bool forceIntrospection = false; // cleaned in ::end()
bool blockScreenShader = false;
Vector2D primarySurfaceUVTopLeft = Vector2D(-1, -1);
Vector2D primarySurfaceUVBottomRight = Vector2D(-1, -1);

View File

@@ -658,7 +658,8 @@ void CHyprRenderer::renderWindow(CWindow* pWindow, CMonitor* pMonitor, timespec*
void CHyprRenderer::renderLayer(SLayerSurface* pLayer, CMonitor* pMonitor, timespec* time, bool popups) {
if (pLayer->fadingOut) {
g_pHyprOpenGL->renderSnapshot(&pLayer);
if (!popups)
g_pHyprOpenGL->renderSnapshot(&pLayer);
return;
}