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

Disable srgb on Linux and macOS #1885

Merged
merged 4 commits into from Jun 5, 2023

Conversation

fredizzimo
Copy link
Member

@fredizzimo fredizzimo commented Jun 2, 2023

What kind of change does this PR introduce?

This disables srgb on Linux and macOs to fix issues with wrong colors being rendered on Wayland with Nvidia.

It's still enabled on Windows by default to work around #907.

Note that the actual rendering is always non-srgb due to the options we pass to Skia. Enabling srgb only enables the support, so it should really not be needed.

Disabling it fixes a bug on Wayland with Nvidia cards where the colours are rendered wrong.

This also adds the full pair of parameters --srgb, --nosrgb, --vsync --novsync. So that you always can override what's set in the environment variables. The implementation is not the best due to missing support in clap, see clap-rs/clap#3146 and clap-rs/clap#815

Finally it fixes the environment variables, they have now been renamed to NEOVIDE_VSYNC and NEOVIDE_SRGB,
and now work as they should. Previously NEOVIDE_NO_SRGB=1 enabled SRGB, so the environment variable value was actually inverted. Note the same fix is included in #1119 @LoipesMas

And I almost forgot, it also improves the way the cmd_line tests are run serially and isolates the environment variable setting to affect only one test.

Did this PR introduce a breaking change?

A breaking change includes anything that breaks backwards compatibility either at compile or run time.

Yes, NEOVIDE_NO_SRGB=0 is now NEOVIDE_SRGB=0 and
NEOVIDE_NO_VSYNC=0 is now NEOVIDE_VSYNC=1.

Srgb is disabled by default on Linux and macOS, previously it was enabled, so it could cause regressions.

NOTE: I have only tested this on X11 and Wayland with KDE Plasma 5.27.5 and Nvidia drivers 525.116.04-1. Wayland did not work properly with this configuration before these changes. Windows should be unchanged, but I haven't tested it, and I don't own a macOS machine.

@last-partizan
Copy link
Collaborator

I think we can resolve conflicts and merge this. Looking good to me.

The environment variable has changed to NEOVIDE_VSYNC and NEOVIDE_SRGB,
and now works as it should. Previously NEOVIDE_NO_SRGB=1 enabled SRGB so
the environment variable value was inverted.
@fredizzimo
Copy link
Member Author

@last-partizan, I rebased it, and also made _nosrgb and _novsync private as they should be.

@last-partizan
Copy link
Collaborator

Checked it on linux/wayland. Works fine, merging.

@last-partizan last-partizan merged commit 68a7475 into neovide:main Jun 5, 2023
3 checks passed
falcucci pushed a commit to falcucci/neovide that referenced this pull request Jun 6, 2023
* Improve the code for running cmd_line tests serially

* Improve handling of vsync and srgb and fix the environment variable.

The environment variable has changed to NEOVIDE_VSYNC and NEOVIDE_SRGB,
and now works as it should. Previously NEOVIDE_NO_SRGB=1 enabled SRGB so
the environment variable value was inverted.

* Disable srgb on non-windows platforms.

* Make _nosrgb and _novsync private
LoipesMas added a commit to LoipesMas/neovide that referenced this pull request Jun 6, 2023
It was changed in neovide#1885, but docs weren't updated
@LoipesMas LoipesMas mentioned this pull request Jun 6, 2023
last-partizan pushed a commit that referenced this pull request Jun 7, 2023
The argument was flipped, but the behaviour was not.
It was changed in #1885, but docs weren't updated
falcucci pushed a commit to falcucci/neovide that referenced this pull request Jun 7, 2023
The argument was flipped, but the behaviour was not.
It was changed in neovide#1885, but docs weren't updated
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.

None yet

2 participants