views:

321

answers:

3

Is there a way to force a gtk.Window object to ignore the Window Manager's show/hide commands, such as "iconify" and "show desktop?"

I'm trying to create a persistent window, stuck to the desktop, that will not disappear with all other windows when the desktop is exposed.

EDIT: I guess what I'm wondering specifically is whether or not it's possible to reproduce the behavior found in applications such as docks, desktop widgets, system trays, etc. using PyGTK?

+1  A: 

You've got it backwards; it's not the window manager telling the window to minimize, by sending it a command. The window manager owns the window, if it wants to stop mapping a window, it will just do it, without asking the window for permission.

So I would think that the answer is "no".

unwind
Then I guess my question is, more generally, what would be a best-practice approach to creating a desktop widget using PyGTK?
Evan Hanson
Check if there's support for "sticky" windows, that might be the proper hint to the manager not to minimize the window. It usually also makes the window appear in the same location an all (virtual) desktops, which might be good.
unwind
I know about the "sticky" property, and it works just as it should, but this is not honored by any of the WMs I've tested in the way I intend.
Evan Hanson
A: 

Try setting the GdkWindowTypeHint on the GtkWindow:

gtk_window_set_type_hint(the_window, GDK_WINDOW_TYPE_HINT_UTILITY);

There's also various methods for not having your window listed in pagers or taskbars and have it show up on all desktop. Keep in mind that all this behavior depends on support from the window manager. Unless you use something really old, this should not pose a problem though.

Torsten Marek
A: 

Not having received a "this is how to do this" answer and having done a bit more research I can say that -- as far as I know -- there is no easy way to achieve this sort of functionality with PyGTK. The best options are to set window manager hints and leave it up to the WM to do what you want (hopefully).

Evan Hanson