Demos (master): glxgears: Honor -fullscreen in initial reshape
Brian Paul
brianp at kemper.freedesktop.org
Fri Oct 5 14:19:08 UTC 2012
Module: Demos
Branch: master
Commit: 5cf434a142ce6e37380a075026eabcd646681bc8
URL: http://cgit.freedesktop.org/mesa/demos/commit/?id=5cf434a142ce6e37380a075026eabcd646681bc8
Author: Aaron Plattner <aplattner at 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 <aplattner at nvidia.com>
Signed-off-by: Brian Paul <brianp at vmware.com>
Reviewed-by: Brian Paul <brianp at 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);
More information about the mesa-commit
mailing list