Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External tools run inside the same gamescope window as the game #490

Closed
zany130 opened this issue Jun 7, 2022 · 12 comments
Closed

External tools run inside the same gamescope window as the game #490

zany130 opened this issue Jun 7, 2022 · 12 comments

Comments

@zany130
Copy link
Collaborator

zany130 commented Jun 7, 2022

External tools like cheat engine and GDB run inside the same gamescope window as the game

Steps to reproduce


  1. enable gamescope
  2. enable any other tool such as cheatengine
  3. launch game
  4. see tool and game being run in the same window

Possible Solutions


One solution might be to see if its possible to run the game with game scope and then run the tool separately without (or other way around) don't know how feasible this is though.

Another solution would be to disable gamescope in these situations (not ideal)

@frostworx
Copy link
Collaborator

funny bug.
thanks for reporting :)
(no ETA for now)

@zany130
Copy link
Collaborator Author

zany130 commented Jun 7, 2022

Well it's not like they mash together lol it's more like they overlay on top of each other also cheat engine doesn't render correctly (visual glitches)

@sonic2kk
Copy link
Owner

sonic2kk commented Jun 7, 2022

An interesting bug, I'm not sure if there's a way to differentiate here. I was under the impression you can launch anything with Gamescope, I've been able to (or rather forced to) run things like the official Minecraft launcher with Gamescopee, but I just tested and this doesn't seem to be the case! Trying to launch some system applications from Gamescope didn't work, they either segfaulted or launched normally (Gamescope process was running in the background tho according to KDE System Monitor).

I tested MultiMC which is a third party Minecraft launcher, with gamescope -- multimc, and it launched normally. But when launching the actual Minecraft game from here, it started with Gamescope! Very odd.

So clearly, Gamescope has some way of differentiating what is a game and what isn't. Game launchers still seem to use Gamescope, and MO2 with STL uses Gamescope, but the Minecraft launcher mentioned doesn't launch with Gamescope yet when Minecraft itself is running it uses Gamescope.

Some more investigation may be needed here :)

@frostworx
Copy link
Collaborator

only took a quick look for now, but this could be complicated to fix.
F.e. cheatengine is started via function extProtonRun means, it starts independently of the actual game launch command line wise.
I guess the problem is that it is started forked in the background and gamescope catches it first because of this.
very likely won't fix it too soon, but with some bad luck all custom/3rd party programs which are supposed to started forked, need to be started after the game launch to get this working, which will be problematic at best and might cause tons of new other issues.

@zany130
Copy link
Collaborator Author

zany130 commented Jun 7, 2022

Yeah, I haven't tested but it's very likely that the custom command stuff might be affected. same for vortex and mod manager but I don't use them (go figure I use cheat engine but not mod managers lol jk the games I play don't have mods on vortex so that's why)

@frostworx
Copy link
Collaborator

seems like this does not happen with every game. just tried with 3300 and CE rendered in an own window
(the game window rendered black only though).
with 78000 the issue is partly reproducible (game window opens, then a separate CE window, then the game window resets to an ultra low resolution, still drawing the game window - assuming a 2nd CE window updated the window resolution).

I assume this is more a gamescope issue/feature (iirc it always can render only one screen)
gamescope kind of redirects the screen to a virtual screen for a wineprefix/compatdata. I guess it depends on how graphic/window initialization of the corresponding programs is written, this might either open directly an own window or rely on the main screen.
When it relies on the main screen windows overlay in the single gamescope window.

I doubt that this can be fixed properly from steamtinkerlaunch side: There is no control over where a 2nd program opens its window (the order of the started programs could be switched, but they would be still launched within the same wineprefix/compatdata and therefore this would't help anything).

disabling gamescope would be the only (partial) workaround, but as it seems to be impossible to say which game even has this issue, this would be more a dirty hack. So I decided to not touch this at all. Maybe worth a wiki entry and/or check upstream for open issue (I'm sure there are multiple into this direction), but no steamtinkerlaunch code changes for now.
leaving this open for a while for possible further discussions.

@zany130
Copy link
Collaborator Author

zany130 commented Jun 26, 2022

Yeah if anything it might just be best to add a note that external tools might not work or render correctly when the game is running with gamescope I did a little testing earlier and it doesn't look like it matters when the external tool is launched so I was afraid this might happen. I need to find out how I can run cheat engine separately from steamtinkerlaunch maybe even in the steam launch commands to confirm this though.

@frostworx
Copy link
Collaborator

I guess running CE in its own wineprefix/compatdata would be already enough.
will check if it makes sense to add an option to do so (also via command line) soon.

@frostworx
Copy link
Collaborator

no, doesn't make sense, as CE in its own prefix doesn't see processess in other prefixes.

@zany130
Copy link
Collaborator Author

zany130 commented Jun 27, 2022

yeah it needs to run in the same prefix that's the thing so they need to be launched together which I was afraid might make this issue not fixable from here.

@frostworx
Copy link
Collaborator

I'm afraid this is impossible to fix from our end. do you want to add a little note to the wiki, @zany130?

@zany130
Copy link
Collaborator Author

zany130 commented Jun 30, 2022

yeah agreed. hadn't had much time to look into this but it looks like it may have to be reported upstream. When I have time i look into this more and report it upstream. In the unlikely case that it can be fixed on our end ill just reopen the issue (:.

Ill update the wiki with a note in the meantime with a link here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants