Simple GTK4 application doesn't show text, button and header text

I found a user that has a bug with GTK4 and that doesn’t show any text and the single button.

But if they expand the window, the text and button appears (the program looks like intended).

image
image1

I couldn’t reproduce the error on different machines, but I’d like to know if it’s possible to debug or fix.

Machine information:
OS: Windows 10 Pro 22H2, build 19045.4651
CPU: AMD A6 3620 quad core
GPU: GT730

What more information should I gather from the user?
What should we try to fix the issue?

The expecting look is the following:
image

We tested the program without Adwaita, it also doesn’t show text

image

Hi,

Which exact version of gtk is used?
Where do the DLLs of gtk (and dependencies) come from? msys2? self-compiled?

You may try to launch the app with different renderers, from a command line:

GSK_RENDERER=ngl   myapp.exe
GSK_RENDERER=gl    myapp.exe
GSK_RENDERER=cairo myapp.exe
1 Like

Setting GSK_RENDERER=gl helped to display the text and other stuff. I also found out that user has issues with Vulkan applications/games.

I’ve installed the toolchain that described in Windows - GUI development with Rust and GTK 4 “Build GTK 4 with gvsbuild and MSVC (recommended)”. DLLs are compiled with GitHub - wingtk/gvsbuild: GTK stack for Windows (I guess it means that they are compiled with msys2)

GTK version is 4.14.4

Is it possible to programmatically set renderer before application starts?

The HW looks quite old… I remember of some issues reported on gitlab about old GPU drivers not properly advertising their opengl capabilities, that’s probably the case here.

You can force the GSK_RENDERER value in the app with GLib.setenv, at early startup, but that may negatively impact other users… Better let people set the environment on their own.
This issue should only affect old HW and old GPU drivers, anyway.

1 Like

No, it can’t affect other users, because you’d be changing the environment for the application only if you set the variable programmatically.

Setting the environment variable programmatically before initialising GTK is actually the recommended best practice. Of course, it means using an older renderer everywhere, even on modern hardware, so that’s the actual trade-off you’d be making.

1 Like

I can also provide a bat file that launches the old renderer so it’s launched explicitly for affected user.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.