Is there any way to render a native Windows window appearance?

I’ve been really curious about one thing in GTK4 when using it in Windows.

Is there a way to use the native Windows APIs when adding a window?

The reason I ask, is 'cause when I build the application in any Linux distribution, it changes based on the theme. But when building it in Windows via MinGW, it uses the default GTK theme. And when using minimise or maximise, the window instantly minimises or maximises, and doesn’t use any rendered animations when doing so.

Maybe this is something unique to GtkSharp (the binding for GTK3), but it actually used the native APIs and animations. So I’m really curious if this is possible in GTK4 somehow. And if there’s any code in C on how to do it, I can surely implement it in C# as well.

Thank you in advance!

Hello @PlatinumLucario,

If you’re not using custom titlebars, you can set the environment variable GTK_CSD=0. This will give you native decorations and WM transitions.

Actually it’s possible to have WM transitions with Client Side Decorations, but not implemented yet

Awesome! Thank you for letting me know!

That also means I can hard code it into an application with the

g_setenv("GTK_GSD", "0", false);


Or in the case of C# (using GirCore):

GLib.Functions.Setenv("GTK_GSD", "0", false)
1 Like

Sure, it can be hardcoded as well