I'm after a way to:
- get list of all application windows currently open, as a Gdk or Gtk window
- remove window decorations for selected windows (maximised in my case).
I'd like to do this using mutter, gdk, wnck or gtk (or GdkX11, ...) (i.e. anything with gobject introspection).
I've seen the following question: Remove titlebar from maximized terminal window but am struggling with converting it to something that works.
I'm currently using GNOME 3.2 (am open to GNOME 3.4 solutions though).
As to 1., I know I can get all windows with
mutter fairly easily (e.g.
Wnck.Screen.get_default().get_windows()), but how do I then convert these into G(t or d?)k windows in order to remove decorations?
I can convert a mutter window to a Gdk one like so:
xwin = GdkX11.X11Window.foreign_new_for_display( Gdk.Display.get_default(), mutterWindow.get_compositor_private()['x-window'] );
xwin object does not respond to commands such as
xwin.maximize(), so I feel that something went wrong in the conversion!
I have had a look at
Gtk.Window.list_toplevels() but these return lists of more windows than I have open, and I am unsure if my actual application windows are in the list and how to match them up.
As to 2., if I first get the active window from within Gdk (since I know it's a Gdk window and it responds properly to events such as
maximize, unlike when I use
foreign_new_for_display) and then try to remove decoration as per the previously linked question, the window (& process) dies! I'm not sure what the error is.
const Gdk = imports.gi.Gdk; // get current window. It's a terminal, not null. // For now assume it's maximized. curwin = Gdk.Screen.get_default().get_active_window(); // decorations don't seem to updated unless I unmaximize & re-maximize curwin.unmaximize(); // try remove decorations: window + process dies! curwin.set_decorations(0); curwin.maximize();
If I use
curwin.set_decorations(Gdk.WMDecoration.BORDER) (note: GDK window documentation here), the window appears as I wish when the window is unmaximized (title bar gone), but when maximized, space for the title bar is still left, although the text itself is not shown.
Would anyone be able to give me insight into how to achieve either of my goals? (Ultimately, automagic titlebar hiding of maximised windows, like
maximus for Ubuntu's Unity netbook remix). I really do wish to use this using Gtk/Gdk/wnck/mutter/anything with gobject introspection, as opposed to an external app like compiz or modifying the metacity window theme's XML (which I know you can do to achieve this).