After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 566884 - a patch to add support for gdk_x11_atom_to_xatom_for_display
a patch to add support for gdk_x11_atom_to_xatom_for_display
Status: RESOLVED FIXED
Product: gnome-perl
Classification: Bindings
Component: Gtk2
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk2-perl-bugs
gtk2-perl-bugs
Depends on:
Blocks:
 
 
Reported: 2009-01-07 10:50 UTC by chris
Modified: 2009-01-20 20:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch adding X11 xatom support to the Gtk2::Gdk::Atom package (1.18 KB, patch)
2009-01-08 09:36 UTC, chris
none Details | Review
patch adding X11 xatom support to the Gtk2::Gdk::Atom package (1.12 KB, patch)
2009-01-08 09:37 UTC, chris
none Details | Review
patch to add support for gdk_x11_atom_to_xatom (2.88 KB, patch)
2009-01-08 11:03 UTC, chris
committed Details | Review

Description chris 2009-01-07 10:50:53 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.
Comment 1 chris 2009-01-07 10:52:09 UTC
patches coming in a short while.
Comment 2 chris 2009-01-08 09:36:32 UTC
Created attachment 126015 [details] [review]
patch adding X11 xatom support to the Gtk2::Gdk::Atom package
Comment 3 chris 2009-01-08 09:37:45 UTC
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 4 chris 2009-01-08 10:15:44 UTC
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
Comment 5 chris 2009-01-08 10:17:25 UTC
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.

Comment 6 chris 2009-01-08 11:03:43 UTC
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.
Comment 7 Torsten Schoenfeld 2009-01-20 20:26:51 UTC
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.