-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Roland Mas wrote:
> Package: oolite
> Version: 1.65-5
> Severity: wishlist
> 
> When going from windowed mode to fullscreen mode and back, the new
> window size seems to be the resolution defined for fullscreen.  In
> cases where that resolution is the normal screen resolution, the
> window is restored bigger than the screen can hold (what with window
> manager decorations and all).  A better behaviour would be to remember
> the size of the window when entering fullscreen, and to restore to
> that size when going back to windowed.

Could you test this patch and see if it does what you want from it?

- --
Regards,
EddyP
=============================================
"Imagination is more important than knowledge" A.Einstein
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFF+KsSY8Chqv3NRNoRAixqAJ4sVeC6zu3k5P1ptyyCJezUndE2ZwCfS7KR
mO7UbAhonnIknr2/GOkkApY=
=5V3d
-----END PGP SIGNATURE-----
--- oolite-1.65.orig/src/SDL/MyOpenGLView.h
+++ oolite-1.65/src/SDL/MyOpenGLView.h
@@ -138,6 +138,7 @@
 
 	// Windowed mode
 	NSSize currentWindowSize;
+	NSSize previousWindowSize;
 	SDL_Surface* surface;
 	JoystickHandler *stickHandler;
 
--- oolite-1.65.orig/src/SDL/MyOpenGLView.m
+++ oolite-1.65/src/SDL/MyOpenGLView.m
@@ -126,11 +126,13 @@
    {
 		videoModeFlags |= SDL_FULLSCREEN;
       NSSize fs=[self modeAsSize: currentSize];
+		previousWindowSize=fs;
 	   surface = SDL_SetVideoMode(fs.width, fs.height, 32, videoModeFlags);
    }
    else
    {
       videoModeFlags |= SDL_RESIZABLE;
+		previousWindowSize=currentWindowSize;
 	   surface = SDL_SetVideoMode(currentWindowSize.width,
                                  currentWindowSize.height,
                                  32, videoModeFlags);
@@ -260,9 +262,11 @@
 {
    [self setFullScreenMode: !fullScreen];
    if(fullScreen)
-      [self initialiseGLWithSize:[self modeAsSize: currentSize]];
+      //[self initialiseGLWithSize:[self modeAsSize: currentSize]];
+      [self initialiseGLWithSize:previousWindowSize];
    else
       [self initialiseGLWithSize: currentWindowSize];
+		previousWindowSize=currentWindowSize;
 }
 
 - (void) setDisplayMode:(int)mode  fullScreen:(BOOL)fsm

Reply via email to