phoenicis
phoenicis copied to clipboard
Idea: Add an option to restore the default screen resolution after game process quits
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.
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.
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....