forked from AuroraMiddleware/gtk
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:
parent
ab13c8803d
commit
51f1c2a73c
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -381,27 +381,45 @@ gdk_property_get (GdkWindow *window,
|
|||||||
|
|
||||||
if (data)
|
if (data)
|
||||||
{
|
{
|
||||||
switch (ret_format)
|
if (ret_prop_type == XA_ATOM)
|
||||||
{
|
{
|
||||||
case 8:
|
/*
|
||||||
ret_length = ret_nitems;
|
* data is an array of X atom, we need to convert it
|
||||||
break;
|
* to an array of GDK Atoms
|
||||||
case 16:
|
*/
|
||||||
ret_length = sizeof(short) * ret_nitems;
|
gint i;
|
||||||
break;
|
GdkAtom *ret_atoms = g_new (GdkAtom *, ret_nitems);
|
||||||
case 32:
|
Atom *xatoms = (Atom *)ret_data;
|
||||||
ret_length = sizeof(long) * ret_nitems;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
g_warning ("unknown property return format: %d", ret_format);
|
|
||||||
XFree (ret_data);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
*data = g_new (guchar, ret_length);
|
data = (guchar *)ret_atoms;
|
||||||
memcpy (*data, ret_data, ret_length);
|
|
||||||
if (actual_length)
|
for (i = 0; i < ret_nitems; i++)
|
||||||
*actual_length = ret_length;
|
ret_atoms[i] = gdk_x11_xatom_to_atom (xatoms[i]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch (ret_format)
|
||||||
|
{
|
||||||
|
case 8:
|
||||||
|
ret_length = ret_nitems;
|
||||||
|
break;
|
||||||
|
case 16:
|
||||||
|
ret_length = sizeof(short) * ret_nitems;
|
||||||
|
break;
|
||||||
|
case 32:
|
||||||
|
ret_length = sizeof(long) * ret_nitems;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
g_warning ("unknown property return format: %d", ret_format);
|
||||||
|
XFree (ret_data);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
*data = g_new (guchar, ret_length);
|
||||||
|
memcpy (*data, ret_data, ret_length);
|
||||||
|
if (actual_length)
|
||||||
|
*actual_length = ret_length;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
XFree (ret_data);
|
XFree (ret_data);
|
||||||
@ -442,8 +460,27 @@ gdk_property_change (GdkWindow *window,
|
|||||||
xwindow = _gdk_root_window;
|
xwindow = _gdk_root_window;
|
||||||
}
|
}
|
||||||
|
|
||||||
XChangeProperty (xdisplay, xwindow, xproperty, xtype,
|
if (xtype == XA_ATOM)
|
||||||
format, mode, (guchar *)data, nelements);
|
{
|
||||||
|
/*
|
||||||
|
* 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,
|
||||||
|
format, mode, (guchar *)data, nelements);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user