[linux] editing controlls sometimes (often) freezes the emulator
Tested using the newest commit as of october 2024, built using gtk3
when editing controlls, if you are not quick enough (and 60% of the time even if you are) the emulator will hard freeze.
music will still play, and the game will run, and if you already have some controls set up by the time it freezes, you can use those buttons.
but when I say it hard freezes, I mean it becomes impossible to quit the program. none of the UI is interactable, and alt+f4 does nothing. only thing that works is opening up the task manager and killing the process.
a similar issue was reported for the flatpak version in #731 that issue has been fixed (at least on fedora) but this new issue happens happens on all linux versions of desmume
I tried to reproduce using my local build, but no luck so far. Is it exclusive to flatpack version?
No I compiled the latest commit from source and reproduced the issue also happens in the fedora rpm fusion version
try opening the change A button and leaving it for like 30 seconds to a minute
I started a game, then opened 'Configure joystick controls' window, pressed a button at the top (configure A), the emulation paused, which is expected: the dialog appears waiting for the input in a loop in the main thread. I waited for a minute then pressed a button on my gamepad, input was accepted and emulation continued.
wayland vs X11 issue maybe ?
I am using wayland (gnome). what distro are you using @thesourcehim ?
and it only happens for joystick controlls, does not happen for keyboard controlls, are you using keyboard @thesourcehim ? and also try to cancle the edit joystick controlls
changing the focused window while this is up can also cause the freeze
Yes, I'm using gamepad. My system is Fedora 40, Plasma 6 wayland. You can not press Ok or Cancel until you give some input from your gamepad because as I explained earlier application enters a loop waiting for input. This can lead to a deadlock if for example gamepad gets disconnected while app is in the loop (hotplugging is not supported). I agree this is not the best way to configure controls, I'll rework that dialog to get input asynchronously. For now you have press something on a gamepad to exit the loop.
@intra0, please test PR #845
I explained earlier application enters a loop waiting for input sorry I read it but didn't fully process it at the time.
Tested PR #845 and it totally and completely fixed this issue. it no longer dead loops when I press edit controlls, and the cancel button now works.