Re: [hatari-users] Window resizing

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-users Archives ]


Hi,

If SDL doesn't support setting aspect ratio in winding system
/ OS independent matter, that sucks.

At least you should be able to get the underlying X window
for SDL, and set X aspect ratio size hints for it:
http://www.linuxquestions.org/questions/programming-9/%5Bc%5D-x11-window-of-fixed-aspect-ratio-843617/

The first example code on that page worked fine for me in XFCE.
Window manager is free to ignore the hint though, so it may not
work with all window managers.

Control_ReparentWindow() function in Hatari has example of
accessing SDL window X ID.

(No idea how that could be done on OSX or Windows, until
SDL itself support it.)


	- Eero

PS. Resize issue seems to be window manager specific too:
http://stackoverflow.com/questions/28587643/sdl2-how-to-keep-aspect-ratio-when-resizing-the-window

On 12/23/2015 05:37 PM, Thomas Huth wrote:
Am Wed, 23 Dec 2015 15:15:50 +0200
schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:

Maybe you could consider maintaining the Hatari window
aspect ratio on resize?

Actually, I tried that first - but it did not work out at all, at least
not with my window manager (I'm using XFCE): While the resizing is
still in progress, further calls to SDL_SetWindowSize() (to force the
right aspect ratio) are ignored.
Waiting a little bit and then setting the window size also looks ugly -
especially since you can't be sure whether the users really finished
resizing or whether they just wait a second or two to continue.
So if you've got a good idea how to implement that instead, feel free to
come up with a patch! If not, I think we've got to life without forced
aspect ratio when resizing a window.

  Thomas






Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/