[patch] Forward scroll and unused button events to the window manager

Brian J. Tarricone bjt23 at cornell.edu
Mon Sep 27 00:54:03 CEST 2004

Nils Rennebarth wrote:

> Brian J. Tarricone wrote:
>> patch committed, with a few style changes and a fix for multihead 
>> setups.  thanks!
> I knew I missed something. Is there a explanation somewhere of what is 
> different with multihead and what to watch for? And btw, is there 
> somewhere an explanation of the X concepts like display, screen, etc.?

the gdk API documentation has some (somewhat cryptic) info about 
multihead.  the basic thing to remember is that you can _never_ use 
gdk_display_get_default_screen().  you also can't use things like 
gdk_colormap_get_system().  you have to have a copy of the GdkScreen 
that applies to your context, and you have to use the gdk_screen_get_*() 
functions.  for xfce's purpose, we have one instance of a particular app 
per display, so you _can_ use GDK_DISPLAY() and 
gdk_display_get_default().  having one instance handling multiple 
displays is a lot more complicated, and IMHO unnecessary for a DE.

if you're doing screen-related stuff, it's a lot easier to use the gdk 
functions, as they abstract xinerama and non-xinerama, whereas Xlib 
doesn't.  if you want, take a look at 
xfce4/xfdesktop/src/xfce-desktop.c.  xfce_desktop_new() and a lot of the 
backdrop handling code is very sensitive to multiheadedness, so i think 
it's a fairly good example (with the exception that it should probably 
be better-commented).


More information about the Xfce4-dev mailing list