-
-
Notifications
You must be signed in to change notification settings - Fork 178
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
Add option to rotate outputs #137
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Some more things:
- Screenshot should work fine. Changing transform when the screenshot UI is open shouldn't break it. Currently if the scale changes the screenshot UI will close automatically, just do the same with transform.
- Screencast should also work fine. Things should not break when the monitor is rotated while it's being screencasted. For now I suggest just stopping the screencast if that happens, because if the monitor is rotated 90° then the buffer dimensions would change, which there's no code to handle atm.
Niri::refresh_pointer_outputs()
seems to hardcodeTransform::Normal
for the clients right now, it should use the current output transform.
You probably need to change some hardcoded Transform values inside screenshot UI. |
Yeah, I think also might be caused by some hardcoded Transform values. |
Yes that appears to be the issue, changing some hardcoded values around changes makes it see the output correctly. |
This should at least document that the transform is counter clock wise as defined by the wayland protocol spec. |
Hmm. Sway calls it "transform" and performs it clockwise. I think we should do it clockwise too? |
Also fine, as long as it is documented/specified somewhere. |
The latest commit fixes the screenshot issue somewhat, the preview ignores the transform and is rotated normally, causing part of the desktop to be cut off, however the actual screenshot functions fine. |
Maybe due to the hardcoded transform in |
I made it rotate clockwise and also mentioned it in the default config |
I made |
I'll take a look myself then (but not today). |
Figured it out. Gonna push some commits into this PR. |
that's nice! should I invite you as a collaborator on my fork to make it easier to add the changes? |
It says "Maintainers are allowed to edit this pull request." which means I should be able to push to this branch. |
Pushed some fixes, please try if everything works. I changed transform to mean counter-clockwise (think it's more important to avoid confusion between the types). There are still a few bugs left, notably with direct scanout and with changing transform on the fly, but I suspect those need Smithay fixes. |
What bugs did you experience with changing transform on the fly? When I tested with a nested niri session it worked fine |
|
Is it possible to damage an output or force a redraw on it? I tried using |
I think we can fix this in Smithay instead |
Actually it turns out that the crash weren't caused by my changes but changing the transform on the fly generally just appears to cause niri to crash now |
Hmm? I haven't seen any crashes. Could you post the backtrace please? |
The crashes stopped happening and no matter what I do I cant seem to get them back, maybe it was fixed by me rebooting the computer |
Another win for the turning it off and on again computer fixing strategy Have you by chance been running niri as a session when you got the crashes? Then they might still be present in |
cb369da
to
401e4eb
Compare
I updated to the latest Smithay, and something I just noticed that might be new after the update: "flipped-90" and "flipped-270" are both vertically and horizontally flipped relative to their normal counterparts, whereas "flipped" and "flipped-180" are only horizontally flipped. In sway each flip is only horizontally flipped. @cmeissl could this be something that has regressed? |
Unlikely that this is a regression from the latest changes, can you give me simple reproduction steps? |
Set monitor transform "90", then change to "flipped-90", observe that it's flipped in both ways (so it should be "flipped-270" instead). |
Yeah, can reproduce this and no, this can not be caused by this changes. |
Yep theres a crash log in journalctl, though I still cannot reproduce it
|
I am able to reproduce this on a build that does not have the updated smithay yet |
Oh wow, thanks for that log. That is a part that is definitely not supposed to crash like that. |
Do you happen to remember what you did right before you got that crash? |
I edited the configuration to change the transform value for a screen, if it matters, the open application were firefox, foot and emacs |
I'm really not sure how that could've happened but I doubt the new transform code has anything to do with it, so I won't block this PR on that crash. However, I'll wait a bit more so that we can investigate the flipped-90/270 thing, and I will also once again check other compositors to settle on the clockwise vs. counter-clockwise. |
Can you give Smithay/smithay#1311 a try? |
Alright, now with the extra fix from @cmeissl everything seems to work fine. |
Rotation direction wise:
So I guess if there's no "standard" we can stick with counter-clockwise, as that makes the types match. |
a810ee3
to
9bb37e8
Compare
Adds support for output Transformation using a config option
transform
in theoutput
section to allow setting it per outputcloses #106
Attempting to do a screenshot on a rotated output (tested with rotation 270) currently cuts the available output to screenshot by half, any part of the selected area that goes into the "invisible" area becomes transparent