Re: headerless window, undecoration

Steven J Abner <[email protected]> Wed, 16 Apr 2025 13:00:01 -0400
Newsgroups gmane.comp.freedesktop.xcb
Message-ID <[email protected]>
 Managed to create undecorated window. Seems to imply can only be done 
by window managers that support Motif.
 I don't understand it, but reply for any that follow.

 The gdk version supplied this from xprop:
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x2, 0x0, 0x0, 0x0, 0x0
 My xcb version supplies:
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 
0x0, 0x0, 0x0

 Seems to work, focus, close, min, max, stack... haven't hooked in 
move/resize.
The code that did it for me:

typedef struct Hints {
  unsigned long flags;
  unsigned long functions;
  unsigned long decorations;
  long inputMode;
  unsigned long status;
} Hints;

Hints hints = { 0 };
hints.flags = 2;
hints.decorations = 0;
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, window,
                    r0->atom, r0->atom, 32, sizeof(hints) >> 2,
                    &hints);
free(r0);

The clue was from stack overflow of 14 years ago
Xlib How Does This (Removing Window Decoration) Work?

I haven't removed extra code to test if it's the sole code solution as 
I have extra code to try and match xprop outputs. And in motif code, 
haven't found the 'Hints' struct yet to verify that portion of code.

Steve