Re: [Python-xlib-users] Prevent Overlapping or Reserve Screen Space

Hi Benjamin,
I was hoping someone who had a more useful answer would step forward,
but it didn't seem to happen. So...
On Mon, 30 May 2011 09:25:11 +0200
Benjamin Trias <jesuisbenjamin@...> wrote:
> Hello Xlib people,
>
> I've been looking for a while now for a way to make X reserve screen
> space (i.e. prevent other windows from overlapping with an
> application), while using Python. All my research points back to
> Python Xlib.
> Is there a way to do that? I have found 0 documentation about Xlib. Is
> there any available?
Python-Xlib is a pure-python implementation of the Xlib wire
protocol. The real documentation is the Xlib documentation, but there
is documentation in texi (and the things it can create) for the
various objects the library provides. If you don't have/can't get
that, I can send you a copy. You'll probably need the Xlib
documentation as well (I don't recall ever trying to use python-xlib
without both), which can be found here:
http://www.x.org/wiki/ProgrammingDocumentation
> I've found it is quite hard to achieve this using Python so far. I
> managed with Gtk+2, but Gtk+3's PyGI does not allow to do that
> anymore. PyQt, PySide, PyWx, PyGame and Kivy do not allow this kind of
> interaction with X either. That's really sad imo.
How did you do this with Gtk+2? That may be enough of a hint for us to
figure out how to do it with Xlib (after all, Gtk+2 had to be using
Xlib calls at some point).
What you're trying to do sounds more like functionality from the
window manager, not the windowing system per se. You might be able to
get Xlib to do it by "shrinking" the root window that the window
manager uses to reserve space along one of the zero axis. How you then
get that space to an application is an interesting problem - the uses
I've seen for this all involve the window manager which reserved the
space using it.
Depending on what you have in mind, a modern paned window manager
might be a better solution to your problem.
<mike
--
Mike Meyer <mwm@...> http://www.mired.org/
Independent Software developer/SCM consultant, email for more information.
O< ascii ribbon campaign - stop html mail - http://www.asciiribbon.org

Thread view

Hello Xlib people,
I've been looking for a while now for a way to make X reserve screen
space (i.e. prevent other windows from overlapping with an
application), while using Python. All my research points back to
Python Xlib.
Is there a way to do that? I have found 0 documentation about Xlib. Is
there any available?
I've found it is quite hard to achieve this using Python so far. I
managed with Gtk+2, but Gtk+3's PyGI does not allow to do that
anymore. PyQt, PySide, PyWx, PyGame and Kivy do not allow this kind of
interaction with X either. That's really sad imo.
Thanks for your help,
Benjamin
PS: do i need to subscribe to receive the answer, because if i do, i didn't.

Hi Benjamin,
I was hoping someone who had a more useful answer would step forward,
but it didn't seem to happen. So...
On Mon, 30 May 2011 09:25:11 +0200
Benjamin Trias <jesuisbenjamin@...> wrote:
> Hello Xlib people,
>
> I've been looking for a while now for a way to make X reserve screen
> space (i.e. prevent other windows from overlapping with an
> application), while using Python. All my research points back to
> Python Xlib.
> Is there a way to do that? I have found 0 documentation about Xlib. Is
> there any available?
Python-Xlib is a pure-python implementation of the Xlib wire
protocol. The real documentation is the Xlib documentation, but there
is documentation in texi (and the things it can create) for the
various objects the library provides. If you don't have/can't get
that, I can send you a copy. You'll probably need the Xlib
documentation as well (I don't recall ever trying to use python-xlib
without both), which can be found here:
http://www.x.org/wiki/ProgrammingDocumentation
> I've found it is quite hard to achieve this using Python so far. I
> managed with Gtk+2, but Gtk+3's PyGI does not allow to do that
> anymore. PyQt, PySide, PyWx, PyGame and Kivy do not allow this kind of
> interaction with X either. That's really sad imo.
How did you do this with Gtk+2? That may be enough of a hint for us to
figure out how to do it with Xlib (after all, Gtk+2 had to be using
Xlib calls at some point).
What you're trying to do sounds more like functionality from the
window manager, not the windowing system per se. You might be able to
get Xlib to do it by "shrinking" the root window that the window
manager uses to reserve space along one of the zero axis. How you then
get that space to an application is an interesting problem - the uses
I've seen for this all involve the window manager which reserved the
space using it.
Depending on what you have in mind, a modern paned window manager
might be a better solution to your problem.
<mike
--
Mike Meyer <mwm@...> http://www.mired.org/
Independent Software developer/SCM consultant, email for more information.
O< ascii ribbon campaign - stop html mail - http://www.asciiribbon.org

