minigalaxy icon indicating copy to clipboard operation
minigalaxy copied to clipboard

"Setup" window should have a setting to disable grabbing focus

Open TylerCode opened this issue 9 months ago • 5 comments

When playing a fullscreen game, this setup window can pop up and continuously grab focus, minimizing the fullscreen game.

There should be a setting to disable this feature.

TylerCode avatar Apr 19 '25 21:04 TylerCode

It would be possible for us to hide the installation window. We could make this an option. Thanks for thinking with us. This is worth looking into, as there are more people who will likely be bothered by this.

sharkwouter avatar Apr 22 '25 07:04 sharkwouter

I'm not sure how we could do this reliably.

I think the setups in question are windows setups. We dropped the full background option /VERYSILENT there because it didn't work for a lot of games which require input in the setups, like accepting the Terms and Conditions. If we now go ahead and hide the window, i fear we'll start getting complaints about invisible installs which go on for hours (because the hidden windows actually require user input first). /VERYSILENT doesn't work reliably. Games that force-require user input will just abort the very silent installs. So the fallback would still kick in and show the dialog.

Grabbing and managing focus is the responsibility of the window manager and wine. Bringing windows to the front is handled by the window manager as well. I don't think it is feasible to let minigalaxy fiddle with the configurations of the sheer endless amount of window managers and/or desktop environments. Then there's the difference in behaviour between X and Wayland.

Also, depending on how the actually running game was started, minigalaxy doesn't even have much of a way to detect that it's actually running. Much less so if it is in full screen. Wayland doesn't give the required privileges to other apps and X becomes more and more obsolete.

Possible actions I see are:

  1. Don't automatically start an installation after download, but let users trigger them manually.
  2. Focus grabbing by wine could be stopped with a registry key (UseTakeFocus=N). The problem with that is that when playing a game you often want the exactly contrary behavior because there's an issue with unreal engine permanently losing focus when tabbing out of a game (unless UseTakeFocus=Y is set). So we have to change that key every time we install/update or start the game, alternating between the 2 values all the time.
  3. Maybe it's possible to run the installation in a sub-display window that could be minimised like gamescope or Xephyr. But that would add another dependency to minigalaxy.

GB609 avatar Apr 22 '25 08:04 GB609

Okay, I wasn't aware. Does it get stuck if we set verysilent or does it fail? If it fails, we could just restart it with silent instead of verysilent. Then we could allow the user to make configure it.

The registry key could work, but is a bit hacky.

sharkwouter avatar Apr 22 '25 09:04 sharkwouter

It just aborts silently with a return code >0. I tested this extensively when i reworked the windows installation. That lead to a lot of cancellations before. Thats why i introduced the two-step approach with fallback (SILENT -> no silent argument) in the first place. The current approach first tries /SILENT which at least displays a dialog, /VERYSILENT shows nothing.

Aside from that they are identical. I chose to use SILENT instead of /VERYSILENT because there was no feedback at all about the running installation. Just minigalaxy disabling a button and then, depending on machine speed, nothing for a very long time. How would a user know if it was stuck or still installing several gigabytes of data? I admit, i didn't think about an use case where a user just starts a download/install then another game at the same time. However, even then it should normally be possible to tab back into the game and let the install run in the background. It shouldn't re-grab focus or input by itself. But its possible that the active game suffers from the input losing bug which would appear as if the installer doesnt release focus.

Sure, we could first try verysilent and use the dialog without any silent option in the second step. Or make that an option, so that the first step is either SILENT or VERYSILENT. But they both are not reliable. I get mixed results with install dialogs all the time even now. About half of the games i install require me to accept eulas, so they reject the 'silent' option and the fallback kicks in.

The registry key only keeps wine from taking (input) focus unless the window is activated/clicked manually. But it does not prevent the window from going into the front, as far as i know. That is what the window manager is supposed to do.

GB609 avatar Apr 22 '25 09:04 GB609

It seems the setup window really does re-grab keyboard focus every few seconds. I just had the same happen to me. I'll see if i can find the reason for that because it really shouldn't do so. Maybe we can influence this with some parameters or envs for wine.

GB609 avatar May 07 '25 15:05 GB609