Skip to content

fix: tab bars rendered in wrong orientation on rotated monitors#317

Open
yeldiRium wants to merge 1 commit into
outfoxxed:masterfrom
yeldiRium:fix/tab-bars-rotated-screen
Open

fix: tab bars rendered in wrong orientation on rotated monitors#317
yeldiRium wants to merge 1 commit into
outfoxxed:masterfrom
yeldiRium:fix/tab-bars-rotated-screen

Conversation

@yeldiRium

@yeldiRium yeldiRium commented Jun 8, 2026

Copy link
Copy Markdown

hi,

since development on #314 seems stalled, i wanted to give it a try. I have very little experience with cpp but otherwise a lot of development experience and used github copilot to make the fix. Of course i tested the changes locally, since i don't want to submit slop anywhere, and the issue is fixed on my computer with a 90° rotated monitor.

Since the issue existed before (#182) i assumed that some later change reintroduced it. Copilot found the regression introduced in 76010d9 and the fix looks reasonable and simple to me. here is copilots explanation of the change:

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).

I hope this makes sense and the change is reasonable and i'm not wasting anyone's time.


Fixes #314.

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>
@yeldiRium
yeldiRium force-pushed the fix/tab-bars-rotated-screen branch from 51c66bf to 72b401b Compare June 8, 2026 16:24
@Drulex

Drulex commented Jun 22, 2026

Copy link
Copy Markdown

FYI I am also running into this issue. I have two external monitors, one is rotated 270 degrees, and the tab bar is completely borked on the rotated monitor.

I have tried your patch, but it did not solve the issue for me. I see the same behavior, more precisely:
- vertical tab bar placed at the left of the screen instead of horizontal tab bar placed at the top
- tab highlighting is on the vertical tab, but tab titles are on the horizontal tab
- some visual glitches on the vertical bar (highlighting appearing, disappearing as mouse is moved or keys are pressed on the keyboard)

I'll try to investigate on my side as well and hopefully come back with some productive feedback.

Edit: I stand corrected, the fix works just fine (I was loading the wrong .so this whole time).

Thanks for your patch @yeldiRium

@partyvan

Copy link
Copy Markdown

can confirm that on nixos 26.05 (which, relative to 25.11, introduced this as a regression), you can do the following in home-manager:

plugins = with pkgs.hyprlandPlugins; [
  (hy3.overrideAttrs ({ patches ? [], ... }: {
    patches = patches ++ [ (pkgs.fetchpatch {
      url = "https://github.com/yeldiRium/hy3/commit/72b401b48de85bc0e2882f17f1b10a1ec2757b6d.patch";
      hash = "sha256-FX2AphqV84hfgHxsQUuxoSV66m04O/h52BUoF89YN84=";
    }) ];
  }))
  # your other epic plugins here
];

and the bug goes away. patch lgtm (for whatever some random outsider's opinion is worth)

@0xcharly

Copy link
Copy Markdown

Also confirming this patch solves the issue. (NixOS 26.05)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: tilted screen

4 participants