chore: Remove hyprland overlay

Not needed now that 0.29.1 is in nixos-unstable.
This commit is contained in:
Donovan Glover 2023-09-21 22:08:45 -04:00
parent 7c246e6a09
commit a6ff3122b9
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
4 changed files with 0 additions and 165 deletions

View File

@ -1,7 +1,6 @@
{ {
imports = [ imports = [
./alejandra.nix ./alejandra.nix
./hyprland.nix
./zola.nix ./zola.nix
]; ];
} }

View File

@ -1,12 +0,0 @@
{
nixpkgs.overlays = [
(final: prev: {
hyprland = prev.hyprland.overrideAttrs (old: {
patches = (old.patches or [ ]) ++ [
../patches/hyprland-window-sizes.patch
../patches/hyprland-slidefade-animation.patch
];
});
})
];
}

View File

@ -1,128 +0,0 @@
From 37a211a2ae94abad0f606433a58603e70261d0bb Mon Sep 17 00:00:00 2001
From: end-4 <97237370+end-4@users.noreply.github.com>
Date: Fri, 18 Aug 2023 03:30:20 +0700
Subject: [PATCH] animations: add slidefade and slidefadevert styles for
workspaces (#3008)
* add slidefade and slidefadevert animations
* fix swiping for slidefadevert
* rename minPerc to movePerc for slidefade anim styles
* change default slidefade percentage to 100%
* remove useless comments
* findlastof + 1
* debug logging for slidefade/slidefadevert percentage
---
src/helpers/Workspace.cpp | 41 ++++++++++++++++++++++++++++++-
src/managers/AnimationManager.cpp | 16 ++++++++++++
src/managers/input/Swipe.cpp | 6 +++--
3 files changed, 60 insertions(+), 3 deletions(-)
diff --git a/src/helpers/Workspace.cpp b/src/helpers/Workspace.cpp
index a71dd55dea..eddd214328 100644
--- a/src/helpers/Workspace.cpp
+++ b/src/helpers/Workspace.cpp
@@ -58,7 +58,46 @@ CWorkspace::~CWorkspace() {
void CWorkspace::startAnim(bool in, bool left, bool instant) {
const auto ANIMSTYLE = m_fAlpha.m_pConfig->pValues->internalStyle;
- if (ANIMSTYLE == "fade") {
+ if (ANIMSTYLE.find("slidefade") == 0) {
+ const auto PMONITOR = g_pCompositor->getMonitorFromID(m_iMonitorID);
+ float movePerc = 100.f;
+
+ if (ANIMSTYLE.find("%") != std::string::npos) {
+ try {
+ auto percstr = ANIMSTYLE.substr(ANIMSTYLE.find_last_of(' ') + 1);
+ movePerc = std::stoi(percstr.substr(0, percstr.length() - 1));
+ } catch (std::exception& e) {
+ Debug::log(ERR, "Error in startAnim: invalid percentage");
+ }
+ }
+
+ m_fAlpha.setValueAndWarp(1.f);
+ m_vRenderOffset.setValueAndWarp(Vector2D(0, 0));
+
+ if (ANIMSTYLE.find("slidefadevert") == 0) {
+ if (in) {
+ m_fAlpha.setValueAndWarp(0.f);
+ m_vRenderOffset.setValueAndWarp(Vector2D(0, (left ? PMONITOR->vecSize.y : -PMONITOR->vecSize.y) * (movePerc / 100.f)));
+ m_fAlpha = 1.f;
+ m_vRenderOffset = Vector2D(0, 0);
+ } else {
+ m_fAlpha.setValueAndWarp(1.f);
+ m_fAlpha = 0.f;
+ m_vRenderOffset = Vector2D(0, (left ? -PMONITOR->vecSize.y : PMONITOR->vecSize.y) * (movePerc / 100.f));
+ }
+ } else {
+ if (in) {
+ m_fAlpha.setValueAndWarp(0.f);
+ m_vRenderOffset.setValueAndWarp(Vector2D((left ? PMONITOR->vecSize.x : -PMONITOR->vecSize.x) * (movePerc / 100.f), 0));
+ m_fAlpha = 1.f;
+ m_vRenderOffset = Vector2D(0, 0);
+ } else {
+ m_fAlpha.setValueAndWarp(1.f);
+ m_fAlpha = 0.f;
+ m_vRenderOffset = Vector2D((left ? -PMONITOR->vecSize.x : PMONITOR->vecSize.x) * (movePerc / 100.f), 0);
+ }
+ }
+ } else if (ANIMSTYLE == "fade") {
m_vRenderOffset.setValueAndWarp(Vector2D(0, 0)); // fix a bug, if switching from slide -> fade.
if (in) {
diff --git a/src/managers/AnimationManager.cpp b/src/managers/AnimationManager.cpp
index 3cd0d06595..f4e845c330 100644
--- a/src/managers/AnimationManager.cpp
+++ b/src/managers/AnimationManager.cpp
@@ -485,6 +485,22 @@ std::string CAnimationManager::styleValidInConfigVar(const std::string& config,
} else if (config == "workspaces" || config == "specialWorkspace") {
if (style == "slide" || style == "slidevert" || style == "fade")
return "";
+ else if (style.find("slidefade") == 0) {
+ // try parsing
+ float movePerc = 0.f;
+ if (style.find("%") != std::string::npos) {
+ try {
+ auto percstr = style.substr(style.find_last_of(' ') + 1);
+ movePerc = std::stoi(percstr.substr(0, percstr.length() - 1));
+ } catch (std::exception& e) { return "invalid movePerc"; }
+
+ return "";
+ }
+
+ movePerc; // fix warning
+
+ return "";
+ }
return "unknown style";
} else if (config == "borderangle") {
diff --git a/src/managers/input/Swipe.cpp b/src/managers/input/Swipe.cpp
index 906d5d9b30..5fe91b65ed 100644
--- a/src/managers/input/Swipe.cpp
+++ b/src/managers/input/Swipe.cpp
@@ -50,7 +50,8 @@ void CInputManager::onSwipeEnd(wlr_pointer_swipe_end_event* e) {
static auto* const PSWIPENEW = &g_pConfigManager->getConfigValuePtr("gestures:workspace_swipe_create_new")->intValue;
static auto* const PSWIPENUMBER = &g_pConfigManager->getConfigValuePtr("gestures:workspace_swipe_numbered")->intValue;
static auto* const PSWIPEUSER = &g_pConfigManager->getConfigValuePtr("gestures:workspace_swipe_use_r")->intValue;
- const bool VERTANIMS = m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.getConfig()->pValues->internalStyle == "slidevert";
+ const bool VERTANIMS = m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.getConfig()->pValues->internalStyle == "slidevert" ||
+ m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.getConfig()->pValues->internalStyle.find("slidefadevert") == 0;
// commit
std::string wsname = "";
@@ -194,7 +195,8 @@ void CInputManager::onSwipeUpdate(wlr_pointer_swipe_update_event* e) {
static auto* const PSWIPENUMBER = &g_pConfigManager->getConfigValuePtr("gestures:workspace_swipe_numbered")->intValue;
static auto* const PSWIPEUSER = &g_pConfigManager->getConfigValuePtr("gestures:workspace_swipe_use_r")->intValue;
- const bool VERTANIMS = m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.getConfig()->pValues->internalStyle == "slidevert";
+ const bool VERTANIMS = m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.getConfig()->pValues->internalStyle == "slidevert" ||
+ m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.getConfig()->pValues->internalStyle.find("slidefadevert") == 0;
m_sActiveSwipe.delta += VERTANIMS ? (*PSWIPEINVR ? -e->dy : e->dy) : (*PSWIPEINVR ? -e->dx : e->dx);

View File

@ -1,24 +0,0 @@
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 1d22935f..b6093676 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -266,7 +266,7 @@ void CHyprRenderer::renderWindow(CWindow* pWindow, CMonitor* pMonitor, timespec*
static auto* const PDIMAROUND = &g_pConfigManager->getConfigValuePtr("decoration:dim_around")->floatValue;
static auto* const PBORDERSIZE = &g_pConfigManager->getConfigValuePtr("general:border_size")->intValue;
- SRenderData renderdata = {pMonitor, time, REALPOS.x, REALPOS.y};
+ SRenderData renderdata = {pMonitor, time, std::round(REALPOS.x), std::round(REALPOS.y)};
if (ignorePosition) {
renderdata.x = pMonitor->vecPosition.x;
renderdata.y = pMonitor->vecPosition.y;
@@ -276,8 +276,8 @@ void CHyprRenderer::renderWindow(CWindow* pWindow, CMonitor* pMonitor, timespec*
decorate = false;
renderdata.surface = pWindow->m_pWLSurface.wlr();
- renderdata.w = std::max(pWindow->m_vRealSize.vec().x, 5.0); // clamp the size to min 5,
- renderdata.h = std::max(pWindow->m_vRealSize.vec().y, 5.0); // otherwise we'll have issues later with invalid boxes
+ renderdata.w = std::round(std::max(pWindow->m_vRealSize.vec().x, 5.0)); // clamp the size to min 5,
+ renderdata.h = std::round(std::max(pWindow->m_vRealSize.vec().y, 5.0)); // otherwise we'll have issues later with invalid boxes
renderdata.dontRound = (pWindow->m_bIsFullscreen && PWORKSPACE->m_efFullscreenMode == FULLSCREEN_FULL) || (!pWindow->m_sSpecialRenderData.rounding);
renderdata.fadeAlpha = pWindow->m_fAlpha.fl() * (pWindow->m_bPinned ? 1.f : PWORKSPACE->m_fAlpha.fl());
renderdata.alpha = pWindow->m_fActiveInactiveAlpha.fl();