Remember Window Position

10 replies [Last post]
anima
anima's picture
User offline. Last seen 13 years 19 weeks ago. Offline
Joined: 2009-09-22
Posts: 15

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

nemo
nemo's picture
User offline. Last seen 3 weeks 6 days ago. Offline
Joined: 2009-01-28
Posts: 1861

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

rbaleksandar
rbaleksandar's picture
User offline. Last seen 9 years 34 weeks ago. Offline
Joined: 2009-01-09
Posts: 685

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. Wink Smiley Still working on it. Don't worry. Will get it finished...Sometime in the future. Big Grin

Smaxx
Smaxx's picture
User offline. Last seen 12 years 51 weeks ago. Offline
Joined: 2009-04-29
Posts: 391

Should be possible as long as you don't mind havinng some offsets due to fancy window decoration like borders etc. Wink Smiley

Or how about just moving it to (0, 0) (top left corner)?

rbaleksandar
rbaleksandar's picture
User offline. Last seen 9 years 34 weeks ago. Offline
Joined: 2009-01-09
Posts: 685

(0,0) would be cool too. Smile

HTML = How To Meet the Ladies

Here is my Unofficial Manual for HW. Hope you like it. Wink Smiley Still working on it. Don't worry. Will get it finished...Sometime in the future. Big Grin

Smaxx
Smaxx's picture
User offline. Last seen 12 years 51 weeks ago. Offline
Joined: 2009-04-29
Posts: 391

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).

rbaleksandar
rbaleksandar's picture
User offline. Last seen 9 years 34 weeks ago. Offline
Joined: 2009-01-09
Posts: 685

Thanks. Smile 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.). Smile

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. Wink Smiley Still working on it. Don't worry. Will get it finished...Sometime in the future. Big Grin

Smaxx
Smaxx's picture
User offline. Last seen 12 years 51 weeks ago. Offline
Joined: 2009-04-29
Posts: 391

Just test it - but as it affects other sdl apps as well ... no real solution.

unC0Rr
unC0Rr's picture
User offline. Last seen 1 year 5 weeks ago. Offline
Joined: 2006-11-27
Posts: 576

frontend could set environment for engine

nemo
nemo's picture
User offline. Last seen 3 weeks 6 days ago. Offline
Joined: 2009-01-28
Posts: 1861

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

Smaxx
Smaxx's picture
User offline. Last seen 12 years 51 weeks ago. Offline
Joined: 2009-04-29
Posts: 391

Hm ... Should be inherited. Forgot about that possibility.

User login

Copyright © 2004-2024 Hedgewars Project. All rights reserved. [ contact ]