summaryrefslogtreecommitdiff
path: root/progs/xdemos/glxgears.c
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@tungstengraphics.com>2008-10-27 15:37:22 +0000
committerAlan Hourihane <alanh@tungstengraphics.com>2008-10-27 15:37:22 +0000
commit61d3a66456852642ed8fdc1106dc0012e4b89779 (patch)
treefc102d28aa5711bf9569a3963a05ab6a337df559 /progs/xdemos/glxgears.c
parent02c9009bb842cd8a47bc36ea274ef54ff47e1528 (diff)
parent2a877411dbe35abdd8c15fb4821d9232619d89cc (diff)
Merge commit 'origin/master' into gallium-0.2
Diffstat (limited to 'progs/xdemos/glxgears.c')
-rw-r--r--progs/xdemos/glxgears.c52
1 files changed, 50 insertions, 2 deletions
diff --git a/progs/xdemos/glxgears.c b/progs/xdemos/glxgears.c
index c98c3157b5..8db717f1aa 100644
--- a/progs/xdemos/glxgears.c
+++ b/progs/xdemos/glxgears.c
@@ -419,6 +419,52 @@ init(void)
}
+/**
+ * Remove window border/decorations.
+ */
+static void
+no_border( Display *dpy, Window w)
+{
+ static const unsigned MWM_HINTS_DECORATIONS = (1 << 1);
+ static const int PROP_MOTIF_WM_HINTS_ELEMENTS = 5;
+
+ typedef struct
+ {
+ unsigned long flags;
+ unsigned long functions;
+ unsigned long decorations;
+ long inputMode;
+ unsigned long status;
+ } PropMotifWmHints;
+
+ PropMotifWmHints motif_hints;
+ Atom prop, proptype;
+ unsigned long flags = 0;
+
+ /* setup the property */
+ motif_hints.flags = MWM_HINTS_DECORATIONS;
+ motif_hints.decorations = flags;
+
+ /* get the atom for the property */
+ prop = XInternAtom( dpy, "_MOTIF_WM_HINTS", True );
+ if (!prop) {
+ /* something went wrong! */
+ return;
+ }
+
+ /* not sure this is correct, seems to work, XA_WM_HINTS didn't work */
+ proptype = prop;
+
+ XChangeProperty( dpy, w, /* display, window */
+ prop, proptype, /* property, type */
+ 32, /* format: 32-bit datums */
+ PropModeReplace, /* mode */
+ (unsigned char *) &motif_hints, /* data */
+ PROP_MOTIF_WM_HINTS_ELEMENTS /* nelements */
+ );
+}
+
+
/*
* Create an RGB, double-buffered window.
* Return the window and context handles.
@@ -479,13 +525,15 @@ make_window( Display *dpy, const char *name,
attr.colormap = XCreateColormap( dpy, root, visinfo->visual, AllocNone);
attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
/* XXX this is a bad way to get a borderless window! */
- attr.override_redirect = fullscreen;
- mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask | CWOverrideRedirect;
+ mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
win = XCreateWindow( dpy, root, x, y, width, height,
0, visinfo->depth, InputOutput,
visinfo->visual, mask, &attr );
+ if (fullscreen)
+ no_border(dpy, win);
+
/* set hints and properties */
{
XSizeHints sizehints;