getting mouse cursor themes in X to change for existing windows

Jason 'vanRijn' Kasper vR at movingparts.net
Mon Mar 21 06:32:36 PST 2005


On Monday 21 March 2005 09:18, Jason 'vanRijn' Kasper wrote:
> On Monday 21 March 2005 05:40, Xavier Bestel wrote:
> > Le dimanche 20 mars 2005 à 22:05 -0500, Jason 'vanRijn' Kasper a écrit :
> > > Hi there,
> > >
> > > I would have thought this to be a FAQ, but I haven't seen it anywhere
> > > (and I've looked), so I'll ask it here.
> > >
> > > Is it technically possible to change the mouse cursor theme for an
> > > existing window (without having to restart X or for the change to only
> > > take effect for new windows)?
> >
> > This is a job for the toolkits (e.g. GTK+). When the user changes theme,
> > the toolkit should update each client's colors, cursors, etc.
>
> Mmmm.  I'm not sure I understand.  It appears that this is
> toolkit-agnostic, since I might not be running any higher-than-Xlib toolkit
> (i.e. I'm running blackbox and have 3 xterms open, for instance).  What
> exactly needs to happen to get an application to change the cursor theme
> used within it?  Is this a window manager function?  What would make this
> change possible, exactly?  I mean, if $XCURSOR_THEME or Xcursor.theme were
> to be changed on the fly in a running application, would unmapping/mapping
> a client window make the change take effect?  Or are these things only
> looked at by X when the window is first _created_?

Actually, it looks to be the case that the mouse cursor is only given the 
opportunity of being created once, and it's cached after that.  In other 
words, if I bring up an xterm with XCURSOR_THEME set to Grounation, X will 
know to use the Grounation "xterm" cursor.  If I change XCURSOR_THEME to 
crystalblue, X will not change the xterm cursor to the crystalblue one.  
However, if I run xprop on the xterm after having changed XCURSOR_THEME, 
xprop will ask X for the "cross" cursor and it will be gotten from the 
crystalblue cursor theme, not the Grounation cursor theme that was in effect 
when the xterm was created.

Does this sound right?

What can be done to fix this?

TIA.

-- 

,-----------------------------------------------------------------//
| Jason 'vanRijn' Kasper ::  Numbers 6:22-26 
 `
 | All brontosauruses are thin at one end, much MUCH thicker 
 | in the middle, and then thin again at the far end.  That is 
 | the theory that I have and which is mine, and what it is too.  
 ,
| bash$ :(){ :|:&};:
`----------------------//



More information about the xorg mailing list