=== modified file 'gui/DESIGN'
--- gui/DESIGN	2008-03-05 03:55:48 +0000
+++ gui/DESIGN	2009-11-16 01:29:40 +0000
@@ -19,7 +19,7 @@
 init(int argc, char **argv[]): 	
 This funtion is run first to initialize GUI-specific parameters/variables.
 
-createWindow(const char* title, int width, int height): 
+createWindow(const char* title, int width, int height, int xPosition, int yPosition): 
 Here we create a window-widget with calling parameters.
 
 setCursor(gnash_cursor_type newcursor):

=== modified file 'gui/Kde4Gui.cpp'
--- gui/Kde4Gui.cpp	2009-07-13 09:15:53 +0000
+++ gui/Kde4Gui.cpp	2009-11-16 01:29:40 +0000
@@ -123,9 +123,9 @@
 
 
 bool
-Kde4Gui::createWindow(const char* windowtitle, int width, int height)
+KdeGui::createWindow(const char* windowtitle, int width, int height,
+                     int xPosition, int yPosition)
 {
-
     _width = width;
     _height = height;
 

=== modified file 'gui/Kde4Gui.h'
--- gui/Kde4Gui.h	2009-07-13 09:15:53 +0000
+++ gui/Kde4Gui.h	2009-11-16 01:29:40 +0000
@@ -125,7 +125,8 @@
     Kde4Gui(unsigned long xid, float scale, bool loop, RunResources& r);
     virtual ~Kde4Gui();
     virtual bool init(int argc, char **argv[]);
-    virtual bool createWindow(const char* windowtitle, int width, int height);
+    virtual bool createWindow(const char* windowtitle, int width, int height,
+                              int xPosition = 0, int yPosition = 0);
     virtual bool run();
     virtual void renderBuffer();
     virtual void setInterval(unsigned int interval);

=== modified file 'gui/NullGui.h'
--- gui/NullGui.h	2009-07-13 09:15:53 +0000
+++ gui/NullGui.h	2009-11-16 01:29:40 +0000
@@ -50,7 +50,8 @@
 		_timeout=to;
 	}
 	bool init(int, char ***) { return true; }
-	bool createWindow(const char* /*title*/, int /*width*/, int /*height*/)
+	bool createWindow(const char* /*title*/, int /*width*/, int /*height*/,
+	                  int /*yPosition*/, int /*xPosition*/)
 	{
 		return true;
 	}

=== modified file 'gui/Player.cpp'
--- gui/Player.cpp	2009-09-14 10:25:45 +0000
+++ gui/Player.cpp	2009-11-16 01:29:40 +0000
@@ -90,6 +90,8 @@
     _delay(0),
     _width(0),
     _height(0),
+    _xPosition(-1),
+    _yPosition(-1),
     _windowID(0),
     _doLoop(true),
     _doRender(true),
@@ -418,7 +420,7 @@
     _gui->setMovieDefinition(_movieDef.get());
 
     // Now that we know about movie size, create gui window.
-    _gui->createWindow(_url.c_str(), _width, _height);
+    _gui->createWindow(_url.c_str(), _width, _height, _xPosition, _yPosition);
 
     movie_root root(*_movieDef, _gui->getClock(), *_runResources);
     

=== modified file 'gui/Player.h'
--- gui/Player.h	2009-09-14 09:31:10 +0000
+++ gui/Player.h	2009-11-16 01:29:40 +0000
@@ -102,6 +102,12 @@
 	void setHeight(size_t h) { _height = h; }
 	size_t getHeight() { return _height; }
 
+	void setXPosition(int xPos) { _xPosition = xPos; }
+	size_t getXPosition() { return _xPosition; }
+
+	void setYPosition(int yPos) { _yPosition = yPos; }
+	size_t getYPosition() { return _yPosition; }
+
 	void setWindowId(unsigned long x) { _windowID = x; }
 
 	void setDoLoop(bool b) { _doLoop = b; }
@@ -235,6 +241,10 @@
 	size_t _width;
 
 	size_t _height;