Hi Mike,
Thanks for the documentation references! In the meantime i discovered
the ICCCM documentation, which brings light on much of the X
protocols.
> > I've found it is quite hard to achieve this using Python so far. I
> > managed with Gtk+2, but Gtk+3's PyGI does not allow to do that
> > anymore. PyQt, PySide, PyWx, PyGame and Kivy do not allow this kind of
> > interaction with X either. That's really sad imo.
>
> How did you do this with Gtk+2? That may be enough of a hint for us to
> figure out how to do it with Xlib (after all, Gtk+2 had to be using
> Xlib calls at some point).
Using Gtk+2 i did:
import gtk
class PyGtkWidgetDockExample:
def __init__(self):
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.set_default_size(100, gtk.gdk.screen_height())
self.window.move(gtk.gdk.screen_width()-100, 0)
self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DOCK)
self.window.show()
self.window.window.property_change("_NET_WM_STRUT", "CARDINAL", 32,
gtk.gdk.PROP_MODE_REPLACE, [0, 100, 0, 0])
app = PyGtkWidgetDockExample()
gtk.main()
The specs are provided on
http://standards.freedesktop.org/wm-spec/wm-spec-1.3.html#id2507618
In Gtk 3 however, there is no Gtk.Window().window object (a Gdk.Window
in fact) and there is no Gdk.Window().property_change() in PyGIand
i've been explained it had to do with the kind of data that had to be
passed into it, which was too much hassle for making Python bindings.
> What you're trying to do sounds more like functionality from the
> window manager, not the windowing system per se.
Compiz doesn't provide this fuctionality (i didn't find it and Compiz
forum remained silent at my queries, which i assume means it's not
possible).
> You might be able to
> get Xlib to do it by "shrinking" the root window that the window
> manager uses to reserve space along one of the zero axis. How you then
> get that space to an application is an interesting problem - the uses
> I've seen for this all involve the window manager which reserved the
> space using it.
In the light of the above code, it seems X Window should be able to do
what i want. Hopefully i can get Python Xlib to do that for me.
> Depending on what you have in mind, a modern paned window manager
> might be a better solution to your problem.
What i have in mind is to make a panel-like application, to replace
Gnome 2's panel and make a dock.
Also i find it more interesting to learn to do this independently from
the GUI library. I have discovered Kivy recently (http://kivy.org/),
which is a promising GUI library, not yet able to provide all the
functionality i'd need for my ideas though. I managed to get hold of a
window and resize it so far http://kivy-lab.blogspot.com/.
Thanks for your help, i'm looking forward to your suggestions.
Benjamin

On Wed, 1 Jun 2011 01:08:39 +0200
Benjamin Trias <jesuisbenjamin@...> wrote:
> Thanks for the documentation references! In the meantime i discovered
> the ICCCM documentation, which brings light on much of the X
> protocols.
The ICCCM is client<->client stuff - and from X's point of view, the
window manager is a client. Since you're trying to convince a window
manager to do something for you (also a client), this is a good place
to look.
> > > I've found it is quite hard to achieve this using Python so far. I
> > > managed with Gtk+2, but Gtk+3's PyGI does not allow to do that
> > > anymore. PyQt, PySide, PyWx, PyGame and Kivy do not allow this kind of
> > > interaction with X either. That's really sad imo.
> >
> > How did you do this with Gtk+2? That may be enough of a hint for us to
> > figure out how to do it with Xlib (after all, Gtk+2 had to be using
> > Xlib calls at some point).
> Using Gtk+2 i did:
>
> import gtk
>
> class PyGtkWidgetDockExample:
> def __init__(self):
> self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
> self.window.set_default_size(100, gtk.gdk.screen_height())
> self.window.move(gtk.gdk.screen_width()-100, 0)
I think this is the one you want:
> self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DOCK)
> self.window.show()
> self.window.window.property_change("_NET_WM_STRUT", "CARDINAL", 32,
> gtk.gdk.PROP_MODE_REPLACE, [0, 100, 0, 0])
>
> app = PyGtkWidgetDockExample()
> gtk.main()
> In Gtk 3 however, there is no Gtk.Window().window object (a Gdk.Window
> in fact) and there is no Gdk.Window().property_change() in PyGIand
> i've been explained it had to do with the kind of data that had to be
> passed into it, which was too much hassle for making Python bindings.
Is there a set_type_hint or equivalent? The property you are changing
tells the window manager how to size the window, which you can
probably do other ways. The type hint "TYPE_HINT_DOCK" should
translate into NET_WM_WINDOW_TYPE_DOCK at some point, which tells the
window manager that this window is a dock, please make sure it stays
on top.
> > What you're trying to do sounds more like functionality from the
> > window manager, not the windowing system per se.
Turns out this is right - you're using ICCCM to tell the window
manager to do what you want. This isn't something I (or anyone else
using python-xlib) have dealt with before.
> In the light of the above code, it seems X Window should be able to do
> what i want. Hopefully i can get Python Xlib to do that for me.
I think you can do that. My guess (and it's really no more than that)
is that want to set the NET_WM_WINDOW_TYPE property on the Window to
include NET_WM_WINDOW_TYPE_DOCK. The docs you pointed at provide
other atoms to plug into that list that might be interesting.
The python-xlib window object has a change_property method that should
let you do this once you've got the window set up.
However.... the ICCCM Atom values aren't in python-xlib (yet). Adding
them (for a quick hack) should be easy - just find the actual values
(I couldn't find them on my system, but I don't think I have an ICCCM
compliant window manager installed), and add them to Xlib/Xatom.py.
Doing this right would probably involve an ICCCM directory (and
possibly others to support it) with files to hold the various
values. Doesn't look like there are any new types, so it's still not
to bad.
> > Depending on what you have in mind, a modern paned window manager
> > might be a better solution to your problem.
> What i have in mind is to make a panel-like application, to replace
> Gnome 2's panel and make a dock.
This is pretty much what that property (among others) is meant for.
<mike
--
Mike Meyer <mwm@...> http://www.mired.org/
Independent Software developer/SCM consultant, email for more information.
O< ascii ribbon campaign - stop html mail - http://www.asciiribbon.org

I actually have dealt with this before, in a PyQt/PySide application. (
http://projects.g33xnexus.com/pqrs/wiki/ - sorry for the ridiclously ugly
code) If you want to use PyQt or PySide, you'll want something like the
following:
win.setWindowFlags(QtCore.Qt.Widget | QtCore.Qt.X11BypassWindowManagerHint |
QtCore.Qt.WindowStaysOnTopHint)
win.setAttribute(QtCore.Qt.WA_X11NetWmWindowTypeDock)
win.setAttribute(QtCore.Qt.WA_ShowWithoutActivating)
>From what I remember of the ICCCM, the properties your Gtk+2 code was
setting basically mean this:
- self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DOCK) - Make sure
the window is not decorated (= doesn't have a frame) and is always on top.
- self.window.window.property_change("_NET_WM_STRUT", "CARDINAL", 32,
gtk.gdk.PROP_MODE_REPLACE, [0, 100, 0, 0]) - Reserve space at the edge of
the screen for this window. (make it a "strut", which basically means a
window that takes up an entire edge of the available screen space)
You should be able to set the exact same properties from Python-Xlib with no
problem; check /usr/include/netwm_def.h or the docs at
http://www.freedesktop.org/wiki/Specifications/wm-spec for the enum values
and more info.
On Tue, May 31, 2011 at 19:07, Mike Meyer <mwm@...> wrote:
> On Wed, 1 Jun 2011 01:08:39 +0200
> Benjamin Trias <jesuisbenjamin@...> wrote:
>
> > Thanks for the documentation references! In the meantime i discovered
> > the ICCCM documentation, which brings light on much of the X
> > protocols.
>
> The ICCCM is client<->client stuff - and from X's point of view, the
> window manager is a client. Since you're trying to convince a window
> manager to do something for you (also a client), this is a good place
> to look.
>
> > > > I've found it is quite hard to achieve this using Python so far. I
> > > > managed with Gtk+2, but Gtk+3's PyGI does not allow to do that
> > > > anymore. PyQt, PySide, PyWx, PyGame and Kivy do not allow this kind
> of
> > > > interaction with X either. That's really sad imo.
> > >
> > > How did you do this with Gtk+2? That may be enough of a hint for us to
> > > figure out how to do it with Xlib (after all, Gtk+2 had to be using
> > > Xlib calls at some point).
> > Using Gtk+2 i did:
> >
> > import gtk
> >
> > class PyGtkWidgetDockExample:
> > def __init__(self):
> > self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
> > self.window.set_default_size(100, gtk.gdk.screen_height())
> > self.window.move(gtk.gdk.screen_width()-100, 0)
>
> I think this is the one you want:
>
> > self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DOCK)
> > self.window.show()
> > self.window.window.property_change("_NET_WM_STRUT", "CARDINAL",
> 32,
> > gtk.gdk.PROP_MODE_REPLACE, [0, 100, 0, 0])
> >
> > app = PyGtkWidgetDockExample()
> > gtk.main()
>
> > In Gtk 3 however, there is no Gtk.Window().window object (a Gdk.Window
> > in fact) and there is no Gdk.Window().property_change() in PyGIand
> > i've been explained it had to do with the kind of data that had to be
> > passed into it, which was too much hassle for making Python bindings.
>
> Is there a set_type_hint or equivalent? The property you are changing
> tells the window manager how to size the window, which you can
> probably do other ways. The type hint "TYPE_HINT_DOCK" should
> translate into NET_WM_WINDOW_TYPE_DOCK at some point, which tells the
> window manager that this window is a dock, please make sure it stays
> on top.
>
> > > What you're trying to do sounds more like functionality from the
> > > window manager, not the windowing system per se.
>
> Turns out this is right - you're using ICCCM to tell the window
> manager to do what you want. This isn't something I (or anyone else
> using python-xlib) have dealt with before.
>
> > In the light of the above code, it seems X Window should be able to do
> > what i want. Hopefully i can get Python Xlib to do that for me.
>
> I think you can do that. My guess (and it's really no more than that)
> is that want to set the NET_WM_WINDOW_TYPE property on the Window to
> include NET_WM_WINDOW_TYPE_DOCK. The docs you pointed at provide
> other atoms to plug into that list that might be interesting.
>
> The python-xlib window object has a change_property method that should
> let you do this once you've got the window set up.
>
> However.... the ICCCM Atom values aren't in python-xlib (yet). Adding
> them (for a quick hack) should be easy - just find the actual values
> (I couldn't find them on my system, but I don't think I have an ICCCM
> compliant window manager installed), and add them to Xlib/Xatom.py.
>
> Doing this right would probably involve an ICCCM directory (and
> possibly others to support it) with files to hold the various
> values. Doesn't look like there are any new types, so it's still not
> to bad.
>
> > > Depending on what you have in mind, a modern paned window manager
> > > might be a better solution to your problem.
> > What i have in mind is to make a panel-like application, to replace
> > Gnome 2's panel and make a dock.
>
> This is pretty much what that property (among others) is meant for.
>
> <mike
> --
> Mike Meyer <mwm@...> http://www.mired.org/
> Independent Software developer/SCM consultant, email for more information.
>
> O< ascii ribbon campaign - stop html mail - http://www.asciiribbon.org
>
>
> ------------------------------------------------------------------------------
> Simplify data backup and recovery for your virtual environment with
> vRanger.
> Installation's a snap, and flexible recovery options mean your data is
> safe,
> secure and there when you need it. Data protection magic?
> Nope - It's vRanger. Get your free trial download today.
> http://p.sf.net/sfu/quest-sfdev2dev
> _______________________________________________
> python-xlib-users mailing list
> python-xlib-users@...
> https://lists.sourceforge.net/lists/listinfo/python-xlib-users
>

Also, the actual ICCCM would probably come in handy when dealing with the
raw X window properties: http://tronche.com/gui/x/icccm/
On Wed, Jun 1, 2011 at 00:16, David Bronke <whitelynx@...> wrote:
> I actually have dealt with this before, in a PyQt/PySide application. (
> http://projects.g33xnexus.com/pqrs/wiki/ - sorry for the ridiclously ugly
> code) If you want to use PyQt or PySide, you'll want something like the
> following:
> win.setWindowFlags(QtCore.Qt.Widget | QtCore.Qt.X11BypassWindowManagerHint
> | QtCore.Qt.WindowStaysOnTopHint)
> win.setAttribute(QtCore.Qt.WA_X11NetWmWindowTypeDock)
> win.setAttribute(QtCore.Qt.WA_ShowWithoutActivating)
>
> From what I remember of the ICCCM, the properties your Gtk+2 code was
> setting basically mean this:
>
> - self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DOCK) - Make sure
> the window is not decorated (= doesn't have a frame) and is always on top.
> - self.window.window.property_change("_NET_WM_STRUT", "CARDINAL", 32,
> gtk.gdk.PROP_MODE_REPLACE, [0, 100, 0, 0]) - Reserve space at the edge
> of the screen for this window. (make it a "strut", which basically means a
> window that takes up an entire edge of the available screen space)
>
> You should be able to set the exact same properties from Python-Xlib with
> no problem; check /usr/include/netwm_def.h or the docs at
> http://www.freedesktop.org/wiki/Specifications/wm-spec for the enum values
> and more info.
>
>
>
> On Tue, May 31, 2011 at 19:07, Mike Meyer <mwm@...> wrote:
>
>> On Wed, 1 Jun 2011 01:08:39 +0200
>> Benjamin Trias <jesuisbenjamin@...> wrote:
>>
>> > Thanks for the documentation references! In the meantime i discovered
>> > the ICCCM documentation, which brings light on much of the X
>> > protocols.
>>
>> The ICCCM is client<->client stuff - and from X's point of view, the
>> window manager is a client. Since you're trying to convince a window
>> manager to do something for you (also a client), this is a good place
>> to look.
>>
>> > > > I've found it is quite hard to achieve this using Python so far. I
>> > > > managed with Gtk+2, but Gtk+3's PyGI does not allow to do that
>> > > > anymore. PyQt, PySide, PyWx, PyGame and Kivy do not allow this kind
>> of
>> > > > interaction with X either. That's really sad imo.
>> > >
>> > > How did you do this with Gtk+2? That may be enough of a hint for us to
>> > > figure out how to do it with Xlib (after all, Gtk+2 had to be using
>> > > Xlib calls at some point).
>> > Using Gtk+2 i did:
>> >
>> > import gtk
>> >
>> > class PyGtkWidgetDockExample:
>> > def __init__(self):
>> > self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
>> > self.window.set_default_size(100, gtk.gdk.screen_height())
>> > self.window.move(gtk.gdk.screen_width()-100, 0)
>>
>> I think this is the one you want:
>>
>> > self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DOCK)
>> > self.window.show()
>> > self.window.window.property_change("_NET_WM_STRUT", "CARDINAL",
>> 32,
>> > gtk.gdk.PROP_MODE_REPLACE, [0, 100, 0, 0])
>> >
>> > app = PyGtkWidgetDockExample()
>> > gtk.main()
>>
>> > In Gtk 3 however, there is no Gtk.Window().window object (a Gdk.Window
>> > in fact) and there is no Gdk.Window().property_change() in PyGIand
>> > i've been explained it had to do with the kind of data that had to be
>> > passed into it, which was too much hassle for making Python bindings.
>>
>> Is there a set_type_hint or equivalent? The property you are changing
>> tells the window manager how to size the window, which you can
>> probably do other ways. The type hint "TYPE_HINT_DOCK" should
>> translate into NET_WM_WINDOW_TYPE_DOCK at some point, which tells the
>> window manager that this window is a dock, please make sure it stays
>> on top.
>>
>> > > What you're trying to do sounds more like functionality from the
>> > > window manager, not the windowing system per se.
>>
>> Turns out this is right - you're using ICCCM to tell the window
>> manager to do what you want. This isn't something I (or anyone else
>> using python-xlib) have dealt with before.
>>
>> > In the light of the above code, it seems X Window should be able to do
>> > what i want. Hopefully i can get Python Xlib to do that for me.
>>
>> I think you can do that. My guess (and it's really no more than that)
>> is that want to set the NET_WM_WINDOW_TYPE property on the Window to
>> include NET_WM_WINDOW_TYPE_DOCK. The docs you pointed at provide
>> other atoms to plug into that list that might be interesting.
>>
>> The python-xlib window object has a change_property method that should
>> let you do this once you've got the window set up.
>>
>> However.... the ICCCM Atom values aren't in python-xlib (yet). Adding
>> them (for a quick hack) should be easy - just find the actual values
>> (I couldn't find them on my system, but I don't think I have an ICCCM
>> compliant window manager installed), and add them to Xlib/Xatom.py.
>>
>> Doing this right would probably involve an ICCCM directory (and
>> possibly others to support it) with files to hold the various
>> values. Doesn't look like there are any new types, so it's still not
>> to bad.
>>
>> > > Depending on what you have in mind, a modern paned window manager
>> > > might be a better solution to your problem.
>> > What i have in mind is to make a panel-like application, to replace
>> > Gnome 2's panel and make a dock.
>>
>> This is pretty much what that property (among others) is meant for.
>>
>> <mike
>> --
>> Mike Meyer <mwm@...> http://www.mired.org/
>> Independent Software developer/SCM consultant, email for more information.
>>
>> O< ascii ribbon campaign - stop html mail - http://www.asciiribbon.org
>>
>>
>> ------------------------------------------------------------------------------
>> Simplify data backup and recovery for your virtual environment with
>> vRanger.
>> Installation's a snap, and flexible recovery options mean your data is
>> safe,
>> secure and there when you need it. Data protection magic?
>> Nope - It's vRanger. Get your free trial download today.
>> http://p.sf.net/sfu/quest-sfdev2dev
>> _______________________________________________
>> python-xlib-users mailing list
>> python-xlib-users@...
>> https://lists.sourceforge.net/lists/listinfo/python-xlib-users
>>
>
>

Hi guys,
thanks for all your inputs : )
On 1 June 2011 07:16, David Bronke <whitelynx@...> wrote:
> I actually have dealt with this before, in a PyQt/PySide application.
Thanks David, although now i am busy with Kivy right now, i'm really
keen on trying that with Qt,
i've been bombarding Qt forums for ages to get that info.
>> Is there a set_type_hint or equivalent? The property you are changing
>> tells the window manager how to size the window, which you can
>> probably do other ways. The type hint "TYPE_HINT_DOCK" should
>> translate into NET_WM_WINDOW_TYPE_DOCK at some point, which tells the
>> window manager that this window is a dock, please make sure it stays
>> on top.
The TYPE_HINT_DOCK properties makes the window skip the taskbar only.
In Gtk at least the window needs to be set undecorated and space must
be reserved explicitly,
despite the 'dock' hint.
I've managed to do what i was looking for:
Once i grabbed my window i can reserve space for it like so:
window.change_property(display.intern_atom('_NET_WM_STRUT'),
display.intern_atom('CARDINAL'), 32, [0,0,100,0], X.PropModeReplace)
X.PropModeReplace is set explicitly but it is the default value. I've
adapted the Gtk recipe to Xlib blindly, although i understand most of
it, i don't really understand what the '32' us for, nor do i
understand what alternative there is to 'CARDINAL'. If you have any
info, please let me know.
Also: i am grabbing my window from the root window by finding its
title, like so:
display = Display()
root = display.screen().root
windowIDs = root.get_full_property(display.intern_atom('_NET_CLIENT_LIST'),
X.AnyPropertyType).value
for windowID in windowIDs:
window = display.create_resource_object('window', windowID)
title = window.get_wm_name()
if 'mywindowtitle' in title:
return window
I think that's not the most elegant way to do so, because two windows
could have the same title. How could i grab a window, i.e. identify
the window i want to reserve space for, by some other sort of ID,
which would be unique to the my application? I'm not sure my question
is very clearly put, sorry.
Finally: what is really the 'root' window, compared to 'display' or
'screen'? It's a bit confusing: is the root window an area of the
screen in pixels that X will use to display its window? Is 'display'
the collection of screens? (i'm just guessing from the hierarchy from
which i had to retrieve 'window' from.)
Thanks again for all your help.
Benjamin