views:

175

answers:

2

Is their a standard way to make a particular window borderless on Linux? I believe that the window border is drawn by your window manager, so it may be that I just need to use a particular window manager (that would be find, I'd just need to know which one)... My hope is that all the window managers might follow some standard that allows me to do this programatically...

+1  A: 

With GTK+ you can call gtk_window_set_decorated().

Bastien Léonard
I couldn't use this, because I needed to talk right to the Window manager, but I accept it as the answer because for most people, this is probably the solution they are looking for.
dicroce
+1  A: 

Using Xlib and old _MOTIF_WM_HINTS:

struct MwmHints {
    unsigned long flags;
    unsigned long functions;
    unsigned long decorations;
    long input_mode;
    unsigned long status;
};
enum {
    MWM_HINTS_FUNCTIONS = (1L << 0),
    MWM_HINTS_DECORATIONS =  (1L << 1),

    MWM_FUNC_ALL = (1L << 0),
    MWM_FUNC_RESIZE = (1L << 1),
    MWM_FUNC_MOVE = (1L << 2),
    MWM_FUNC_MINIMIZE = (1L << 3),
    MWM_FUNC_MAXIMIZE = (1L << 4),
    MWM_FUNC_CLOSE = (1L << 5)
};

Atom mwmHintsProperty = XInternAtom(display, "_MOTIF_WM_HINTS", 0);
struct MwmHints hints;
hints.flags = MWM_HINTS_DECORATIONS;
hints.decorations = 0;
XChangeProperty(display, window, mwmHintsProperty, mwmHintsProperty, 32,
        PropModeReplace, (unsigned char *)&hints, 5);

These days NetWM/EWMH hints are preferred, but as far as I know all modern window managers still support this.

ephemient
Awesome... :) Exactly what I was looking for, and better than what I went with because it's more portable... :) I'll be using this instead later today...
dicroce