+	
+	int _xPosition;
+
+	int _yPosition;
 
 	unsigned long _windowID;
 

=== modified file 'gui/aqua.cpp'
--- gui/aqua.cpp	2009-08-30 23:20:00 +0000
+++ gui/aqua.cpp	2009-11-16 01:29:40 +0000
@@ -156,7 +156,8 @@
 }
 
 
-bool AquaGui::createWindow(const char* title, int width, int height)
+bool AquaGui::createWindow(const char* title, int width, int height,
+                           int xPosition, int yPosition)
 {
 	CFStringRef	windowTitle = NULL;
 	OSStatus	result;

=== modified file 'gui/aquasup.h'
--- gui/aquasup.h	2009-08-30 00:47:07 +0000
+++ gui/aquasup.h	2009-11-16 01:29:40 +0000
@@ -61,7 +61,8 @@
     virtual ~AquaGui();
     virtual bool init(int argc, char **argv[]);
     virtual void setCursor(gnash_cursor_type newcursor);
-    virtual bool createWindow(const char* title, int width, int height);
+    virtual bool createWindow(const char *title, int width, int height,
+                              int xPosition = 0, int yPosition = 0);
     virtual bool run();
     virtual bool createMenu();
     virtual bool setupEvents();

=== modified file 'gui/fb.cpp'
--- gui/fb.cpp	2009-10-03 21:16:21 +0000
+++ gui/fb.cpp	2009-11-16 01:29:40 +0000
@@ -429,7 +429,8 @@
 #endif
 }
 
-bool FBGui::createWindow(const char* /*title*/, int /*width*/, int /*height*/)
+bool FBGui::createWindow(const char* /*title*/, int /*width*/, int /*height*/,
+                     int /*xPosition*/, int /*yPosition*/)
 {
   // Framebuffer has no windows... :-)
 

=== modified file 'gui/fbsup.h'
--- gui/fbsup.h	2009-07-13 10:43:39 +0000
+++ gui/fbsup.h	2009-11-16 01:29:40 +0000
@@ -192,7 +192,8 @@
 		FBGui(unsigned long xid, float scale, bool loop, RunResources& r);
     virtual ~FBGui();
     virtual bool init(int argc, char ***argv);
-    virtual bool createWindow(const char* title, int width, int height);
+    virtual bool createWindow(const char *title, int width, int height,
+                              int xPosition = 0, int yPosition = 0);
     virtual bool run();
     virtual bool createMenu();
     virtual bool setupEvents();

=== modified file 'gui/fltk.cpp'
--- gui/fltk.cpp	2009-07-14 13:40:32 +0000
+++ gui/fltk.cpp	2009-11-16 01:29:40 +0000
@@ -229,7 +229,8 @@
 }
 
 bool
