To create an X window with custom decorations, you must remove the default decorations and emulate their behavior with your own UI. The example below shows a basic implementation of this.
- Create a window without decorations:
The most common approach is to create a frameless window using the_MOTIF_WM_HINTS
property. - Emulate button behaviors:
Most floating window managers have 3 buttons in each titlebar: "Close", "Maximize", and "Minimize".- "Close" can just be handled by breaking the main loop or sending a close event to your application.
- "Maximize" is handled by sending a
ClientMessage
event to the root window. SeeToggleMaximize()
.