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

[Skia.GTK] Controls are not rendered correctly if hardware acceleration is enabled #10484

Open
manfromarce opened this issue Nov 18, 2022 · 11 comments · Fixed by #10672 or #11497
Open
Labels
area/skia/stability ✏️ area/skia ✏️ Categorizes an issue or PR as relevant to Skia difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/bug Something isn't working low-hanging-🍒 Categorizes an issue that might be a quick win with meaningful positive impact. platform/linux 🐧 Categorizes an issue or PR as relevant to Linux platforms

Comments

@manfromarce
Copy link
Contributor

Current behavior

Some controls are not rendered properly on GTK when hardware accelaration is enabled. In particular it seems that background and other visual properties are not applied in the correct region. You can see in the GIF below that for example menus and flyouts have a transparent area and the highlight color on mouse hover starts at the very bottom of each MenuItem, while a button with AccentButtonStyle has white foreground color (which is correct) but the background is not applied.

1

Expected behavior

2

How to reproduce it (as minimally and precisely as possible)

MyApp.zip

Workaround

It looks as expected when disabling hardware acceleration in the Gtk project:
host.RenderSurfaceType = RenderSurfaceType.Software;

Works on UWP/WinUI

Yes

Environment

Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia

NuGet package version(s)

4.6.19

Affected platforms

Skia (GTK on Linux/macOS/Windows)

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

@manfromarce manfromarce added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Nov 18, 2022
@jeromelaban
Copy link
Member

Thanks for the report. We've made some recent changes for this that may help. Try updating to uno to the latest 4.7-dev prerelease bits.

@jeromelaban jeromelaban added the triage/needs-information Indicates an issue needs more information in order to work on it. label Nov 18, 2022
@manfromarce
Copy link
Contributor Author

I've updated to 4.7.0-dev.266 and it's interesting that flyouts look fine the first time they are displayed, but the second time they are transparent again. The other issues seem to be still there, the only difference is that controls derived from button have a new thin bottom border.

@jeromelaban
Copy link
Member

Thanks for the update.

@jeromelaban jeromelaban added platform/linux 🐧 Categorizes an issue or PR as relevant to Linux platforms and removed triage/needs-information Indicates an issue needs more information in order to work on it. triage/untriaged Indicates an issue requires triaging or verification labels Nov 18, 2022
@jeromelaban
Copy link
Member

@MartinZikmund does this look related to the clipping work you were looking at ? (fyi, it's not fixed in latest 4.7-dev)

@jeromelaban jeromelaban added the area/skia ✏️ Categorizes an issue or PR as relevant to Skia label Nov 21, 2022
@MartinZikmund
Copy link
Member

Definitely odd, will look into it

@MartinZikmund
Copy link
Member

@manfromarce Can you please verify whether the latest changes have resolved the issue by trying with the most recent -dev prerelease packages?

@manfromarce
Copy link
Contributor Author

It doesn't seem to be fixed, sorry. I have tried 4.7.0-dev.584 on Windows only at the moment, but I can test it on Linux with a different hardware to see if anything changes.

@jeromelaban jeromelaban reopened this Dec 9, 2022
@MartinZikmund
Copy link
Member

MartinZikmund commented Dec 9, 2022

@jeromelaban Are you able to repro the issues with 4.7.0-dev.584? On my side it looks right 🤔 . I took the zip above, updated all packages to 4.7.0-dev.584 and ran GTK with HW

Update: Tested with 150% and 200% scaling, but still no repro 🤔

@jeromelaban
Copy link
Member

I'll test on my side. @manfromarce sometimes updating nuget packages does not pickup the latest version, can you try deleting the bin/obj folders and try again?

@manfromarce
Copy link
Contributor Author

I've tried deleting the bin and obj folder but it didn't change

@MartinZikmund MartinZikmund added difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI low-hanging-🍒 Categorizes an issue that might be a quick win with meaningful positive impact. labels Aug 23, 2023
@MartinZikmund
Copy link
Member

MartinZikmund commented Nov 14, 2023

As seen in #14402, in some cases the 1 pixel guard band can cause quite disastrous issues when fractional scaling was enabled on GTK (see SimpleCalc screenshot of 150 scaling below, working ok in 100 and 200 scaling) - disabled in #14403

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/skia/stability ✏️ area/skia ✏️ Categorizes an issue or PR as relevant to Skia difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/bug Something isn't working low-hanging-🍒 Categorizes an issue that might be a quick win with meaningful positive impact. platform/linux 🐧 Categorizes an issue or PR as relevant to Linux platforms
Projects
None yet
4 participants