It feels like the problem is to do with socket-activated Xwayland.
I can suppress the issue where firefox remains black, by editing my .desktop file to run "xlsclients" first. I.e.:
Exec=/bin/bash -c "xlsclients; MOZ_ENABLE_WAYLAND=0 /home/alan/firefox-104.0.2/firefox/firefox"
Similarly, the issue with gedit drawing square window border corners is suppressed if I use
Exec=/bin/bash -c "xlsclients; GDK_BACKEND=x11 gedit"
(With less confidence: it seemed that if I ran weston, then "Xwayland :2", then "MOZ_ENABLE_WAYLAND=0 DISPLAY=:2 firefox", then the resulting firefox window was usable).
It feels like the problem is to do with socket-activated Xwayland.
I can suppress the issue where firefox remains black, by editing my .desktop file to run "xlsclients" first. I.e.:
Exec=/bin/bash -c "xlsclients; MOZ_ENABLE_ WAYLAND= 0 /home/alan/ firefox- 104.0.2/ firefox/ firefox"
Similarly, the issue with gedit drawing square window border corners is suppressed if I use
Exec=/bin/bash -c "xlsclients; GDK_BACKEND=x11 gedit"
(With less confidence: it seemed that if I ran weston, then "Xwayland :2", then "MOZ_ENABLE_ WAYLAND= 0 DISPLAY=:2 firefox", then the resulting firefox window was usable).