-FltkGui::createWindow(const char* title, int width, int height)
+FltkGui::createWindow(const char* title, int width, int height,
+                      int xPosition, int yPosition)
 {
     resize(width, _menu_height + height);
 

=== modified file 'gui/fltksup.h'
--- gui/fltksup.h	2009-07-13 09:15:53 +0000
+++ gui/fltksup.h	2009-11-16 01:29:40 +0000
@@ -48,7 +48,8 @@
 
     virtual void setInterval(unsigned int);
     virtual void setTimeout(unsigned int) { }
-    virtual bool createWindow(const char* title, int width, int height);
+    virtual bool createWindow(const char *title, int width, int height,
+                              int xPosition = 0, int yPosition = 0);
     virtual void renderBuffer();
 
     virtual bool run();

=== modified file 'gui/gnash.cpp'
--- gui/gnash.cpp	2009-10-01 23:46:57 +0000
+++ gui/gnash.cpp	2009-11-16 01:29:40 +0000
@@ -108,6 +108,8 @@
     << _("  -w,  --writelog          Produce the disk based debug log") << endl
     << _("  -j,  --width <width>     Set window width") << endl
     << _("  -k,  --height <height>   Set window height") << endl
+    << _("  -X,  --x-pos <x-pos>     Set window x position") << endl
+    << _("  -Y,  --y-pos <y-pos>     Set window y position") << endl
     << _("  -1,  --once              Exit when/if movie reaches the last frame") << endl
     << _("  -g,  --debugger          Turn on the SWF debugger") << endl
     << _("  -r,  --render-mode <0|1|2|3>") << endl
@@ -212,6 +214,8 @@
         { 'w', "writelog",      Arg_parser::no  },
         { 'j', "width",         Arg_parser::yes },
         { 'k', "height",        Arg_parser::yes },
+        { 'X', "x-position",    Arg_parser::yes },
+        { 'Y', "y-position",    Arg_parser::yes },
         { 'u', "real-url",      Arg_parser::yes },
         { 'P', "param",         Arg_parser::yes },
         { 'U', "base-url",      Arg_parser::yes },  
@@ -235,6 +239,7 @@
     bool renderflag = false;
     bool plugin = false;
     bool widthGiven = false, heightGiven = false;
+    bool xPosGiven = false, yPosGiven = false;
 
 
     for( int i = 0; i < parser.arguments(); ++i )
@@ -338,6 +343,18 @@
                     gnash::log_debug(_("Setting height to %d"),
                             player.getHeight());
                     break;
+                case 'X':
+                    xPosGiven = true;
+                    player.setXPosition ( parser.argument<int>(i));
+                    gnash::log_debug (_("Setting x position to %d"), 
+                            player.getXPosition());
+                    break;
+                case 'Y':
+                    yPosGiven = true;
+                    player.setYPosition ( parser.argument<int>(i));
+                    gnash::log_debug (_("Setting x position to %d"), 
+                            player.getYPosition());
+                    break;
                 case 'x':
                     plugin = true;
                     player.setWindowId(parser.argument<long>(i));

=== modified file 'gui/gtk.cpp'
--- gui/gtk.cpp	2009-10-01 13:20:16 +0000
+++ gui/gtk.cpp	2009-11-16 01:29:40 +0000
@@ -749,12 +749,20 @@
 }
 
 bool
