268471de00372520a06fcd719e2ccf6567759223

Author
outfoxxed <outfoxxed@outfoxxed.me>
Committer
outfoxxed <outfoxxed@outfoxxed.me>
Date

Message

fixup: convert tab rendering to render pass following hyprland#8683

Diff

This diff is truncated to protect this page.

  1diff --git a/flake.lock b/flake.lock
  2index 01a8d03f684132b361ec329ef3876f8bf0a3a6b1..5771ace18a92c7fbfddd85216bfa8b4d648a2cce 100644
  3--- a/flake.lock
  4+++ b/flake.lock
  5@@ -20,11 +20,11 @@
  6         ]
  7       },
  8       "locked": {
  9-        "lastModified": 1734400729,
 10-        "narHash": "sha256-Bf+oya0BuleVXYGIWsb0eWnrK6s0aiesOsI7Mpj1pMU=",
 11+        "lastModified": 1734906446,
 12+        "narHash": "sha256-6OWluVE2A8xi+8V3jN9KA72RCgJjYdyyuLBUjxZ2q2U=",
 13         "owner": "hyprwm",
 14         "repo": "aquamarine",
 15-        "rev": "a132fa41be7ebe797ad758e84d9df068151a723b",
 16+        "rev": "eecb74dc79bb6752a2a507e6edee3042390a6091",
 17         "type": "github"
 18       },
 19       "original": {
 20@@ -87,11 +87,11 @@
 21         ]
 22       },
 23       "locked": {
 24-        "lastModified": 1734364709,
 25-        "narHash": "sha256-+2bZJL2u5hva7rSp65OfKJBK+k03T6GB/NCvpoS1OOo=",
 26+        "lastModified": 1734906540,
 27+        "narHash": "sha256-vQ/L9hZFezC0LquLo4TWXkyniWtYBlFHAKIsDc7PYJE=",
 28         "owner": "hyprwm",
 29         "repo": "hyprcursor",
 30-        "rev": "f388aacd22be4a6e4d634fbaf6f75eb0713d239a",
 31+        "rev": "69270ba8f057d55b0e6c2dca0e165d652856e613",
 32         "type": "github"
 33       },
 34       "original": {
 35@@ -116,11 +116,11 @@
 36         ]
 37       },
 38       "locked": {
 39-        "lastModified": 1733684019,
 40-        "narHash": "sha256-2kYREgmSmbLsmDpLEq96hxVAU3qz8aCvVhF65yCFZHY=",
 41+        "lastModified": 1734906236,
 42+        "narHash": "sha256-vH/ysV2ONGQgYZPtcJKwc8jJivzyVxru2aaOxC20ZOE=",
 43         "owner": "hyprwm",
 44         "repo": "hyprgraphics",
 45-        "rev": "fb2c0268645a77403af3b8a4ce8fa7ba5917f15d",
 46+        "rev": "6dea3fba08fd704dd624b6d4b261638fb4003c9c",
 47         "type": "github"
 48       },
 49       "original": {
 50@@ -145,17 +145,17 @@
 51         "xdph": "xdph"
 52       },
 53       "locked": {
 54-        "lastModified": 1734423633,
 55-        "narHash": "sha256-iCbptYR35ifgIwkvU44u6Pbub72wlq7wmlNtemqABOk=",
 56+        "lastModified": 1734907157,
 57+        "narHash": "sha256-sF3Wot4jIemoSo0YigdHyoR5JMaXgKja+mPJGoXXk/k=",
 58         "owner": "hyprwm",
 59         "repo": "Hyprland",
 60-        "rev": "c7d97199103fd1ca43c2a9810c085df5500169ac",
 61+        "rev": "5f7ad767dbf0bac9ddd6bf6c825fb9ed7921308a",
 62         "type": "github"
 63       },
 64       "original": {
 65         "owner": "hyprwm",
 66         "repo": "Hyprland",
 67-        "rev": "c7d97199103fd1ca43c2a9810c085df5500169ac",
 68+        "rev": "5f7ad767dbf0bac9ddd6bf6c825fb9ed7921308a",
 69         "type": "github"
 70       }
 71     },
 72@@ -200,11 +200,11 @@
 73         ]
 74       },
 75       "locked": {
 76-        "lastModified": 1733940128,
 77-        "narHash": "sha256-hmfXWj2GA9cj1QUkPFYtAAeohhs615zL4E3APy3FnvQ=",
 78+        "lastModified": 1734906472,
 79+        "narHash": "sha256-pWPRv/GA/X/iAwoE6gMNUqn/ZeJX1IeLPRpZI0tTPK0=",
 80         "owner": "hyprwm",
 81         "repo": "hyprland-qtutils",
 82-        "rev": "3833097e50473a152dd614d4b468886840b4ea78",
 83+        "rev": "c77109d7e1ddbcdb87cafd32ce411f76328ae152",
 84         "type": "github"
 85       },
 86       "original": {
 87@@ -229,11 +229,11 @@
 88         ]
 89       },
 90       "locked": {
 91-        "lastModified": 1734364628,
 92-        "narHash": "sha256-ii8fzJfI953n/EmIxVvq64ZAwhvwuuPHWfGd61/mJG8=",
 93+        "lastModified": 1734906259,
 94+        "narHash": "sha256-P79t/7HbACO4/PuJBroGpTptvCWJtXTv+gWsF+sM6MI=",
 95         "owner": "hyprwm",
 96         "repo": "hyprlang",
 97-        "rev": "16e59c1eb13d9fb6de066f54e7555eb5e8a4aba5",
 98+        "rev": "0404833ea18d543df44df935ebf1b497310eb046",
 99         "type": "github"
100       },
101       "original": {
102@@ -254,11 +254,11 @@
103         ]
104       },
105diff --git a/flake.nix b/flake.nix
106index 7293ddad885f339a3f694708f1b83ff7b34b37b9..93d75c59a7332ebac32e915ef3a170a50e7fcaf3 100644
107--- a/flake.nix
108+++ b/flake.nix
109@@ -1,6 +1,6 @@
110 {
111   inputs = {
112-    hyprland.url = "github:hyprwm/Hyprland?rev=c7d97199103fd1ca43c2a9810c085df5500169ac";
113+    hyprland.url = "github:hyprwm/Hyprland?rev=5f7ad767dbf0bac9ddd6bf6c825fb9ed7921308a";
114   };
115 
116   outputs = { self, hyprland, ... }: let
117diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp
118index 3b43f7c5ead2914712cb019f3bdc5f32fc0afe18..519e6acc7790e64c4728b75aac1a00e272998ce6 100644
119--- a/src/Hy3Layout.cpp
120+++ b/src/Hy3Layout.cpp
121@@ -12,6 +12,7 @@
122 #include "Hy3Layout.hpp"
123 #include "Hy3Node.hpp"
124 #include "SelectionHook.hpp"
125+#include "TabGroup.hpp"
126 #include "globals.hpp"
127 #include "src/desktop/Window.hpp"
128 
129@@ -1520,11 +1521,11 @@ void Hy3Layout::renderHook(void*, SCallbackInfo&, std::any data) {
130 		if (!rendering_normally) break;
131 
132 		for (auto& entry: g_Hy3Layout->tab_groups) {
133-			if (!entry.hidden && entry.target_window == g_pHyprOpenGL->m_pCurrentWindow.lock()
134+			if (!entry.hidden && entry.target_window == g_pHyprOpenGL->m_RenderData.currentWindow.lock()
135 			    && std::find(rendered_groups.begin(), rendered_groups.end(), &entry)
136 			           == rendered_groups.end())
137 			{
138-				entry.renderTabBar();
139+				g_pHyprRenderer->m_sRenderPass.add(entry.pass);
140 				rendered_groups.push_back(&entry);
141 			}
142 		}
143@@ -1539,6 +1540,7 @@ void Hy3Layout::renderHook(void*, SCallbackInfo&, std::any data) {
144 			    && std::find(rendered_groups.begin(), rendered_groups.end(), &entry)
145 			           == rendered_groups.end())
146 			{
147+				g_pHyprRenderer->m_sRenderPass.add(entry.pass);
148 				entry.renderTabBar();
149 			}
150 		}
151diff --git a/src/TabGroup.cpp b/src/TabGroup.cpp
152index 44425c263cf82f9ab3d2d73f8c13590f1d3062b6..bf315a7b00c79c1a2cea00d5e6ca9fef70806f23 100644
153--- a/src/TabGroup.cpp
154+++ b/src/TabGroup.cpp
155@@ -8,6 +8,7 @@
156 #include <hyprland/src/render/OpenGL.hpp>
157 #include <hyprland/src/render/Texture.hpp>
158 #include <hyprutils/math/Box.hpp>
159+#include <hyprutils/math/Region.hpp>
160 #include <hyprutils/memory/SharedPtr.hpp>
161 #include <pango/pangocairo.h>
162 #include <pixman.h>
163@@ -687,6 +688,10 @@ void Hy3TabGroup::renderTabBar() {
164 	}
165 }
166 
167+void Hy3TabPassElement::draw(const CRegion& damage) {
168+	this->group->renderTabBar();
169+}
170+
171 void findOverlappingWindows(Hy3Node& node, float height, std::vector<PHLWINDOWREF>& windows) {
172 	switch (node.data.type()) {
173 	case Hy3NodeType::Window: windows.push_back(node.data.as_window()); break;
174diff --git a/src/TabGroup.hpp b/src/TabGroup.hpp
175index 70339c938d21c302e41fbf19cdb374547aa60bd7..d31cd2b6088041e308fd015482c4b3eaf3a94c80 100644
176--- a/src/TabGroup.hpp
177+++ b/src/TabGroup.hpp
178@@ -9,6 +9,7 @@ class Hy3TabBar;
179 
180 #include <hyprland/src/plugins/PluginAPI.hpp>
181 #include <hyprland/src/render/Texture.hpp>
182+#include <hyprland/src/render/Renderer.hpp>
183 
184 #include "Hy3Node.hpp"
185 
186@@ -83,6 +84,19 @@ private:
187 	Hy3TabBar(const Hy3TabBar&) = delete;
188 };
189 
190+class Hy3TabPassElement: public IPassElement {
191+public:
192+	Hy3TabPassElement(Hy3TabGroup* group): group(group) {}
193+
194+	void draw(const CRegion& damage) override;
195+	bool needsLiveBlur() override { return false; }
196+	bool needsPrecomputeBlur() override { return false; }
197+	const char* passName() override { return "Hy3TabPassElement"; }
198+
199+private:
200+	Hy3TabGroup* group;
201+};
202+
203 class Hy3TabGroup {
204 public:
205 	PHLWINDOW target_window = nullptr;
206@@ -101,6 +115,8 @@ public:
207 	// render the scaled tab bar on the current monitor.
208 	void renderTabBar();
209 
210+	SP<Hy3TabPassElement> pass = makeShared<Hy3TabPassElement>(this);
211+
212 private:
213 	std::vector<PHLWINDOWREF> stencil_windows;
214 	Vector2D last_workspace_offset;