[raiguard][1.1.107] Linux Wayland / libdecor: Window disappears after UI interaction, sound loop continues

Post Reply
danpb
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed Jun 12, 2019 8:51 am
Contact:

[raiguard][1.1.107] Linux Wayland / libdecor: Window disappears after UI interaction, sound loop continues

Post by danpb »

When starting the game under Wayland using
SDL_VIDEODRIVER=wayland ./factorio/bin/x64/factorio
, I sometimes experience that the window disappears entirely. The sound loop is still playing, and the logs in the console do not show any sign of an error. The game does not stop (it is still running in the console), but it appears to be frozen (I tried to wait for the next autosave before killing the game, but it did not show any sign of starting the next autosave).

This has happened at several stages in the game, always after an interaction with the Game UI:
- After Startup, having the Mod list open, after clicking "Changelog" on the updates tab of a mod that had updates
- During a non-blocking save (i disabled non-blocking saves afterwards); don't remember what UI i was clicking
- During normal gameplay after clicking on some building (or maybe in the dialog from that building, a requester chest or something like that)

All occasions happened at very different times; i did not see a pattern other than that it always happened after i clicked something in the game UI.

I never had the issue before using the Wayland option, so i suspect that it is related. (I started using the wayland option along with updating from 1.1.104 to 1.1.107, so there is a possibility that it might be unrelated to the wayland option after all)

As the log did not show any error message, I tried to attach using gdb to provide a backtrace. Not sure which process is the right one to attach to, first tried to attach to the only child process whose time was still incrementing, but the backtrace looked like i ended up in the audio loop. The other process whose time was still incrementing was the main factorio process. This is the backtrace:

Code: Select all

(gdb) bt
#0  lll_mutex_unlock_optimized (mutex=0x3877a28) at ./nptl/pthread_mutex_unlock.c:43
#1  __GI___pthread_mutex_unlock_usercnt (decr=1, mutex=0x3877a28) at ./nptl/pthread_mutex_unlock.c:68
#2  ___pthread_mutex_unlock (mutex=0x3877a28) at ./nptl/pthread_mutex_unlock.c:368
#3  0x00007fe3135ed45b in wl_display_dispatch_queue_pending () at /lib/x86_64-linux-gnu/libwayland-client.so.0
#4  0x00007fe318c9376d in  () at /usr/lib/x86_64-linux-gnu/libdecor/plugins-1/libdecor-cairo.so
#5  0x000000000184ea9c in Wayland_PumpEvents ()
#6  0x000000000180324f in SDL_PumpEventsInternal.lto_priv.0 ()
#7  0x0000000000bf5e1a in WindowHandler::pollEvent(CompactDeque<Event>&, bool) ()
#8  0x0000000000bf76d5 in SDLWindow::pollEvent(Event&) ()
#9  0x0000000001c65c40 in GlobalContext::nextEvent() [clone .isra.0] ()
#10 0x00000000007bf820 in MainLoop::processAllegroEvents(bool) ()
#11 0x00000000007c2716 in MainLoop::prePrepare() ()
#12 0x00000000007c500e in MainLoop::run(Filesystem::Path const&, Filesystem::Path const&, bool, bool, std::function<void ()>, Filesystem::Path const&, MainLoop::HeavyMode) ()
#13 0x0000000000616c9b in main ()
So I do suspect the bug to be related to some problem inside libdecor event handling when called from wayland.

I am running Ubuntu 22.04 with the default Gnome desktop manager.

Log:
factorio-wayland-bug.log
log (at the moment of the backtrace, after window disappeared and waiting 20 mins for autosave to happen)
(47.18 KiB) Downloaded 13 times
I did not attach a save file because the bug did also occur in the main menu before starting to play.

danpb
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed Jun 12, 2019 8:51 am
Contact:

Re: [1.1.107] Linux Wayland / libdecor: Window disappears after UI interaction, sound loop continues

Post by danpb »

I should add that i cannot reproduce the behavior. For example, the first time that i noticed the window disapper, it happened when trying to view the changelog of a mod before updating. After killing and again starting the game, I was able to see the changelog without any problems.

User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 456
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

Re: [1.1.107] Linux Wayland / libdecor: Window disappears after UI interaction, sound loop continues

Post by raiguard »

Are you using fractional scaling?

It's possible that this is a bug specific to SDL and libdecor, in which case there will unfortunately be no fix for 1.1, since updating SDL is too large of a change to do to 1.1 at this point.
Don't forget, you're here forever.

danpb
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed Jun 12, 2019 8:51 am
Contact:

Re: [raiguard][1.1.107] Linux Wayland / libdecor: Window disappears after UI interaction, sound loop continues

Post by danpb »

Yes, fractional scaling is active (it's set to 100% on the main screen; but the setting is active, nonetheless, as I use fractional scaling on a secondary screen.

I understand that it's not feasible for 1.1; no problem :) For now, there is no need for me to use the Wayland flag.

Looking forward to 2.0 and SA, and thanks for the great Linux support!

Post Reply

Return to “Assigned”