Empty see-through graphics window in Qt session for B1 example

Hi everyone, This is a weird one.

I have been running Geant4 10.6.1 successfully since its release. I just upgraded my computer from Fedora 30 to 32. The upgrade was successful with no problems. To avoid any library issues, I always reinstall the latest version of Geant when I do a Fedora upgrade. So I rebuilt and reinstalled Geant4 10.6.1 as I usually do:

cmake -DGEANT4_BUILD_CXXSTD=c++11 -DGEANT4_BUILD_MULTITHREADED=ON -DGEANT4_USE_OPENGL_X11=ON -DGEANT4_USE_QT=ON -DGEANT4_INSTALL_EXAMPLES=ON -DGEANT4_INSTALL_DATA=ON -DCMAKE_INSTALL_PREFIX=/home/jmcfee/geant4/geant4.10.6.p01-install /home/jmcfee/geant4/geant4.10.06.p01 make -j8
$ make install
It was successful. To test that all was well, I built example B1 from the G4 distribution:

./exampleB1 Available UI session types: [ Qt, GAG, tcsh, csh ]
QSocketNotifier: Can only be used with threads started with QThread G4WT0 > /control/saveHistory
$ G4WT1 > /control/saveHistory

When I ran it, the Qt gui interface appeared but the rectangular window where the geometry layout should be was “see through”, that is empty and I could see whatever of the desktop was behind it (see figure attached). This also occurs with other programs from the distribution and my own as well. There are no error messages in the command window and none in the terminal window other than the “QSocketNotifier:…” message, which I do not know if it is even an error or warning. Has anyone come across this and know how to fix it?

So I found the problem. My upgraded system was using Gnome with Wayland as the default display server. When I switched the session to Gnome with Xorg which uses X11 as the display server, the Qt GUI looks normal.

But this brings up a more fundamental question: Can Geant4 be compiled so that it can use Wayland rather than X11, since Wayland is now the default display server for Fedora and it is probably superior to X11?

Very helpful! Works also for fedora 35.

And still the same with Fedora 36…
Gnome with the good old Xorg works FINE!

It should continue to work as long as Fedora continues to support Xorg. I filed a Bugzilla report in May 2020 regarding the issue (2242). The report was eventually closed but one conclusion was that the X11 window displayed properly under Wayland if Geant4 was compiled with X11 on and Qt off. Not an ideal solution, but workable.