=== modified file 'gui/gnash.cpp'
--- gui/gnash.cpp	2009-03-03 04:29:47.000000000 +1300
+++ gui/gnash.cpp	2009-03-08 18:32:53.000000000 +1300
@@ -91,6 +91,7 @@
     << _("  -h,  --help              Print this help and exit") << endl
     << _("  -V,  --version           Print version information and exit") << endl
     << _("  -s,  --scale <factor>    Scale the movie by the specified factor") << endl
+    << _("  -S,  --exactfit          Force the SWF to scale to the window size") << endl
     << _("  -c                       Produce a core file instead of letting SDL trap it") << endl
     << _("  -d,  --delay num         Number of milliseconds to delay in main loop") << endl
     << _("  -v,  --verbose           Produce verbose output") << endl
@@ -197,6 +198,7 @@
         { 'a', 0,               Arg_parser::no  },
         { 'p', 0,               Arg_parser::no  },
         { 's', "scale",         Arg_parser::yes },
+        { 'S', "exactfit",      Arg_parser::no },
         { 256, "max-advances",  Arg_parser::yes },
         { 257, "fullscreen",    Arg_parser::no  },
         { 258, "hide-menubar",  Arg_parser::no  },                
@@ -286,6 +288,9 @@
                                     parser.argument<float>(i),
                                     0.01f, 100.f));
                     break;
+                case 'S':
+                    player.setScaleExactFit(true);
+                    break;
                 case 'd':
                     player.setDelay( parser.argument<long>(i) );
                     break;
=== modified file 'gui/gui.cpp'
--- gui/gui.cpp	2009-03-03 04:29:44.000000000 +1300
+++ gui/gui.cpp	2009-03-08 18:32:53.000000000 +1300
@@ -82,6 +82,7 @@
     _renderer(NULL),
     _redraw_flag(true),
     _fullscreen(false),
+    _scaleExactFit(false),
     _mouseShown(true),
     _maxAdvances(0),
     _advances(0),
@@ -124,6 +125,7 @@
     _renderer(NULL),
     _redraw_flag(true),
     _fullscreen(false),
+    _scaleExactFit(false),
     _mouseShown(true),
     _maxAdvances(0),
     _advances(0),
@@ -184,6 +186,12 @@
     log_unimpl(_("Menu hiding not yet supported in this GUI"));
 }
 
