Remember Window Position
Thu, 2009-10-29 17:22
I wonder if it would be possible to have an option to remember the last in-game window position.
The window position at my Windows is always 2/3 the screen and the remaining is off screen. Tryhing to move the screen is risky becuase sometimes the focus goes to the center and the screen goes even further off screen. Of course, I can fix that by alt-tab, right click - move but it's annoying to do that everytime. On my Linux mint box it's impossible to move the screen even with right click - move.
We don't need a reason to help people ~ Zidane
Placing window is non-trivial under SDL.
If I rememver right, apparently moving initial mouse position can help. Since for most players the initial mouse position is when they click start, that's where the window should spawn. Some hack could help with the person launching the game, for other players, remembering to move mouse elsewhere works too.
My window seems pretty consistently properly placed these days under Ubuntu Karmic. Not sure why, TBH, perhaps some smarter awareness of desktop limits, but it has been consistently placing it w/ the top of the window flush with my top panel, and centred on the screen.
Also. Moving a window under linux is very very easy. Just hold down the alt key and left click.
That should work on most any window manager.
If you're using Compiz you can reposition using a number of the window management tools. super+e for example.
--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev
That's true about the new Ubuntu. In the previous version it was the same as in Windows - had to drag the thing here and there in order to place it where I want it to be. I really don't know about the SDL-thing but is it not possible to determine the center of the screen, then the center of the HW-window and overlap them?
HTML = How To Meet the Ladies
Here is my Unofficial Manual for HW. Hope you like it. Still working on it. Don't worry. Will get it finished...Sometime in the future.
Should be possible as long as you don't mind havinng some offsets due to fancy window decoration like borders etc.
Or how about just moving it to (0, 0) (top left corner)?
(0,0) would be cool too.
HTML = How To Meet the Ladies
Here is my Unofficial Manual for HW. Hope you like it. Still working on it. Don't worry. Will get it finished...Sometime in the future.
Seems like there's no real cross platform way to do it in a consistent way.
As a temporary workaround:
Set the environment variable SDL_VIDEO_CENTERED to 1
To revert this change:
Delete the environment variable or set it to "" (empty; not empty quotes).
Thanks. As for the real cross platform way - you can always include in the FAQ what to change in order to run the game with this option enabled on platform N (Win, Mac, Linux, Unix-like etc.).
PS: What about changing SDL_VIDEO_WINDOW_POS?
HTML = How To Meet the Ladies
Here is my Unofficial Manual for HW. Hope you like it. Still working on it. Don't worry. Will get it finished...Sometime in the future.
Just test it - but as it affects other sdl apps as well ... no real solution.
frontend could set environment for engine
Wait. Why would any env var affect all apps?
Just pass the variable in to the app you are running. That can be done under windows just as under linux no?
--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev
Hm ... Should be inherited. Forgot about that possibility.