Module: Demos
Branch: master
Commit: 5cf434a142ce6e37380a075026eabcd646681bc8
URL:    
http://cgit.freedesktop.org/mesa/demos/commit/?id=5cf434a142ce6e37380a075026eabcd646681bc8

Author: Aaron Plattner <aplatt...@nvidia.com>
Date:   Thu Oct  4 16:30:32 2012 -0700

glxgears: Honor -fullscreen in initial reshape

If glxgears is started on a bare X server without a window manager, it does not
get a ConfigureNotify event.  This means that the only time the viewport is
initialized is in main, when it calls reshape(winWidth, winHeight).  This does
not take the size mangling caused by -fullscreen into account, so the gears
appear in a 300x300 box in the lower-left corner of the window instead of
filling the window as intended.

Fix this by moving the size override from make_window to main, and pass the
overridden size to both make_window and the initial reshape.

Signed-off-by: Aaron Plattner <aplatt...@nvidia.com>
Signed-off-by: Brian Paul <bri...@vmware.com>
Reviewed-by: Brian Paul <bri...@vmware.com>

---

 src/xdemos/glxgears.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/xdemos/glxgears.c b/src/xdemos/glxgears.c
index 79b7226..2089715 100644
--- a/src/xdemos/glxgears.c
+++ b/src/xdemos/glxgears.c
@@ -517,12 +517,6 @@ make_window( Display *dpy, const char *name,
    scrnum = DefaultScreen( dpy );
    root = RootWindow( dpy, scrnum );
 
-   if (fullscreen) {
-      x = 0; y = 0;
-      width = DisplayWidth( dpy, scrnum );
-      height = DisplayHeight( dpy, scrnum );
-   }
-
    visinfo = glXChooseVisual(dpy, scrnum, attribs);
    if (!visinfo) {
       printf("Error: couldn't get an RGB, Double-buffered");
@@ -770,6 +764,14 @@ main(int argc, char *argv[])
       return -1;
    }
 
+   if (fullscreen) {
+      int scrnum = DefaultScreen(dpy);
+
+      x = 0; y = 0;
+      winWidth = DisplayWidth(dpy, scrnum);
+      winHeight = DisplayHeight(dpy, scrnum);
+   }
+
    make_window(dpy, "glxgears", x, y, winWidth, winHeight, &win, &ctx);
    XMapWindow(dpy, win);
    glXMakeCurrent(dpy, win, ctx);

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to