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

Idea: Add an option to restore the default screen resolution after game process quits #2160

Open
Zemogiter opened this issue Jan 3, 2020 · 2 comments

Comments

@Zemogiter
Copy link
Contributor

Certain older titles such as Lego Rock Raiders will change user's screen resolution to something like 800x600 which forces the user to go to settings and change it back. This adds an uncesesseary level of complexity. We already have ScreenManager. The question is can we use it to store screen width and height before the game's exe file starts and then put them into xrandr --size getScreenWidthxgetScreenHeight and execute that command once the exe file is terminated.

@plata
Copy link
Collaborator

plata commented Jan 3, 2020

This is not trivial, e.g.

  • several OSs
  • multi screen setup
  • user could change screen resolution manually, we would overwrite this

I understand why it might be nice to have but we should think about the possible consequences/side effects.

@Zemogiter
Copy link
Contributor Author

Zemogiter commented Jan 3, 2020

This is how Lutris does it:

if self.resolution_changed or self.runner.system_config.get("reset_desktop"):
            DISPLAY_MANAGER.set_resolution(self.original_outputs)

I guess the biggest challenge would be creating a command that would work across all Linux distros (initially, then trying Mac).
Pseudocode:

var originalWidth = return GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getWidth();
var originalHeight = return GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getHeight();

if (wine.getWidth =! originalWidth || wine.getHeight =! originalWidth || wine.executable.status = 0) {
    new VirtualDesktop(wine.originalWidth, wine.originalHeight).go();
}

As for multi-monitor setups, how many of them run Linux? A quick google search revealed that not many are. Most of them are under Windows for first person shooters. So I think we can ignore them for now.
As for user changing screen resolution manually, I don't know how to counter this....

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

2 participants