Linux standalone player crashes on dragging mouse pointer in custom xsession

My game is running inside a custom xsession without window manager in Ubuntu 20.04.
It crashes when I drag the mouse pointer(or swipe using touch screen) in my game.

The custom xsession file (/usr/share/xsessions/game.desktop) is similar to the following:

[Desktop Entry]
Name=Game
Exec=/home/foo/bar.run

The crash happens on Unity 2020.3.43f1 or above (and some newer Unity 2021 versions) and does not happen on Unity 2020.3.42f1 or older.

I found that the crash is caused by “UnitySelectMonitor” in player prefs. I can reproduce the crash by setting “UnitySelectMonitor” to -1 or removing it from prefs before launching the player.

After reading some release notes, I guess it is a regression introduced by the fix of the following bug:
Linux: Fixed Multi Display mouse/touch input registers incorrectly on Linux Standalone player. (UUM-1569)

Same for my game using Unity 2021.3.23f1