Convert atoms to and from atoms for properties of type XA_ATOM. (#65555,

Wed Nov 28 19:34:15 2001  Owen Taylor  <otaylor@redhat.com>
	* gdk/x11/gdkproperty-x11.c (gdk_property_change, gdk_property_get):
	Convert atoms to and from atoms for properties of type XA_ATOM.
	(#65555, patch from Hidetoshi Tajima)
This commit is contained in:
Owen Taylor 2001-11-29 00:43:24 +00:00 committed by Owen Taylor
parent ab13c8803d
commit 51f1c2a73c
8 changed files with 100 additions and 21 deletions

View File

@ -1,3 +1,9 @@
Wed Nov 28 19:34:15 2001 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkproperty-x11.c (gdk_property_change, gdk_property_get):
Convert atoms to and from atoms for properties of type XA_ATOM.
(#65555, patch from Hidetoshi Tajima)
Wed Nov 28 18:37:04 2001 Owen Taylor <otaylor@redhat.com> Wed Nov 28 18:37:04 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtksocket.[ch] (gtk_socket_add_id): Rename 'id' parameter * gtk/gtksocket.[ch] (gtk_socket_add_id): Rename 'id' parameter

View File

@ -1,3 +1,9 @@
Wed Nov 28 19:34:15 2001 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkproperty-x11.c (gdk_property_change, gdk_property_get):
Convert atoms to and from atoms for properties of type XA_ATOM.
(#65555, patch from Hidetoshi Tajima)
Wed Nov 28 18:37:04 2001 Owen Taylor <otaylor@redhat.com> Wed Nov 28 18:37:04 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtksocket.[ch] (gtk_socket_add_id): Rename 'id' parameter * gtk/gtksocket.[ch] (gtk_socket_add_id): Rename 'id' parameter

View File

@ -1,3 +1,9 @@
Wed Nov 28 19:34:15 2001 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkproperty-x11.c (gdk_property_change, gdk_property_get):
Convert atoms to and from atoms for properties of type XA_ATOM.
(#65555, patch from Hidetoshi Tajima)
Wed Nov 28 18:37:04 2001 Owen Taylor <otaylor@redhat.com> Wed Nov 28 18:37:04 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtksocket.[ch] (gtk_socket_add_id): Rename 'id' parameter * gtk/gtksocket.[ch] (gtk_socket_add_id): Rename 'id' parameter

View File

@ -1,3 +1,9 @@
Wed Nov 28 19:34:15 2001 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkproperty-x11.c (gdk_property_change, gdk_property_get):
Convert atoms to and from atoms for properties of type XA_ATOM.
(#65555, patch from Hidetoshi Tajima)
Wed Nov 28 18:37:04 2001 Owen Taylor <otaylor@redhat.com> Wed Nov 28 18:37:04 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtksocket.[ch] (gtk_socket_add_id): Rename 'id' parameter * gtk/gtksocket.[ch] (gtk_socket_add_id): Rename 'id' parameter

View File

@ -1,3 +1,9 @@
Wed Nov 28 19:34:15 2001 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkproperty-x11.c (gdk_property_change, gdk_property_get):
Convert atoms to and from atoms for properties of type XA_ATOM.
(#65555, patch from Hidetoshi Tajima)
Wed Nov 28 18:37:04 2001 Owen Taylor <otaylor@redhat.com> Wed Nov 28 18:37:04 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtksocket.[ch] (gtk_socket_add_id): Rename 'id' parameter * gtk/gtksocket.[ch] (gtk_socket_add_id): Rename 'id' parameter

View File

@ -1,3 +1,9 @@
Wed Nov 28 19:34:15 2001 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkproperty-x11.c (gdk_property_change, gdk_property_get):
Convert atoms to and from atoms for properties of type XA_ATOM.
(#65555, patch from Hidetoshi Tajima)
Wed Nov 28 18:37:04 2001 Owen Taylor <otaylor@redhat.com> Wed Nov 28 18:37:04 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtksocket.[ch] (gtk_socket_add_id): Rename 'id' parameter * gtk/gtksocket.[ch] (gtk_socket_add_id): Rename 'id' parameter

View File

@ -1,3 +1,9 @@
Wed Nov 28 19:34:15 2001 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkproperty-x11.c (gdk_property_change, gdk_property_get):
Convert atoms to and from atoms for properties of type XA_ATOM.
(#65555, patch from Hidetoshi Tajima)
Wed Nov 28 18:37:04 2001 Owen Taylor <otaylor@redhat.com> Wed Nov 28 18:37:04 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtksocket.[ch] (gtk_socket_add_id): Rename 'id' parameter * gtk/gtksocket.[ch] (gtk_socket_add_id): Rename 'id' parameter

View File

@ -380,6 +380,23 @@ gdk_property_get (GdkWindow *window,
/* FIXME: ignoring bytes_after could have very bad effects */ /* FIXME: ignoring bytes_after could have very bad effects */
if (data) if (data)
{
if (ret_prop_type == XA_ATOM)
{
/*
* data is an array of X atom, we need to convert it
* to an array of GDK Atoms
*/
gint i;
GdkAtom *ret_atoms = g_new (GdkAtom *, ret_nitems);
Atom *xatoms = (Atom *)ret_data;
data = (guchar *)ret_atoms;
for (i = 0; i < ret_nitems; i++)
ret_atoms[i] = gdk_x11_xatom_to_atom (xatoms[i]);
}
else
{ {
switch (ret_format) switch (ret_format)
{ {
@ -403,6 +420,7 @@ gdk_property_get (GdkWindow *window,
if (actual_length) if (actual_length)
*actual_length = ret_length; *actual_length = ret_length;
} }
}
XFree (ret_data); XFree (ret_data);
@ -442,6 +460,25 @@ gdk_property_change (GdkWindow *window,
xwindow = _gdk_root_window; xwindow = _gdk_root_window;
} }
if (xtype == XA_ATOM)
{
/*
* data is an array of GdkAtom, we need to convert it
* to an array of X Atoms
*/
gint i;
GdkAtom *atoms = (GdkAtom*) data;
Atom *xatoms;
xatoms = g_new (Atom, nelements);
for (i = 0; i < nelements; i++)
xatoms[i] = gdk_x11_atom_to_xatom (atoms[i]);
XChangeProperty (xdisplay, xwindow, xproperty, xtype,
format, mode, (guchar *)xatoms, nelements);
g_free (xatoms);
}
else
XChangeProperty (xdisplay, xwindow, xproperty, xtype, XChangeProperty (xdisplay, xwindow, xproperty, xtype,
format, mode, (guchar *)data, nelements); format, mode, (guchar *)data, nelements);
} }