Skip to content

SFROTZ: Force window resize to preserve aspect ratio when the X11 video driver is used

Florian Léger requested to merge fleger1/frotz:resizable_window2 into master

This partially addresses #130 for X11 systems.

I've not been able to find a generic way to restrict the window aspect ratio using the SDL API so I took a look at the X11 API and came up with this instead.

The idea is to let the X11 Window Manager enforce the window aspect ratio by providing it with the relevant sizing hints. Unfortunately the SDL API does not allow that so I had to directly use the X11 API.

The X11 library is dynamically loaded at runtime only if the X11 SDL Video Driver is being used, so sfrotz can run even if X11 is not installed. Moreover, this feature is compiled in only if SDL has been built with X11 support.

Please note that I've only tested this on my Linux system, so you'll probably want to check if I didn't introduce regressions on non-X11 systems before merging.

Merge request reports