Removing decorations from a window

Erik Harrison erikharrison at gmail.com
Mon Aug 22 18:17:19 CEST 2005


On 8/22/05, Chris Green <chris at areti.co.uk> wrote:
> Further to my previous enquiry about removing decorations from a
> window, I seem to be between two opposing camps arguing about how this
> should be done but with neither camp giving me the tools to do it!
> 
> Since the decorations are created (and customised) by the Window
> Manager it seems to me reasonable that the Window Manager should offer
> options which allow one to say that certain windows should have no
> decorations.  However the xfce Window manager doesn't seem to offer
> this possibility.
> 
> So I go to the other end and look at the options in Xlib and there all
> I find is that, since the decorations are created by the Window
> Manager it's non-portable to have functions to remove the decorations
> from the client end.
> 
> Grrrr!

Chris, how about I explain the technical situation for you in some
detail, and you can decide what's best for your needs.

In essence, Window Managers aren't special in any way to the X server.
As such, how a window is treated by the WM is a contract between the
WM and the application.

The standard way for applications and the WM to communicate is on
window properties, which is a set of key=value pairs that are
attatched to the window. You can use the xprop tool to inspect these
values.

So, an application sets hints on it's windows, and if the WM
understands those hints (remember that there is no X enforcement of WM
policy) then the WM behave accordingly - making the window always on
top, removing decorations, etc.

In the old days, each desktop had their own hints - Gnome and KDE were
seperate and incompatible. The only saving grace is that the old motif
window manager was so prevelent that just about every WM in the world
had to mimic it's treatment of window hints. So apps could set these
hints to be compatible between Gnome, KDE, and other window managers.

However, this was frusterating as the whole reason that KDE and Gnome
has built their own hint system was that the older MWM hints were
restricting, broken, or incomplete. So, eventually, a new standard,
blessed by freedesktop.org, emerged, the Extended Window Manager Hints
specification.

If an application needs to have no decorations in order to do it's
job, it needs to request to have no decorations. You can do this via
Qt, GTK+. or Xlib. Qt and GTK+ provide convinience functions for
setting the proper hints. With Xlib you'll need to set the hint
manually. The EWMH spec is here:
http://standards.freedesktop.org/wm-spec/wm-spec-1.3.html

If you prefer to remove the window manager decorations from a window
which requests them, then you need either a window manager which
supports manually overriding an aps requests (like Sawfish), or use a
third party tool that resets the windows hints. I prefer the latter,
as adding overriding capabilities to a WM is not only hard, but
potentially buggy and complicated the UI and potentially slows the WM
down. However, setting a window manager hint externally is very very
simple.

wmctrl and devilspie are the most popular tool for manipulating
windows in this way, however, wmctrl is not designed to do what you
want, and as such lacks the needed features. I do not know if
devilspie can do it, but since devilspie's stated goal is to add to
Metacity (which has taken a similar stance to Xfwm4 on the manual
override of window requests issue) those features which were in
Sawfish, it quite likely does the job.

Does that sufficiently help?


> 
> It's surely possible because some of the xfce utilities don't have
> decorations, maybe I'll end up having to look at the source code for
> them but I fear they go through GTK etc. and I want the basic Xlib
> functions to get a window without decorations.
> 
> The 'right' solution to my mind is that it should be configurable in
> xfwm, is this do-able?
> 
> --
> Chris Green (chris at areti.co.uk)
> 
>     "Never ascribe to malice that which can be explained by incompetence."
> _______________________________________________
> Xfce mailing list
> Xfce at xfce.org
> http://foo-projects.org/mailman/listinfo/xfce
> http://www.xfce.org
> 


-- 
"This brings me back to a time where I had no worries. 
All I needed to do was watch Perfect Strangers."
-Erik



More information about the Xfce mailing list