-GtkGui::createWindow(const char *title, int width, int height)
+GtkGui::createWindow(const char *title, int width, int height,
+                     int xPosition, int yPosition)
 {
 // First call the old createWindow function and then set the title.
 // In case there's some need to not setting the title.
     bool ret = createWindow(width, height);
     gtk_window_set_title(GTK_WINDOW(_window), title);
+    
+    // Move the window to correct position if requested by user.
+    int x, y;
+    gtk_window_get_position(GTK_WINDOW(_window), &x, &y);
+    if (xPosition > -1) x = xPosition; // -1 so we can tell if user requested window move
+    if (yPosition > -1) y = yPosition; // as 0 is also a valid coordinate.
+    gtk_window_move(GTK_WINDOW(_window), x, y);
 
     if (!_xid) {
     

=== modified file 'gui/gtksup.h'
--- gui/gtksup.h	2009-07-21 21:54:27 +0000
+++ gui/gtksup.h	2009-11-16 01:29:40 +0000
@@ -61,7 +61,8 @@
 
     virtual bool init(int argc, char **argv[]);
     virtual bool createWindow(int width, int height);
-    virtual bool createWindow(const char *title, int width, int height);
+    virtual bool createWindow(const char *title, int width, int height,
+                              int xPosition = 0, int yPosition = 0);
 
     virtual bool run();
 

=== modified file 'gui/gui.h'
--- gui/gui.h	2009-10-01 13:19:43 +0000
+++ gui/gui.h	2009-11-16 01:29:40 +0000
@@ -115,8 +115,11 @@
      * @param title The window title.
      * @param width The desired window width in pixels.
      * @param height The desired window height in pixels.
+     * @param xPosition The desired window X position from the top left corner.
+     * @param yPosition The desired window Y position from the top left corner.
      */   
-    virtual bool createWindow(const char* title, int width, int height) = 0;
+    virtual bool createWindow(const char* title, int width, int height,
+                       int xPosition = 0, int yPosition = 0) = 0;
 
     /// Start main rendering loop.
     virtual bool run() = 0;

=== modified file 'gui/kde.cpp'
--- gui/kde.cpp	2009-07-14 13:41:56 +0000
+++ gui/kde.cpp	2009-11-16 01:29:40 +0000
@@ -80,11 +80,23 @@
 }
 
 bool
-KdeGui::createWindow(const char* windowtitle, int width, int height)
+KdeGui::createWindow(const char* windowtitle, int width, int height,
+                     int xPosition, int yPosition)
 {
 //    GNASH_REPORT_FUNCTION;
 
-    _qwidget->setGeometry(0, 0, width, height);
+    // Move the window to correct position if requested by user.
+    if (xPosition > 1) {
+        if (yPosition > 1) {
+            _qwidget->setGeometry(xPosition, yPosition, width, height);
+            }
+        else {  // If only given X position by user
+            _qwidget->setGeometry(xPosition, 0, width, height);
+            }
+        }
+    else if (yPosition > 1) { // If only given Y position by user
+        _qwidget->setGeometry(0, yPosition, width, height);
+    }
     _qwidget->setCaption(windowtitle);
 
     _qapp->setMainWidget(_qwidget.get());

=== modified file 'gui/kdesup.h'
--- gui/kdesup.h	2009-07-13 09:15:53 +0000
+++ gui/kdesup.h	2009-11-16 01:29:40 +0000
@@ -87,7 +87,8 @@
     KdeGui(unsigned long xid, float scale, bool loop, RunResources& r);
     virtual ~KdeGui();
     virtual bool init(int argc, char **argv[]);
-    virtual bool createWindow(const char* windowtitle, int width, int height);
+    virtual bool createWindow(const char* windowtitle, int width, int height,
+                              int xPosition = 0, int yPosition = 0);
     virtual bool run();
     virtual bool createMenu();
     virtual bool setupEvents();

=== modified file 'gui/riscos.cpp'
--- gui/riscos.cpp	2009-10-01 13:19:43 +0000
+++ gui/riscos.cpp	2009-11-16 01:29:40 +0000
@@ -119,7 +119,8 @@
 
 
 bool
-RiscosGui::createWindow(const char *title, int width, int height)
+RiscosGui::createWindow(const char *title, int width, int height,
+                     int xPosition, int yPosition)
 {
 //First call the old createWindow function and then set the title.
 //In case there's some need to not setting the title.

=== modified file 'gui/riscossup.h'
--- gui/riscossup.h	2009-10-01 13:19:43 +0000
+++ gui/riscossup.h	2009-11-16 01:29:40 +0000
@@ -44,7 +44,8 @@
     virtual ~RiscosGui();
     virtual bool init(int argc, char **argv[]);
     virtual bool createWindow(int width, int height);
-    virtual bool createWindow(const char *title, int width, int height);
+    virtual bool createWindow(const char *title, int width, int height,
+                              int xPosition = 0, int yPosition = 0);
     virtual bool run();
     virtual bool createMenu();
     virtual bool setupEvents();

=== modified file 'gui/sdl.cpp'
--- gui/sdl.cpp	2009-09-21 02:49:55 +0000
+++ gui/sdl.cpp	2009-11-16 01:29:40 +0000
@@ -194,7 +194,8 @@
 
 
 bool
-SDLGui::createWindow(const char *title, int width, int height)
+SDLGui::createWindow(const char *title, int width, int height,
+                     int xPosition, int yPosition)
 {
     GNASH_REPORT_FUNCTION;
     _width = width;

=== modified file 'gui/sdlsup.h'
--- gui/sdlsup.h	2009-07-13 09:15:53 +0000
+++ gui/sdlsup.h	2009-11-16 01:29:40 +0000
@@ -50,7 +50,8 @@
     SDLGui(unsigned long xid, float scale, bool loop, RunResources& r);
     virtual ~SDLGui();
     virtual bool init(int argc, char **argv[]);
-    virtual bool createWindow(const char *title, int width, int height);
+    virtual bool createWindow(const char *title, int width, int height,
+                              int xPosition = 0, int yPosition = 0);
     virtual bool run();
     virtual bool createMenu();
     virtual bool setupEvents();

