GNOME Bugzilla – Bug 566884
a patch to add support for gdk_x11_atom_to_xatom_for_display
Last modified: 2009-01-20 20:26:51 UTC
Hi, I've done a patch to add support for gdk_x11_atom_to_xatom_for_display and gdk_x11_atom_to_xatom These functions return the X11 atom (a number) corresponding to a GdkAtom. The X11 atom number is required to implement (for example) ICCCM compliant behaviour (some X11 client-message events need to include the X11 atom number in the Gtk2::Gdk::Event::Client.data field). In particular I need it to broadcast ownership of a selection by sending a MANAGER client-message, so that I can implement the freedesktop systray spec. If I can figure out how to attach a patch, I will attach two. - the first adds support into the Gtk2::Gdk::Atom class. The type of the atom number is declared as UV (the same as the current behaviour for XID and XWINDOW). Also the method is aliased to XATOM just like Gtk2::Gdk::Window->XWINDOW. - the second patch instead just adds support into the Gtk2::Gdk::X11 package, which keeps the X11 specific stuff out of Gtk2::Gdk::Atom (just in case that is preferred). - the idea being that one or the other would be used. My guess is the first patch is better since it has a more intuitive usage and is inline with the current behaviour of XWINDOW and XID.
patches coming in a short while.
Created attachment 126015 [details] [review] patch adding X11 xatom support to the Gtk2::Gdk::Atom package
Created attachment 126016 [details] [review] patch adding X11 xatom support to the Gtk2::Gdk::Atom package this patch is a possible alternative to the first patch
Comment on attachment 126016 [details] [review] patch adding X11 xatom support to the Gtk2::Gdk::Atom package dont use this patch. I've already discovered a problem
oops. oops. don't use the initial patches in comments 2-3. while while updating the .t test file I've realised one of the new methods won't work. I need to reorder the params in one of the methods. So I've got to look into this XS stuff a bit more.
Created attachment 126021 [details] [review] patch to add support for gdk_x11_atom_to_xatom OK please ignore the above patches. Instead here is a single patch which includes the updated xs file and an updated test file.
Thanks for the patch! I slightly altered it, mainly to remove the XATOM alias. to_xatom() is a converter, not an accessor, so I think we should keep the "to" part. Otherwise it looked fine to me, so I committed it.