From Stephan Huber and Robert Osfield,
Stephan: "attached you'll find some modifications to the GraphicsWindow-class and their platform-dependant implementations. The problem: setWindowRectangle and setWindowDecoration do not update the traits-object, so, if you call setWindowRectangle on a not-realized-window it will open with another size when realized later. getWindowRectangle reports possible wrong sizes if setWindowRectangle called before. My solution: split the implementation in two parts: GraphicsWindow::setWindowRectangle will update its traits-object and call afterwards the virtual method setWindowRectangleImplementation (which is implemented by the derived platformspecific classess). For setWindowDecoration I am useing a similar mechanism. I hope you'll find the submission useful, the Win32 and X11 changes are not tested but should work." Changes to this made by Robert are call of resized in setWindowRectangle instead of setting of Traits, and use of a bool return type.
This commit is contained in:
@@ -82,10 +82,10 @@ class GraphicsWindowCarbon : public osgViewer::GraphicsWindow
|
||||
virtual void checkEvents();
|
||||
|
||||
/** Set the window's position and size.*/
|
||||
virtual void setWindowRectangle(int x, int y, int width, int height);
|
||||
virtual bool setWindowRectangleImplementation(int x, int y, int width, int height);
|
||||
|
||||
/** Set Window decoration.*/
|
||||
virtual void setWindowDecoration(bool flag);
|
||||
virtual bool setWindowDecorationImplementation(bool flag);
|
||||
|
||||
/** Get focus.*/
|
||||
virtual void grabFocus();
|
||||
|
||||
@@ -61,10 +61,10 @@ class GraphicsWindowWin32 : public osgViewer::GraphicsWindow
|
||||
virtual void checkEvents();
|
||||
|
||||
/** Set the window's position and size.*/
|
||||
virtual void setWindowRectangle(int x, int y, int width, int height);
|
||||
virtual bool setWindowRectangleImplementation(int x, int y, int width, int height);
|
||||
|
||||
/** Set Window decoration.*/
|
||||
virtual void setWindowDecoration(bool flag);
|
||||
virtual bool setWindowDecorationImplementation(bool flag);
|
||||
|
||||
/** Get focus.*/
|
||||
virtual void grabFocus();
|
||||
|
||||
@@ -92,7 +92,7 @@ class GraphicsWindowX11 : public osgViewer::GraphicsWindow
|
||||
virtual void checkEvents();
|
||||
|
||||
/** Set Window decoration.*/
|
||||
virtual void setWindowDecoration(bool flag);
|
||||
virtual bool setWindowDecorationImplementation(bool flag);
|
||||
|
||||
/** Get focus.*/
|
||||
virtual void grabFocus();
|
||||
@@ -104,7 +104,7 @@ class GraphicsWindowX11 : public osgViewer::GraphicsWindow
|
||||
virtual void requestWarpPointer(float x,float y);
|
||||
|
||||
/** Set the window's position and size.*/
|
||||
virtual void setWindowRectangle(int x, int y, int width, int height);
|
||||
virtual bool setWindowRectangleImplementation(int x, int y, int width, int height);
|
||||
|
||||
/** Set mouse cursor to a specific shape.*/
|
||||
virtual void setCursor(MouseCursor cursor);
|
||||
|
||||
Reference in New Issue
Block a user