Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: rotated outputs #112

Merged
merged 10 commits into from
Apr 27, 2023
Merged

Fix: rotated outputs #112

merged 10 commits into from
Apr 27, 2023

Conversation

ErikReider
Copy link
Collaborator

@ErikReider ErikReider commented Feb 14, 2023

Fixes: #47

Some things don't work (mostly position dependent rounding).

Todo:

  • Per-side window rounding with titlebars
  • Window border corners
  • Rounded quad frag shader

Issues:

image

image

Everything else should work 🤞

Testing:

  1. I recommend to create a local simple sway config with a different MOD key (I use alt) for testing.
  2. Add this to said config:
output WL-1 {
	transform 270
}
  1. Run in a terminal in nested mode with said config

@WillPower3309 WillPower3309 force-pushed the rotation-fix branch 2 times, most recently from 8ab81ad to 788fae8 Compare April 19, 2023 03:36
@WillPower3309
Copy link
Owner

Two comments:

  1. I was going to rebase from master, but blur REALLY messes this up. I think the monitor box we create with blur may also need to be rotated
  2. I'm not 100% sure that moving things from fx_renderer.c to render.c like I did in the most recent commit was the way to go due to the box size checking that happens at the start of the fx_renderer rendering functions

We can continue as is for now with the border corners and tackle those couple of comments later. We may want to have a separate PR for fixing the titlebar stuff as I don't think it'll be fun :S

@ErikReider
Copy link
Collaborator Author

ErikReider commented Apr 19, 2023

  1. I was going to rebase from master, but blur REALLY messes this up. I think the monitor box we create with blur may also need to be rotated

Fixed :)

Also rebased from master

Comment on lines 36 to 39
wlr_output_transformed_resolution(output, &monitor_box.width, &monitor_box.height);
wlr_box_transform(&monitor_box, &monitor_box,
wlr_output_transform_invert(output->transform),
monitor_box.width, monitor_box.height);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add a struct wlr_box *monitor_box as a function parameter

@ErikReider
Copy link
Collaborator Author

So the only thing left I guess would be "fixing" the corners with a uncomfortably long switch statement (until we rework the borders), fix the blur (doesn't work on portrait orientations) :)

@WillPower3309
Copy link
Owner

Titlebars too but they can be a follow up

@ErikReider ErikReider marked this pull request as ready for review April 20, 2023 13:50
@ErikReider
Copy link
Collaborator Author

Luckily I had that ugly switch statement in a months old stash so didn't have to recreate it 😅

Everything should be "ready" now. The only thing that's not working is the titlebars which we agreed on working on in a new PR if I haven't misunderstood you completely :)

@WillPower3309
Copy link
Owner

I think I could extend this to work with fixing rotated titlebars. Will do so tomorrow

@GlitchyCrafting
Copy link
Contributor

Does your guy's vertical monitors do this?
It only happens on my vertical monitor, I am using the git version.
Different config doesn't change it.
Background and windows don't fill the whole monitor, but the mouse will go on the empty area.
My monitor is 1024x1280 not 1080p if that helps.

The GIF ruined the resoulution and framerate.
output

@WillPower3309
Copy link
Owner

Mind trying out this branch and seeing if the issue persists? That's not behavior I've encountered :S

@GlitchyCrafting
Copy link
Contributor

That fixed everything, thx.

@WillPower3309
Copy link
Owner

WillPower3309 commented Apr 24, 2023

merging from master will break this (thanks to b610419 and 3d1b294). Will take a look at it tomorrow. I'm trying to clean up fx_renderer's reliance on wlr_output since we only ever use its width and height. Feel like we create and then modify too many monitor_boxes right now

@WillPower3309
Copy link
Owner

WillPower3309 commented Apr 26, 2023

Just rebased from master. Some Y axis issues with blur (only when tiled so probably with the x-ray too), but otherwise good.

@WillPower3309 WillPower3309 changed the title Initial rotation fixes Rotation fixes Apr 26, 2023
@WillPower3309 WillPower3309 changed the title Rotation fixes Fix: rotated outputs Apr 26, 2023
@@ -1,3 +1,4 @@
#include <wlr/util/box.h>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove

Copy link
Owner

@WillPower3309 WillPower3309 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to look into the projection / matrix thing and the tradeoffs in code cleanliness, which means that this PR has two items left:

TODO:

  • fix blur issue
  • investigate where and how matrix should be computed

Comment on lines +1846 to +1851
struct wlr_box monitor_box = get_monitor_box(wlr_output);
wlr_box_transform(&monitor_box, &monitor_box,
wlr_output_transform_invert(wlr_output->transform),
monitor_box.width, monitor_box.height);

fx_renderer_begin(renderer, monitor_box.width, monitor_box.height);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be cleaner if there was a way to just get the width and height of the transform invert output instead of the entire box. Haven't found a way based on a quick scroll through wlroots

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Part of window disappears on vertical monitor
3 participants