db288088c0e99cb15e72bc4468a2514bb26631a7

Author
Hannes Leutloff <hannes.leutloff@yeldirium.de>
Committer
outfoxxed <outfoxxed@outfoxxed.me>
Date

Message

fix: tab bars rendered in wrong orientation on rotated monitors

projectBoxToTarget internally composes getScaleMatrix() with
targetProjection.projectBox(), where targetProjection (m_projMatrix)
already contains the monitor's WL transform rotation. Passing
monitor_inverted as the transform parameter applies the inverse
rotation inside projectBox(), cancelling out the rotation already
present in m_projMatrix — reproducing the double-rotation bug that
was originally fixed in 0525702.

Pass HYPRUTILS_TRANSFORM_NORMAL instead, leaving m_projMatrix's
rotation intact, which is equivalent to the pre-refactor fix of
rdata.projection * monitorProjection.projectBox(monitorBox, NORMAL).

Assisted-by: Copilot <223556219+Copilot@users.noreply.github.com>

Diff

 1diff --git a/CHANGELOG.md b/CHANGELOG.md
 2index 4057b66b727e993836f78781e4505fd8ea953ba6..9afca63da9b3977e4c32fdfbffd4b636333c6f45 100644
 3--- a/CHANGELOG.md
 4+++ b/CHANGELOG.md
 5@@ -3,6 +3,7 @@
 6 # Upcoming
 7 
 8 - Fix mouse up+left mouse resize
 9+- Fix tab bars rendering in the wrong orientation on rotated monitors
10 
11 # hl0.56.0 and before
12 
13diff --git a/src/render.cpp b/src/render.cpp
14index 167decf92ce055da9e4cca451bf48318223e69ad..b507605820473b053a4b5786a6a0101657e6b5d0 100644
15--- a/src/render.cpp
16+++ b/src/render.cpp
17@@ -1,7 +1,6 @@
18 #include "render.hpp"
19 
20 #include <GLES2/gl2.h>
21-#include <hyprland/src/helpers/math/Math.hpp>
22 #include <hyprland/src/render/OpenGL.hpp>
23 #include <hyprland/src/render/gl/GLTexture.hpp>
24 #include <hyprland/src/render/Shader.hpp>
25@@ -34,13 +33,7 @@ void Hy3Render::renderTab(
26 	const auto& monitorSize = rdata.pMonitor->m_transformedSize;
27 	auto monitorBox = CBox {Vector2D(), monitorSize};
28 
29-	const auto monitor_inverted = Math::wlTransformToHyprutils(
30-			Math::invertTransform(g_pHyprRenderer->m_renderData.pMonitor->m_transform)
31-	);
32-
33-	Hyprutils::Math::eTransform transform = monitor_inverted;
34-
35-	auto glMatrix = g_pHyprRenderer->projectBoxToTarget(monitorBox, transform);
36+	auto glMatrix = g_pHyprRenderer->projectBoxToTarget(monitorBox, Hyprutils::Math::HYPRUTILS_TRANSFORM_NORMAL);
37 
38 	g_pHyprOpenGL->useShader(shader.program);
39