Re: Setting window properties (always on top, ...) in gnome shell extension

On Mon, Apr 23, 2012 at 11:11 PM, Amy C <mathematical coffee gmail com> wrote:
> Hi all,
> As part of teaching myself how to make gnome shell extensions, I
> decided to just add an item to the menu of the panel's title bar that
> allows the user to select options like always on top/always on this
> workspace.
> I notice in the mutter API there is a meta_window_set_above in
> window.c but this doesn't seem to be exposed to the JS interface.
> Through a bit of trial and error I also seem to be able to call
> window.set_property('above',true) but this function appears to do
> nothing (there is a 'title' property I tested on and using
> set_property on this also seems to do nothing).

Ugh. All the MetaWindow properties are all read-only. It seems they
were only added for the notifies.

Yeah. metacity was originally designed as a process, not a library, so
it doesn't really do things the way it should. I'm working on making
metacity/mutter less of a program with an API and more like a library,
because that's what it should be.

> I could simulate (e.g.) always in this workspace by listening to a
> workspace changed event and moving the relevant window, but this would
> not be a "true" implementation in that the window manager still thinks
> that window.is_on_all_workspaces is false (as I don't seem to be able
> to set it).
> So, does anyone know:
> - an alternate way to set these window properties (properly, as in the
> window manager knows about it) in a gnome shell extension?

There might be some X window properties you can set (but I doubt it,
and you probably can't do it from JS)

> - how to tell whether a likely function in a c file (e.g.
> meta_window_set_above) has been exported to the JS interface?

Check out /usr/share/gir-1.0/Meta-1.0.gir

> - how to expose a method from the C interface to the JS interface?

You have to submit a patch to the C code, and wait a release cycle.
Unfortunate, I know.

> cheers!
> _______________________________________________
> gnome-shell-list mailing list
> gnome-shell-list gnome org


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]