Compare commits

...

5 Commits

Author SHA1 Message Date
Vaxry
eab2799842 props: bump ver to 0.32.2 2023-11-11 17:24:04 +00:00
Dickby
6eb2abcb20 shaders: Small optimization in rgb2hsl. (#3831) 2023-11-11 17:20:18 +00:00
Vaxry
ae46fbafe5 xdg: set state maximized for all tiled windows
forces them to not draw stupid decorations of their own. Wlroots stopped doing it for us. Fixes #3830
2023-11-11 17:13:20 +00:00
Vaxry
52cf122a0a shadow: move workspace offset calcs to draw
fixes #3829
2023-11-11 16:15:23 +00:00
Dickby
844da8db56 shaders: Avoid calculating unused values in hsl2rgb. (#3827) 2023-11-11 15:43:31 +00:00
4 changed files with 27 additions and 29 deletions

View File

@@ -1,3 +1,3 @@
{
"version": "0.32.1"
"version": "0.32.2"
}

View File

@@ -184,8 +184,11 @@ void CHyprXWaylandManager::setWindowSize(CWindow* pWindow, Vector2D size, bool f
}
void CHyprXWaylandManager::setWindowStyleTiled(CWindow* pWindow, uint32_t edgez) {
if (!pWindow->m_bIsX11)
wlr_xdg_toplevel_set_tiled(pWindow->m_uSurface.xdg->toplevel, edgez);
if (pWindow->m_bIsX11)
return;
wlr_xdg_toplevel_set_tiled(pWindow->m_uSurface.xdg->toplevel, edgez);
wlr_xdg_toplevel_set_maximized(pWindow->m_uSurface.xdg->toplevel, true);
}
wlr_surface* CHyprXWaylandManager::surfaceAt(CWindow* pWindow, const Vector2D& client, Vector2D& surface) {

View File

@@ -38,13 +38,8 @@ void CHyprDropShadowDecoration::damageEntire() {
}
void CHyprDropShadowDecoration::updateWindow(CWindow* pWindow) {
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(pWindow->m_iWorkspaceID);
const auto WORKSPACEOFFSET = PWORKSPACE && !pWindow->m_bPinned ? PWORKSPACE->m_vRenderOffset.vec() : Vector2D();
m_vLastWindowPos = pWindow->m_vRealPosition.vec() + WORKSPACEOFFSET;
m_vLastWindowSize = pWindow->m_vRealSize.vec();
m_vLastWindowPos = m_pWindow->m_vRealPosition.vec();
m_vLastWindowSize = m_pWindow->m_vRealSize.vec();
m_bLastWindowBox = {m_vLastWindowPos.x, m_vLastWindowPos.y, m_vLastWindowSize.x, m_vLastWindowSize.y};
m_bLastWindowBoxWithDecos = g_pDecorationPositioner->getBoxWithIncludedDecos(pWindow);
@@ -76,11 +71,13 @@ void CHyprDropShadowDecoration::draw(CMonitor* pMonitor, float a, const Vector2D
if (*PSHADOWS != 1)
return; // disabled
const auto ROUNDING = m_pWindow->rounding() + m_pWindow->getRealBorderSize();
const auto ROUNDING = m_pWindow->rounding() + m_pWindow->getRealBorderSize();
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(m_pWindow->m_iWorkspaceID);
const auto WORKSPACEOFFSET = PWORKSPACE && !m_pWindow->m_bPinned ? PWORKSPACE->m_vRenderOffset.vec() : Vector2D();
// draw the shadow
CBox fullBox = m_bLastWindowBoxWithDecos;
fullBox.translate(-pMonitor->vecPosition);
fullBox.translate(-pMonitor->vecPosition + WORKSPACEOFFSET);
fullBox.x -= *PSHADOWSIZE;
fullBox.y -= *PSHADOWSIZE;
fullBox.w += 2 * *PSHADOWSIZE;
@@ -114,8 +111,8 @@ void CHyprDropShadowDecoration::draw(CMonitor* pMonitor, float a, const Vector2D
CBox withDecos = m_bLastWindowBoxWithDecos;
// get window box
windowBox.translate(-pMonitor->vecPosition).scale(pMonitor->scale).round();
withDecos.translate(-pMonitor->vecPosition).scale(pMonitor->scale).round();
windowBox.translate(-pMonitor->vecPosition + WORKSPACEOFFSET).scale(pMonitor->scale).round();
withDecos.translate(-pMonitor->vecPosition + WORKSPACEOFFSET).scale(pMonitor->scale).round();
auto scaledDecoExtents = withDecos.extentsFrom(windowBox).round();

View File

@@ -238,14 +238,13 @@ vec3 rgb2hsl(vec3 col) {
vec3 adds = vec3(((green - blue) / delta), 2.0 + ((blue - red) / delta), 4.0 + ((red - green) / delta));
float deltaGtz = (delta > 0.0) ? 1.0 : 0.0;
if (delta > 0.0) {
hue += dot(adds, masks);
hue /= 6.0;
hue += dot(adds, masks);
hue *= deltaGtz;
hue /= 6.0;
if (hue < 0.0)
hue += 1.0;
if (hue < 0.0)
hue += 1.0;
}
return vec3(hue, sat, lum);
}
@@ -258,19 +257,18 @@ vec3 hsl2rgb(vec3 col) {
float sat = col.y;
float lum = col.z;
vec3 xt = vec3(rcpsixth * (hue - twothird), 0.0, rcpsixth * (1.0 - hue));
if (hue < twothird) {
xt.r = 0.0;
xt.g = rcpsixth * (twothird - hue);
xt.b = rcpsixth * (hue - onethird);
}
vec3 xt = vec3(0.0);
if (hue < onethird) {
xt.r = rcpsixth * (onethird - hue);
xt.g = rcpsixth * hue;
xt.b = 0.0;
}
} else if (hue < twothird) {
xt.r = 0.0;
xt.g = rcpsixth * (twothird - hue);
xt.b = rcpsixth * (hue - onethird);
} else
xt = vec3(rcpsixth * (hue - twothird), 0.0, rcpsixth * (1.0 - hue));
xt = min(xt, 1.0);