GTK4 - GtkGLArea breakdown - Fedora 40

Some time ago I also bumped into renderer issues with gtk4.14+, it wasn’t nVidia, but it looks similar in some way (asked here GTK4.14: Which GSK renderer is safe to use in general?), gtk4-demo was used as a reference app to be sure that’s not connected with own code. After getting that demo displayed normally with gl and opengl renderers, I’ve put GSK_RENDERER into code in own apps at the beginning of main() function, it’s like this:

if (!getenv("GSK_RENDERER")) {
  int major = gtk_get_major_version(), minor = gtk_get_minor_version();
  if ((major == 4) && ((minor == 14) || (minor == 15))) 
    putenv("GSK_RENDERER=gl");
}

and it still works in my case.