MegaGlest / megaglest-source

MegaGlest real-time strategy game engine (cross-platform, 3-d)
http://megaglest.org/
355 stars 90 forks source link

Different behavior during switching from window mode to fullscreen by 2 methods #71

Closed filux closed 8 years ago

filux commented 9 years ago

presuppositions:

filux commented 9 years ago

Since c402509 situation in 2. case is much worse, now screen area is buggy. But this commit had possitive (I think) effect for #77.

notfullscreen3

filux commented 9 years ago

on 81346ba situation is the same (bad) as previously ^ checked.

softcoder commented 9 years ago

Which OS and architecture, linux 64?

filux commented 9 years ago

yep, linux x64, debian testing imo not bad idea is to use this "auto res change" code also for second method

softcoder commented 9 years ago

Please try this now it should be fixed

filux commented 9 years ago

yep, this is fixed :) but I found something new related (minor thing but may be a bit confusing).

presuppositions:

MG start (fullscreen and auto change to 640x480>1280x1024, so is ok) > Changing mode from fullscreen to window by alt + enter > = window with res 1280x1024 (expected window with res 640x480 because this is saved in glestuser.ini).

softcoder commented 9 years ago

You mentioned: MG start (fullscreen and auto change to 640x480>1280x1024, so is ok)

That means you saved a new resolution, so that is why its using this. I see no bug here.

filux commented 9 years ago

That means you saved a new resolution, so that is why its using this.

Hehe. Yep "saved" resolution value in some "cache" and "lost" previous value from window mode and in settings all the time is 640x480, so this is a bit confusing. Imo it is just confusing and most likely not fast will be bug report about this so if it is too minor problem vs fixing effort then this may be left as it is :).

Another example, mostly just commands and pictures:

$ cat ~/.megaglest/glestuser.ini | grep -e 'ScreenWidth=' -e 'ScreenHeight=' -e 'Windowed='
   ScreenHeight=480
   ScreenWidth=640
   Windowed=0
./megaglest
   megaglest v3.12-dev
   Compiled using: GNUC: 50201 [64bit] on: Oct 29 2015 10:03:52 platform: Linux-X64 endianness: little
   GIT: [Rev: 5209.b83fab2] - using STREFLOP [SSE] - [no-denormals]
   Forcing resolution [640x480]
   Forcing fullscreen [true]
   Auto Change resolution to (1280 x 1024) from (640 x 480)
   MainWindow forced change of resolution to desktop values (1280 x 1024) instead of (640 x 480)
xwininfo -name MegaGlest | grep geometry
  -geometry 1280x1024+0+0

wrongwindowsize

$ kill -9 `pidof megaglest`
$ cat ~/.megaglest/glestuser.ini | grep -e 'ScreenWidth=' -e 'ScreenHeight=' -e 'Windowed='
   ScreenHeight=480
   ScreenWidth=640
   Windowed=0
titiger commented 9 years ago

The main problem is, we have no idea how to handle full screen resolutions in sdl2 yet. The only fullscreen mode that works is "as Desktop" . But there must be a way to fix this because there are other games using SDL2 who can do this. I would not change the whole behaviour meanwhile to "fix" somehting that is still broken. I like the current state softcoder made and thats good enough until we find the real fix for the SDL fullscreen problem.

filux commented 9 years ago

Heh but this method "as Desktop" seems to be very good, by this we dropped few problems with fullscreen which were present also in sdl1. Seems like now fullscreen as default setting is safe to keep set and you will not break your OS-monitor-resolution configuration by launching MG with this which was previously pretty common.
... so basically if there will not be problems/bug reports negatively related with "auto res change" (e.g. in case multi monitor configurations) then I believe more for that other projects will "steal" this idea from MG than for this finding and insertion of something better :D

softcoder commented 8 years ago

I think we should just leave it as its working now since sdl2 seems to not have better support for fullscreen than what we see in the current code. In another release of SDL we can revisit.