[comp.windows.x] Finding Cursor associat. with a Window

Francois.Bitz@SAM.CS.CMU.EDU (02/27/89)

I having a hard time figuring why it is not possible to
get the Cursor id with GetWindowAttributes() when it is possible
to set the cursor with SetWindowAttributes(); it seems to me
that the structures associated with each call are not completely
consistent between each other.

I need to find out what the cursor is for a  window in order
to restore it to its value later since I want to change the cursor
temporarily with XdefineCursor().

I also tried to use XGetWindowProperty() without success. 

Any hope ?

stroyan@hpfcdc.HP.COM (Mike Stroyan) (03/03/89)

> I need to find out what the cursor is for a  window in order
> to restore it to its value later since I want to change the cursor
> temporarily with XdefineCursor().

> Any hope ?

Not much.  The normal protocol does not provide a way to inquire the
current cursor of a window.  At HP we ended up adding a server extension
to inquire the data.  That helps our graphics libraries when run on our
servers, but won't do for a portable application.

One possibility is to create an InputOnly child window that covers the
window for which you want to change the cursor.  You can then specify
the cursor for the new window.  When you want to return to the old
cursor, you destroy the child window.  There may be some trouble if the
child window has to adapt to parent window resizes or fight with its
sibling windows to stay on top.

Mike Stroyan, stroyan@hpfcla.hp.com