I’ve found F40/GTK4/Mesa has problems with some configurations because of GTK4’s shift to the “ngl” renderer. My older Dell laptop with an NVS3100M graphics card and the nouveau driver had all sorts of problems displaying GTK4 apps. I’ve not had good luck trying the patched nVidia 340.xxx series driver in F39 so I’m not going to waste my time trying to get it to work with F40 (it’s probably going to be even worse trying to get it to run).
The one thing that got me back up and running well was to disable the “ngl” renderer for GTK4 apps and revert back to the “gl” renderer. As root:
echo "export GSK_RENDERER=gl" > /etc/profile.d/gtk_renderer.sh
then reboot.
My suspicion is that Mesa is at the bottom of these issues. It doesn’t seem to be playing well with the GTK4 “ngl” renderer for some configurations. Newer Mesa version fixed a lot of issues I was seeing when running F40 in VMware virtual machines but they don’t seem to fix the issues I’m seeing on my Dell laptop.