On Sun, 2007-01-07 at 01:20 +0000, Mike Dransfield wrote:
> FYI, I have put up a forum post [1] where I am going to
> maintain information about the netwm api for the
> dbus plugin.
>
> I have gone through the EWMH spec [2] and broken it down
> into a dbus compatible api, it seems to be good and roughly
> compatible with the existing compiz one.
>
> I think everything should be self explanitory, if there are
> any comments or if there is anything I have misunderstood
> or missed I would like to hear.
>
> I have done the rough framework already and will look at
> the methods in the order of priority.
>
> I assume I can read the member directly as in the scripting
> plugin when getting, but I will need to generate the correct
> client messages for setting properties, or are there internal
> compiz functions for some of these things?
>
> The only thing missing are signals for the changed properties,
> this should be fairly easy to add later. The set methods will
> need these to be useful to scripts.
Looks good to me.
I recommend that you implement this as a separate library (maybe
libnetwm-dbus). Everything can be implemented using xlib, e.g.
requesting a change of some property is always done by sending a client
message to the wm. You can make it so that an application using
libnetwm-dbus should register a set of call-back functions similar to
XSendEvent, XGetWindowProperty, XChangeProperty and a dbus connection of
course.
The application using libnetwm-dbus could be responsible for making the
wm actually handle them.
A tiny netwm daemon (netwmd) could be written, which will link to
libnetwm-dbus and use XSendEvent and XGetWindowProperty to provide
the /org/freedesktop/netwm interface.
In the case of the compiz dbus plugin, we can just short-circuit these
events by passing the client message events to the handleEvent function
instead of XSendEvent and avoid the round-trip to the server. Similar
thing can be done for XGetWindowProperty.
Any wm with dbus support can use libnetwm-dbus to provide the netwm
interface and if some dbus application asks for this interface and the
wm doesn't support it, netwmd will automatically be launched and provide
it.
With some clever design you can make it so that the dbus plugin can
reuse a lot of code in libnetwm-dbus to provide compiz specific hooks
too. I've been wanting to add support for doing everything that the dbus
plugin can do using client messages and window properties so that there
would be a way to configure and manipulate compiz just using the x11
protocol. It makes even more sense now as that would allow the dbus
plugin to dispatch compiz specific hooks in exactly the same way as the
netwm interface.
Let me know what you think about all this?
-David