How to send a user-defined value along with x window creation api

Marty Jack martyj19 at comcast.net
Wed May 4 03:55:01 PDT 2011



On 05/04/2011 02:58 AM, prudhvi raj wrote:
> Hi,
> 
> I need to send some user-defined value (string/integer) along with the x window creation api (XCreateWindow / XCreateSimpleWindow)
> in order to differentiate the window from others and can retrieve that value inside X server to use for internal purpose.
> 
> Something like g_object_set_data() in gtk, which allows user to set an association from user-defined strings to pointers.
> 
> Is there a way already available in Xlib, like having a reserved attribute/parameter which a user can use to pass some value
> to the window creation api.
> 
> (or)
> 
> Should i add a new attribute to the XSetWindowAttributes structure which can be ignored by all the windows 
> except my special window for which i can set that attribute?
> 
> 
> 
> _______________________________________________
> xorg at lists.freedesktop.org: X.Org support
> Archives: http://lists.freedesktop.org/archives/xorg
> Info: http://lists.freedesktop.org/mailman/listinfo/xorg
> Your subscription address: martyj19 at comcast.net

The normal way people do this is either to set a property (XChangeProperty) or a selection (XSetSelectionOwner) on the window.

You could study something like the EWMH specification http://standards.freedesktop.org/wm-spec/ or the Xembed specification http://standards.freedesktop.org/xembed-spec/
to see how this could work in practice.



More information about the xorg mailing list