samdze / godot-launcher

Alternative launcher for single-board computers
MIT License
142 stars 9 forks source link

Launching Emulationstation blanks the screen #2

Open uberlinuxguy opened 3 years ago

uberlinuxguy commented 3 years ago

I am not sure if you want me to open this as an issue here, and if not, that's ok.

I have been playing with launching Emulationstation from within your launcher, as I had mentioned I would do on the clockworkpi forums. Emulationstation will launch from X by itself, but when I try to launch it within your launcher, it seems to switch right, but it blanks the screen. Killing emulationstation doesn't return it either, you have to restart X. Right now, it runs from a gnome-terminal session because I have been playing with retropie which needs a terminal in the background for some things. I can run it without the terminal and it does the same thing.

Here is a readout ofthe log from the launcher

[WM] Set always on top window to 4194307
Set status title to GameShell
MappingNotify event received from 0
App id returned: 0
[Start Command Entry thread]
cd '/home/cpi/godot-launcher/apps'
exec ./ES.sh
[End Command Entry]
ConfigureRequest event received from 14680070
Updating window title to Terminal
MapRequest event received from 14680070

MapNotify event received from 14680070
[WM GODOT] Active window returned: 14680070
[GODOT] Window mapped event: 14680070, stack: 4194307; 14680070; 
[GODOT] Activating a new window: 14680070
[GODOT] Giving the activating window to App LauncherApp
[GODOT] Adding a new app to the apps stack...
[WM GODOT] Active window returned: 14680070
[WM GODOT] Trying to get title of window 14680070
[WM GODOT] Window title received: Terminal
Set status title to Terminal
[GODOT] App title set
Switching to TRANSPARENT mode.
[GODOT] New app added to the apps stack.

ConfigureRequest event received from 18874391
Updating window title to EmulationStation
MapRequest event received from 18874391

MapNotify event received from 18874391
[WM GODOT] Active window returned: 18874391
Set status title to EmulationStation
[GODOT] Window mapped event: 18874391, stack: 4194307; 14680070; 18874391; 
[GODOT] Activating a new window: 18874391
[GODOT] Giving the activating window to App RunningApp
Running App: active window changed
[WM GODOT] Active window returned: 18874391
[WM GODOT] Trying to get title of window 18874391
[WM GODOT] Window title received: EmulationStation
Set status title to EmulationStation
[GODOT] App title set

[GODOT] Window unmapped event: 18874391, stack: 4194307; 14680070; 
[GODOT] Activating a new window: 14680070
[GODOT] Giving the activating window to App RunningApp
Running App: active window changed
[WM GODOT] Active window returned: 14680070
[WM GODOT] Trying to get title of window 14680070
[WM GODOT] Window title received: Terminal
Set status title to Terminal
[GODOT] App title set

[Command Entry thread finished with exit code 0]
[]

Waiting for thread.
Thread terminated.

[GODOT] Window unmapped event: 14680070, stack: 4194307; 
[GODOT] Activating a new window: 4194307
[GODOT] Giving the activating window to App RunningApp
Running App: active window changed
[WM GODOT] Active window returned: 4194307
[WM GODOT] Trying to get title of window 4194307
[WM GODOT] Window title received: 
Set status title to 
[GODOT] App title set
Running app closing: 14680070
Trying to purge window 14680070

X error code 2 detected

Let me know if there's anything else you would like to see.

samdze commented 3 years ago

It's perfectly fine to open an issue here! Can you describe your setup and the steps needed to reproduce your issue?

uberlinuxguy commented 3 years ago

The setup is a bit... interesting.

Basically, it's the clockwork-debian base setup from https://github.com/wolfallein/clockworkpi-debian (with some patches to make it work right), layered with the things to get godot to work and get RetroPie to work. I don't have a good step by step yet.

I did manage to get EmulationStation to show up, compton wasn't starting right due to a missing library. But when Emulationstation exits, it still doesn't go back to the launcher right. I think that something is happening with the window manager trying to change to the launcher window, which is what's spitting out the "X error code 2 detected" I also think that's coming from the "Native" library in the library/ directory. I am curious where the source for those libraries are. Also, the source for your compton and godot binaries, and if we can just use the ones that would ship with debian instead.

samdze commented 3 years ago

Alright, so, compton is compiled from source, unchanged: https://github.com/chjj/compton For Godot, you can take a look at my repository: https://github.com/samdze/godot-gameshell The source code of the native library is yet to be committed actually, I'll make sure to add it to the repository together with the build scripts and such.

Yes, the issue comes from the native library, seems like the unmapping of the terminal window caused the crash. The log above is the result of the operations below, in order?

  1. Run ES.sh
  2. Kill EmulationStation from command line
  3. Kill Terminal from command line

Seems that when you kill EmulationStation the launcher tries to give focus to the Terminal window first, then fails to give it back to the launcher.

Right now it's a bit inconvenient for me to test and fix this, but it's something to come back to in the future for sure.

uberlinuxguy commented 3 years ago

I had the same thought you did, so I took the terminal out of the equation. So now, ES.sh runs emulationstation directly. The same behavior is present.

I don't mind giving it a try to test and try to fix and submit a PR. Coding doesn't scare me a bit. Just need the source and build scripts.

Another point that might be relevant, I can't seem to get the launcher's top and bottom bars to pop up when in emulationstation, but that could be a separate issue, which I also don't mind helping with.

samdze commented 3 years ago

I updated the repository with the source code of the native library and with basic instructions in the README, even though I'm not sure whether the procedure will work without issues.

It is quite messy right now, but at least it's there. I'll surely have to do a cleanup.

uberlinuxguy commented 3 years ago

I'm glad to help if I can and if you are cool with it.

samdze commented 3 years ago

Sure! The project is open source for exactly this reason!

samdze commented 3 years ago

@uberlinuxguy I updated the native library contained in the repository. Can you check if it behaves the same way?

I don't know how outdated it was as I'm committing from my Windows pc and I usually don't have the latest version of the armv7 compiled version locally. Now it's the one I compiled today to fix a bug with windows dimensions/position.