complexlogic / flex-launcher

A customizable HTPC application launcher for Windows and Linux
https://complexlogic.github.io/flex-launcher/
The Unlicense
226 stars 13 forks source link

flex-launcher does not wait long enough for a program to start. #30

Closed xslushedx closed 1 year ago

xslushedx commented 1 year ago

If a program takes longer to start, the flex launcher remains visible in the foreground. I have that, for example, with emulationstaion. Because i have a big rom collection it takes a moment to start.

complexlogic commented 1 year ago

How long does your emulationstation typically take to start? The launcher assumes that the launch application has failed to start if it doesn't grab the window focus after 7 seconds -------- Original Message -------- On Mar 10, 2023, 4:59 AM, xslushedx wrote:

If a program takes longer to start, the flex launcher remains visible in the foreground. I have that, for example, with emulationstaion. because i have a big rom collection it takes a moment to start.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

xslushedx commented 1 year ago

With a fresh Windows 10 start, emulationstation actually needs seven to eight seconds to start. That is of course very long. I have now created a batch file to launch it and flex-launcher is working fine.

sekmo commented 1 year ago

is the waiting time configurable?

complexlogic commented 1 year ago

is the waiting time configurable?

No, but it would be relatively easy to add one. Are you having this same issue?

sekmo commented 1 year ago

Yeah, unfortunately I have a game that takes around 10 seconds and even the screen is showing the game, the focus is kept on flexlauncher :/

sekmo commented 1 year ago

If you could guide me on where to look around for implementing this feature, I would be more than happy to submit a PR! :)

complexlogic commented 1 year ago

@sekmo The timeout value is controlled by a macro defined here. You will need to convert this into a config option.

  1. Add a new int variable to the Config struct declaration (in launcher.h)
  2. Define the setting key and default value in config/config_settings.cmake
  3. Make those CMake variables available to the program in config/launcher_config.h.in
  4. Initialize the new variable in launcher.c
  5. Add the setting and default value to the default config file in config/config.ini.in
  6. Parse for the new config setting in util.c. The setting facing the user should be in seconds, but the program uses milliseconds internally so you'll need to multiply it by 1000.

If you are not able to do this, then let me know and I can do it.

sekmo commented 1 year ago

Omg thank you so much! (Sorry if I didn't get back on this, I was eager to help out but I didn't have in the last period :/)