https://wiki.preterhuman.net/index.php?title=How_to_XCreateWindow()_with_no_window_manager_decorations&feed=atom&action=historyHow to XCreateWindow() with no window manager decorations - Revision history2024-03-28T19:28:52ZRevision history for this page on the wikiMediaWiki 1.35.0https://wiki.preterhuman.net/index.php?title=How_to_XCreateWindow()_with_no_window_manager_decorations&diff=11017&oldid=prevNetfreak at 01:49, 7 August 20192019-08-07T01:49:51Z<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 01:49, 7 August 2019</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>''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.''</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>''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.''</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>When doing XCreateWindow, you can set the override_redirect flag to TRUE inthe XSetWindowAttributes.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>When doing XCreateWindow, you can set the override_redirect flag to TRUE inthe XSetWindowAttributes.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>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.</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>The <ins class="diffchange diffchange-inline">[[</ins>OpenGL<ins class="diffchange diffchange-inline">]] </ins>FAQ calls this a sledgehammer approach - if anyone has any better ways of doing this without needing Motif - I would love to hear them.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>For really hardcore windows, you can set OverrideDirect=true when you can XCreateWindow(). This does have some drawbacks, like:</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>For really hardcore windows, you can set OverrideDirect=true when you can XCreateWindow(). This does have some drawbacks, like:</div></td></tr>
</table>Netfreakhttps://wiki.preterhuman.net/index.php?title=How_to_XCreateWindow()_with_no_window_manager_decorations&diff=11016&oldid=prevNetfreak: Created page with "''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 propert..."2019-08-07T01:49:22Z<p>Created page with "''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 propert..."</p>
<p><b>New page</b></p><div>''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.''<br />
<br />
When doing XCreateWindow, you can set the override_redirect flag to TRUE inthe XSetWindowAttributes.<br />
<br />
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.<br />
<br />
For really hardcore windows, you can set OverrideDirect=true when you can XCreateWindow(). This does have some drawbacks, like:<br />
* you should define your own cursor (otherwise and X shaped cursor will be used)<br />
* the keys for Raise and Lower window don't work (this is Window Manager stuff)<br />
* No X resource manager; no Motif<br />
<br />
This works for me... this is an extracted and edited from a larger chunk of code, so bear with any typos etc. ;)<br />
<pre><br />
Display *display;<br />
Window window;<br />
MwmHints hints, *hp;<br />
Atom hintsAtom, typeAtom;<br />
unsigned long nItems, bytesAfter;<br />
int fmt;<br />
.<br />
.<br />
.<br />
/*<br />
* Set border and decorations<br />
*/<br />
hintsAtom = XInternAtom( display, "_MOTIF_WM_HINTS", False );<br />
XGetWindowProperty( display, window, hintsAtom, 0, 4, False, hintsAtom,<br />
&typeAtom, &fmt, &nItems, &bytesAfter,<br />
(unsigned char**)&hp );<br />
if ( NULL != hp ) {<br />
hints = *hp;<br />
XFree( (void*)hp );<br />
} else<br />
memset( &hints, 0, sizeof(hints) );<br />
if ( border )<br />
hints.decorations = MWM_DECOR_ALL; /* Use 0 for no decorations */<br />
else<br />
hints.decorations = 0x0;<br />
hints.flags |= MWM_HINTS_DECORATIONS;<br />
XChangeProperty( display, window, hintsAtom, hintsAtom, 32,<br />
PropModeReplace, (unsigned char *)&hints, 4 );<br />
XFlush( display );<br />
XMapWindow( display, window );<br />
</pre><br />
<br />
[[Category:SGI]][[Category:Programming]]</div>Netfreak