headerless window, undecoration
Steven J Abner
pheonix.sja at att.net
Sat Apr 19 21:58:41 UTC 2025
On Wed, Apr 16 2025 at 05:00:01 PM +0000, Steven J Abner
<pheonix.sja at att.net> wrote:
> Managed to create undecorated window.
In case of any followers, the previous code has issues. I wish to
correct information provided. Motif does work, at least on 2 window
managers but with caveats. I think may even be a way to use
override-redirect but still trying to get 100% with my systems.
Firstly, I currently use a global 'bool wants_undecorated;' On window
creation, one sets wants_undecorated = true; This will allow normal
window creation. If using the method I proposed before, 1 WM does
reparent, the other doesn't. Boolean value allows you to get reparent
on both.
On XCB_REPARENT_NOTIFY event pretty much the aforementioned code:
if (wants_undecorated) {
struct MWMHints {
uint32_t flags, functions, decorations, input_mode, status;
} hints = { 2, 0, 0, 0, 0 };
xcb_intern_atom_cookie_t c0;
xcb_intern_atom_reply_t *r0;
c0 = xcb_intern_atom(session->connection, 0, 15, "_MOTIF_WM_HINTS");
r0 = xcb_intern_atom_reply(session->connection, c0, NULL);
xcb_change_property(session->connection, XCB_PROP_MODE_REPLACE,
rp->window,
r0->atom, r0->atom, 32, sizeof(hints) >> 2,
&hints);
free(r0);
}
where 'rp->window' is retrieved from event.
This is needed to solve not only WM's reparent issues, but a major
issue with XCB_CONFIGURE_NOTIFY events. About 50% of the time, the old
version would give invalid values if using
xcb_translate_coordinates_reply() on one WM, and the other never
configured correctly.
Hope this helps,
Steve
More information about the Xcb
mailing list