how to XCreateWindow() with no window manager decorations?

how to XCreateWindow() with no window manager decorations?

Post by Bryan D. Gre » Thu, 29 May 1997 04:00:00



Is it possible, from an XLib program, to tell the window manager not to
put any decorations around your top level window?

The Xt manual talks about a _MOTIF_WM_HINTS property, but I cant find any
information on using it in an XLib program.

I know how to do it from my .Xdefaults:  4Dwm*myprog.clientDecoration: none.

What I want to know is how to hardcode it, for a program whose whole purpose in
life is to play fullscreen videos.  The old version of this program used IrisGL's
noborders() function, but this is no longer an option.


Numerical Aerodynamic Simulation
NASA Ames Research Center

 
 
 

how to XCreateWindow() with no window manager decorations?

Post by Ken L » Thu, 29 May 1997 04:00:00



writes:
|> The Xt manual talks about a _MOTIF_WM_HINTS property, but I cant find any
|> information on using it in an XLib program.

_MOTIF_WM_HINTS is defined in <Xm/MwmUtil.h>

--


 
 
 

how to XCreateWindow() with no window manager decorations?

Post by John VanderZwa » Fri, 30 May 1997 04:00:00



: Is it possible, from an XLib program, to tell the window manager not to
: put any decorations around your top level window?

When doing XCreateWindow, you can set the override_redirect flag to TRUE in
the XSetWindowAttributes.

The OpenGL FAQ calls this a sledgehammer approach - if anyone has any better
ways of doing this without needing Motif - I would love to hear them.

--
john van der zwaag


http://www.erc.msstate.edu/~vanderz

 
 
 

how to XCreateWindow() with no window manager decorations?

Post by Nhi Vany » Fri, 30 May 1997 04:00:00




> : Is it possible, from an XLib program, to tell the window manager not to
> : put any decorations around your top level window?

> When doing XCreateWindow, you can set the override_redirect flag to TRUE in
> the XSetWindowAttributes.

> The OpenGL FAQ calls this a sledgehammer approach - if anyone has any better
> ways of doing this without needing Motif - I would love to hear them.

As the decorations are window manager specific, you should tell the
window manager not to add decorations, not try and hack the application.
Any way you try and hack the application, is still only a hint (the
window manager is free to ignore them if its wants).

Likewise as it is window manager specific I can't tell you how to do it
with your window manager, I know how to do it with fvwm, ie...

Style "Toolchest" Sticky, BorderWidth 0, NoTitle

> --
> john van der zwaag


> http://www.erc.msstate.edu/~vanderz

richard.
 
 
 

how to XCreateWindow() with no window manager decorations?

Post by Ruud van Ga » Fri, 30 May 1997 04:00:00




Quote:>Is it possible, from an XLib program, to tell the window manager not to
>put any decorations around your top level window?

For really * windows, you can set OverrideDirect=true when you can
XCreateWindow().
This does have some drawbacks, like:
- you should define your own cursor (otherwise and X shaped cursor will be
used)
- the keys for Raise and Lower window don't work (this is Window Manager
stuff)
- No X resource manager; no Motif

Quote:>The Xt manual talks about a _MOTIF_WM_HINTS property, but I cant find any
>information on using it in an XLib program.

Have never used it. Not that this means it is unsatisfactory.

Quote:>I know how to do it from my .Xdefaults:  4Dwm*myprog.clientDecoration: none.

You talk about an XLib program, but the .Xdefaults clientDecoration resource
is, I think, only used with Motif or higher interfaces.
So, you are probably creating some application shell somewhere
(XtAppInitialize?).
Try passing the arg (XmNmwmDecorations,decor) (decor=MWM_DECOR_xxx).

--
Ruud van Gaal
MarketGraph Software & Images; SGI, PC & Amiga
DoomShell 4.5: http://www.veryComputer.com/~jwkorver
DoomShell 5.0: 3D Game Alchemy for DOOM, DOOM II, Heretic and Hexen (book)

 
 
 

how to XCreateWindow() with no window manager decorations?

Post by Will McGover » Sat, 28 Jun 1997 04:00:00


This works for me... this is an extracted and edited from a larger
chunk of code, so bear with any typos etc. ;)

Display *display;
Window window;
MwmHints hints, *hp;
Atom hintsAtom, typeAtom;
unsigned long nItems, bytesAfter;
int fmt;
.
.
.
/*
 * Set border and decorations
 */
hintsAtom = XInternAtom( display, "_MOTIF_WM_HINTS", False );
XGetWindowProperty( display, window, hintsAtom, 0, 4, False, hintsAtom,
                    &typeAtom, &fmt, &nItems, &bytesAfter,
                    (unsigned char**)&hp );
if ( NULL != hp ) {
    hints = *hp;
    XFree( (void*)hp );

Quote:} else

    memset( &hints, 0, sizeof(hints) );
if ( border )
    hints.decorations = MWM_DECOR_ALL; /* Use 0 for no decorations */
else
    hints.decorations = 0x0;
hints.flags |= MWM_HINTS_DECORATIONS;
XChangeProperty( display, window, hintsAtom, hintsAtom, 32,
                 PropModeReplace, (unsigned char *)&hints, 4 );
XFlush( display );
XMapWindow( display, window );

Hope this help you out....

- Will


> Is it possible, from an XLib program, to tell the window manager not to
> put any decorations around your top level window?

> The Xt manual talks about a _MOTIF_WM_HINTS property, but I cant find any
> information on using it in an XLib program.

> I know how to do it from my .Xdefaults:  4Dwm*myprog.clientDecoration: none.

> What I want to know is how to hardcode it, for a program whose whole purpose in
> life is to play fullscreen videos.  The old version of this program used IrisGL's
> noborders() function, but this is no longer an option.


> Numerical Aerodynamic Simulation
> NASA Ames Research Center

--

Applied Engineering                 Phone +1.415.9337069
Advanced Entertainment Systems      FAX   +1.415.9327069
Silicon Graphics Inc.

"Love your enemies just in case your friends turn out to
                be a pack of bastards."