+void 
+Gui::setScaleExactFit()
+{
+    _scaleExactFit = true;
+}
+
 bool
 Gui::showMouse(bool /* show */)
 {
@@ -250,36 +258,57 @@
 	switch (scaleMode)
 	{
 		case movie_root::noScale:
-			_xscale = _yscale = 1.0f;
+            if (_scaleExactFit)
+            {
+			    _xscale = (swfwidth == 0.0f) ? 1.0f : _width / swfwidth;
+			    _yscale = (swfheight == 0.0f) ? 1.0f : _height / swfheight;
+		    }
+		    else
+		    {
+			    _xscale = _yscale = 1.0f;
+		    }
 			break;
 
 		case movie_root::showAll:
 		{
-		
-			// set new scale value ( user-pixel / pseudo-pixel ). Do
-			// not divide by zero, or we end up with an invalid
-			// stage matrix that returns nan values.			
-			_xscale = (swfwidth == 0.0f) ? 1.0f : _width / swfwidth;
-			_yscale = (swfheight == 0.0f) ? 1.0f : _height / swfheight;
+            if (_scaleExactFit)
+            {
+			    _xscale = (swfwidth == 0.0f) ? 1.0f : _width / swfwidth;
+			    _yscale = (swfheight == 0.0f) ? 1.0f : _height / swfheight;
+		    }
+		    else
+		    {
+			    // set new scale value ( user-pixel / pseudo-pixel ). Do
+			    // not divide by zero, or we end up with an invalid
+			    // stage matrix that returns nan values.			
+			    _xscale = (swfwidth == 0.0f) ? 1.0f : _width / swfwidth;
+			    _yscale = (swfheight == 0.0f) ? 1.0f : _height / swfheight;
 			
-			// Scale proportionally, using smallest scale
-			if (_xscale < _yscale) _yscale = _xscale;
-			else if (_yscale < _xscale) _xscale = _yscale;
+			    // Scale proportionally, using smallest scale
+			    if (_xscale < _yscale) _yscale = _xscale;
+			    else if (_yscale < _xscale) _xscale = _yscale;
+		    }
 
 			break;
 		}
 
 		case movie_root::noBorder:
 		{
-
-			// set new scale value ( user-pixel / pseudo-pixel )
-			_xscale = (swfwidth == 0.0f) ? 1.0f : _width / swfwidth;
-			_yscale = (swfheight == 0.0f) ? 1.0f : _height / swfheight;
+            if (_scaleExactFit)
+            {
+			    _xscale = (swfwidth == 0.0f) ? 1.0f : _width / swfwidth;
+			    _yscale = (swfheight == 0.0f) ? 1.0f : _height / swfheight;
+		    }
+		    else
+		    {
+			    // set new scale value ( user-pixel / pseudo-pixel )
+			    _xscale = (swfwidth == 0.0f) ? 1.0f : _width / swfwidth;
+			    _yscale = (swfheight == 0.0f) ? 1.0f : _height / swfheight;
 			
-			// Scale proportionally, using biggest scale
-			if (_xscale > _yscale) _yscale = _xscale;
-			else if (_yscale > _xscale) _xscale = _yscale;
-
+			    // Scale proportionally, using biggest scale
+			    if (_xscale > _yscale) _yscale = _xscale;
+			    else if (_yscale > _xscale) _xscale = _yscale;
+            }
 			break;
 		}
 
@@ -294,7 +323,16 @@
 
 		default:
 		{
-			log_error("Invalid scaleMode %d", scaleMode);
+            if (_scaleExactFit)
+            {
+			    _xscale = (swfwidth == 0.0f) ? 1.0f : _width / swfwidth;
+			    _yscale = (swfheight == 0.0f) ? 1.0f : _height / swfheight;
+			    log_error("Invalid scaleMode - forcing to exactfit");
+		    }
+		    else
+		    {
+			    log_error("Invalid scaleMode %d", scaleMode);
+		    }
 			break;
 		}
 	}
=== modified file 'gui/gui.h'
--- gui/gui.h	2009-03-03 04:29:48.000000000 +1300
+++ gui/gui.h	2009-03-08 18:32:53.000000000 +1300
@@ -258,6 +258,8 @@
     ///
     virtual void hideMenu();
     
+    void setScaleExactFit();
+    
     /// Sets whether the gui should show the system mouse pointer
     //
     /// @param show true if the mouse should be shown.
@@ -431,6 +433,9 @@
 
     // True if Gnash is running in fullscreen
     bool _fullscreen;
+    
+    // Forces Gnash to scale video
+    bool _scaleExactFit;
 
     // True if mouse pointer is showing
     bool _mouseShown;
=== modified file 'gui/Player.cpp'
--- gui/Player.cpp	2009-03-03 04:29:40.000000000 +1300
+++ gui/Player.cpp	2009-03-08 18:36:01.000000000 +1300
@@ -100,6 +100,7 @@
 #endif
     _hostfd(-1),
     _startFullscreen(false),
+    _scaleExactFit(false),
     _hideMenu(false)
 {
     init();
@@ -474,6 +475,10 @@
         _gui->hideMenu();
     }
     
+     if (!_windowID && _scaleExactFit) {
+         _gui->setScaleExactFit();
+     }
+    
     _gui->run();
 
     log_debug("Main loop ended, cleaning up");
=== modified file 'gui/Player.h'
--- gui/Player.h	2009-03-03 04:29:49.000000000 +1300
+++ gui/Player.h	2009-03-08 18:32:53.000000000 +1300
@@ -130,6 +130,10 @@
 	void setParam(std::string& name, std::string& value) {
 		params[name] = value;
 	}
+	
+	void setScaleExactFit(bool x) {
+	    _scaleExactFit = x;
+	}
 
 	void setHostFD(int fd) {
 		_hostfd = fd;
@@ -303,6 +307,8 @@
 	bool _startFullscreen;
 	bool _hideMenu;
 
+    bool _scaleExactFit;
+    
     // The filename to use for dumping audio.
     std::string _audioDump;
 
