Questions !

Joel Feiner jafeiner at gmail.com
Mon Nov 24 07:12:12 PST 2008



My Own Linux wrote:
> 1. I want to look at the source of the function XCreateSimpleWindow(). I 
> extracted the xserver sources and greped it - but I could not find it 
> Where are the sources of Xlib function calls located ?
> 
They are located in libX11, which is what you want to be looking at 
instead of the X Server.  I doubt you'll find anything interesting in 
the Xlib sources since the role of the function in Xlib is simply to 
send a request to the X server.  Also, XCreateSimpleWindow() is not a 
true function.  It maps to XCreateWindow() which has more options and 
does the actual work.  I don't know if XCreateSimpleWindow() is a macro 
or not, you can check yourself.

> 2. When I create a window using XCreateSimpleWindow() function - the 
> window has the decoration of the Ubuntu desktop that I am using. I was 
> informed that window manager captures it and re-parents the current 
> window to a new window with the title bar as one window and the current 
> window as another.
> 
> So how that happen ? How does the window manager know that I have 
> created a window using the raw X command ?  (maybe I assume a event is 
> sent) . I just want to confirm !
> 
When the window manager starts, it sets the SubstructureRedirectMask 
even mask on the root window, which makes the X server redirect 
configuration requests (creating windows, mapping windows, changing the 
order of windows, etc.) on the root window be sent to the window manager 
before processing.  The window manager can then take special action, 
such as creating a frame window and reparenting the client's window into 
that frame.  You can read more about it here: 
http://wwweic.eri.u-tokyo.ac.jp/computer/manual/lx/SGI_Developer/books/XLib_PG/sgi_html/ch16.html

> 3. There are two structures : Display, Screen. How does the window 
> manager implement the Virtual Desktops ? Is there any other structure 
> like a VirtualScreen, Viewport ??
> 
Some window managers seem to take a hide and show approach to virtual 
desktops.  Any windows not on the current virtual desktops are hidden 
and when you switch virtual desktops, it hides the windows from the 
current virtual desktop and shows the windows from the new virtual 
desktop.  This is how KWin appears to do it.  Others seem to have a 
large containing window that contains all the top level windows and it 
slides around which portion of this window contains the current virtual 
desktop.

> 4. What is the actual role of X server ?
> 
> Most of the work is done by window manager and other libraries.
> 
> What I have been able to gather is :
> 
> - It creates and manages windows
> - Handles the input events
> - Informs when the window needs to be redrawn.
> 
> Am I right or I left something.
> 
It performs drawing operations and manages initialization of hardware 
and interfacing with the same.

> Most of the documentation on the net is old and has no information about 
> current releases.  I am trying to understand the X server - so the many 
> questions that I could not find answers anywhere.
> 
> 
> ------------
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> xorg mailing list
> xorg at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xorg



More information about the xorg mailing list