How to get rid of decorations from window manager?
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
How to get rid of decorations from window manager?
How can I prevent an X program to have decorations from the window manager like e.g. "xeyes", "xmms" and "gkrellm" do?
I use the metacity window manager and gnome (at the moment). Metacity seems to honour the no-decorations request from GTK-apps, but not from "xeyes". Under e.g. "IceWM" xeyes works correctly and doesn't have these decorations. I suppose the reason for this is that xeyes uses the low-level xlibs to do this, and "metacity" doesn't seem to support this.
But obviously GTK needs to use the xlibs to do the same thing. Then how can it be possible GTK programs can get rid of the decorations under metacity, but progs like xeyes don't?
Here's why this long introduction: I like "buici-clock" (ftp://ftp.buici.com/pub/buici-clock/) very much. This is a nice looking, round, analog clock and it uses the the shape extension, so its client-window part is transparant. But it does have windows-decorations (title-bar and frame), even under IceWM (where xeyes works correctly without them).
Now I'd like to try to patch this thing so it doesn't have the decorations, preferably also with metacity. The problem will probably be that this "buici-clock" does not use any toolkit, so chances are it's not going to work under metacity. Is suppose this should be possible though, as GTK seems to manage...
So I'd need to do this through the xlibs, and I have no experience whatsoever with the xlibs. (but I'm willing to dig into it). Another option could be to make a similar app fromm scratch using GTK. But how to do this with GTK? I tried to find out browsing through the sources of xmms, ony to find out it was beyond my skills to understand what's happening in xmms' sources....
Does anyone have some useful information about this? Or what is the keyword to google for? I tried searching through the GTK-docs for the "decoration" and "window manager", which was not of much help.
If you use gtk+-2.0, you can include gtkwindow.h and use gtk_window_set_decorated and set the second arg to FALSE. Compile the following program with:
gcc `pkg-config --cflags --libs gtk+-2.0` nodecor.c -o nodecor
Er, no. The "raw xlibs" do not draw the decorations. They're called "window manager decorations" for a reason. They're drawn by the window manager. So, GTK and QT have directions to the window manager, telling them whether or not to draw the decorations.
I'd be surprised if someone comes up with some low level X API function to do this. I don't think it's even possible.
I think the window manager "asks" the xlibs, or the xlibs pass the request for decorations or not fotr every app running on the X-server.
I think i must be possible: The "xeyes" programs, which uses no toolkit and only th raw xlibs, manages to be displayed in a window without decorations from the window manager. Well, not for the metacity windows manager, but it does work under most, like fvwm, icewm...
Again, AFAIK, Motif is a toolkit too. Probably xeyes uses this. I doubt it uses pure Xlib. It'd be hell to write it in pure Xlib, I think (don't know ANYTHING about Xlib). I still stick by what I said. I don't believe that Xlib is supposed to even care about something called "decorations". It seems to be at a much lower level than that.
(BTW Motif is a commercial toolkit AFAIK, LessTif is the OpenSource clone of it)
I still think the no-decoration-stuff is inside the xlibs. Because if it was managed by a certain toolkit, the app requesting not to be decorated would need always to use the same toolkit as the window manager. I could be mistaken about this though.
Another thought I had was that maybe xlibs don't handle the decorations or not, but because xeyes uses the shape-extension, some window managers would choose to not put decorations on apps using shape extensions. But this can be true either, because buici-clock uses the shape extension for sure, but it has decorations with IceWM, while xeyes has not.