mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-07-25 17:21:54 -07:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
360ede79d1 | ||
|
80f8524e65 | ||
|
6e4c15e70a | ||
|
ec73f033aa | ||
|
fb22c996eb | ||
|
ab468de95c | ||
|
013abd3fe3 | ||
|
632a5c2171 | ||
|
02717bf8d1 |
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"version": "0.38.0"
|
||||
"version": "0.38.1"
|
||||
}
|
@@ -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;
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -54,6 +54,6 @@ class CSubsurface {
|
||||
bool m_bInert = false;
|
||||
|
||||
void initSignals();
|
||||
void initExistingSubsurfaces();
|
||||
void initExistingSubsurfaces(wlr_surface* pSurface);
|
||||
void checkSiblingDamage();
|
||||
};
|
@@ -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;
|
||||
}
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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);
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user