XWindow without titlebar
Glynn Clements
glynn at gclements.plus.com
Sat Nov 14 08:16:38 PST 2009
Carlos (particular) wrote:
> Hello, How can I create a XWindow without titlebar (or without close
> button) but with window border?
> I've used _MOTIF_WM_HINTS atom but remove the window border.
hints.flags = MWM_HINTS_DECORATIONS;
hints.decorations = MWM_DECOR_BORDER | MWM_DECOR_RESIZEH;
Whether or not your WM respects this is up to the WM.
> If is not posible, how can ignore the close button event? the goal is
> not to close the window from the titlebar.
Add WM_DELETE_WINDOW to WM_PROTOCOLS. This will typically case the WM
to send a ClientMessage event with WM_DELETE_WINDOW as the type atom,
rather than simply destroying the window. The application can simply
ignore the message.
However, like a lot of things in X, this relies upon the WM
cooperating. If the WM also provides a feature to "destroy" (as
opposed to "delete") a window, you can't prevent this.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the xorg
mailing list