Bug 544684 - Win64 issue, window handles are assumed to be 32-bit

2008-08-05  Tor Lillqvist  <tml@novell.com>

	Bug 544684 - Win64 issue, window handles are assumed to be 32-bit

	* gdk/gdkselection.h
	* gdk/gdkselection.c
	* gdk/win32/gdkselection-win32.c
	* gdk/x11/gdkselection-x11.c: Change type of the requestor
	window id parameter of gdk_selection_send_notify_for_display()
	and gdk_selection_send_notify() from guint32 to
	GdkNativeWindow.

	* gdk/win32/gdkselection-win32.c: Add some guchar and char pointer
	casts to get rid of gcc 4.4 warnings. Print GdkAtom values in
	debugging output using the %p format.


svn path=/trunk/; revision=20991
This commit is contained in:
Tor Lillqvist
2008-08-04 22:43:57 +00:00
committed by Tor Lillqvist
parent 7919814bf6
commit f4d9ce22f4
5 changed files with 55 additions and 44 deletions

View File

@ -18,6 +18,17 @@
platforms, as GdkNativeWindow has been guint32 for them platforms, as GdkNativeWindow has been guint32 for them
already. already.
* gdk/gdkselection.h
* gdk/gdkselection.c
* gdk/win32/gdkselection-win32.c
* gdk/x11/gdkselection-x11.c: Ditto for the requestor window id
parameter of gdk_selection_send_notify_for_display() and
gdk_selection_send_notify().
* gdk/win32/gdkselection-win32.c: Add some guchar and char pointer
casts to get rid of gcc 4.4 warnings. Print GdkAtom values in
debugging output using the %p format.
2008-08-05 Tor Lillqvist <tml@novell.com> 2008-08-05 Tor Lillqvist <tml@novell.com>
* gdk/gdkrgb.c: Cast pointers to guintptr, not unsigned long, * gdk/gdkrgb.c: Cast pointers to guintptr, not unsigned long,

View File

@ -49,11 +49,11 @@ gdk_selection_owner_get (GdkAtom selection)
} }
void void
gdk_selection_send_notify (guint32 requestor, gdk_selection_send_notify (GdkNativeWindow requestor,
GdkAtom selection, GdkAtom selection,
GdkAtom target, GdkAtom target,
GdkAtom property, GdkAtom property,
guint32 time) guint32 time)
{ {
gdk_selection_send_notify_for_display (gdk_display_get_default (), gdk_selection_send_notify_for_display (gdk_display_get_default (),
requestor, selection, requestor, selection,

View File

@ -92,19 +92,19 @@ gboolean gdk_selection_property_get (GdkWindow *requestor,
gint *prop_format); gint *prop_format);
#ifndef GDK_MULTIHEAD_SAFE #ifndef GDK_MULTIHEAD_SAFE
void gdk_selection_send_notify (guint32 requestor, void gdk_selection_send_notify (GdkNativeWindow requestor,
GdkAtom selection, GdkAtom selection,
GdkAtom target, GdkAtom target,
GdkAtom property, GdkAtom property,
guint32 time_); guint32 time_);
#endif /* GDK_MULTIHEAD_SAFE */ #endif /* GDK_MULTIHEAD_SAFE */
void gdk_selection_send_notify_for_display (GdkDisplay *display, void gdk_selection_send_notify_for_display (GdkDisplay *display,
guint32 requestor, GdkNativeWindow requestor,
GdkAtom selection, GdkAtom selection,
GdkAtom target, GdkAtom target,
GdkAtom property, GdkAtom property,
guint32 time_); guint32 time_);
G_END_DECLS G_END_DECLS

View File

@ -144,7 +144,7 @@ _gdk_selection_property_store (GdkWindow *owner,
if (type == GDK_TARGET_STRING) if (type == GDK_TARGET_STRING)
{ {
/* We know that data is UTF-8 */ /* We know that data is UTF-8 */
prop->data = _gdk_utf8_to_string_target_internal (data, length); prop->data = (guchar *) _gdk_utf8_to_string_target_internal ((char*) data, length);
g_free (data); g_free (data);
if (!prop->data) if (!prop->data)
@ -154,7 +154,7 @@ _gdk_selection_property_store (GdkWindow *owner,
return; return;
} }
else else
prop->length = strlen (prop->data) + 1; prop->length = strlen ((char*) prop->data) + 1;
} }
else else
{ {
@ -176,7 +176,7 @@ _gdk_dropfiles_store (gchar *data)
g_assert (dropfiles_prop == NULL); g_assert (dropfiles_prop == NULL);
dropfiles_prop = g_new (GdkSelProp, 1); dropfiles_prop = g_new (GdkSelProp, 1);
dropfiles_prop->data = data; dropfiles_prop->data = (guchar *) data;
dropfiles_prop->length = strlen (data) + 1; dropfiles_prop->length = strlen (data) + 1;
dropfiles_prop->format = 8; dropfiles_prop->format = 8;
dropfiles_prop->type = _text_uri_list; dropfiles_prop->type = _text_uri_list;
@ -211,9 +211,9 @@ gdk_selection_owner_set_for_display (GdkDisplay *display,
GDK_NOTE (DND, GDK_NOTE (DND,
(sel_name = gdk_atom_name (selection), (sel_name = gdk_atom_name (selection),
g_print ("gdk_selection_owner_set_for_display: %p %#x (%s)\n", g_print ("gdk_selection_owner_set_for_display: %p %p (%s)\n",
(owner ? GDK_WINDOW_HWND (owner) : NULL), (owner ? GDK_WINDOW_HWND (owner) : NULL),
(guint) selection, sel_name), selection, sel_name),
g_free (sel_name))); g_free (sel_name)));
} }
#endif #endif
@ -267,7 +267,7 @@ gdk_selection_owner_set_for_display (GdkDisplay *display,
tmp_event.selection.selection = selection; tmp_event.selection.selection = selection;
tmp_event.selection.target = _utf8_string; tmp_event.selection.target = _utf8_string;
tmp_event.selection.property = _gdk_selection_property; tmp_event.selection.property = _gdk_selection_property;
tmp_event.selection.requestor = (guint32) hwnd; tmp_event.selection.requestor = hwnd;
tmp_event.selection.time = time; tmp_event.selection.time = time;
gdk_event_put (&tmp_event); gdk_event_put (&tmp_event);
@ -303,8 +303,8 @@ gdk_selection_owner_get_for_display (GdkDisplay *display,
GDK_NOTE (DND, GDK_NOTE (DND,
(sel_name = gdk_atom_name (selection), (sel_name = gdk_atom_name (selection),
g_print ("gdk_selection_owner_get: %#x (%s) = %p\n", g_print ("gdk_selection_owner_get: %p (%s) = %p\n",
(guint) selection, sel_name, selection, sel_name,
(window ? GDK_WINDOW_HWND (window) : NULL)), (window ? GDK_WINDOW_HWND (window) : NULL)),
g_free (sel_name))); g_free (sel_name)));
} }
@ -356,10 +356,10 @@ gdk_selection_convert (GdkWindow *requestor,
GDK_NOTE (DND, GDK_NOTE (DND,
(sel_name = gdk_atom_name (selection), (sel_name = gdk_atom_name (selection),
tgt_name = gdk_atom_name (target), tgt_name = gdk_atom_name (target),
g_print ("gdk_selection_convert: %p %#x (%s) %#x (%s)\n", g_print ("gdk_selection_convert: %p %p (%s) %p (%s)\n",
GDK_WINDOW_HWND (requestor), GDK_WINDOW_HWND (requestor),
(guint) selection, sel_name, selection, sel_name,
(guint) target, tgt_name), target, tgt_name),
g_free (sel_name), g_free (sel_name),
g_free (tgt_name))); g_free (tgt_name)));
} }
@ -750,12 +750,12 @@ _gdk_selection_property_delete (GdkWindow *window)
} }
void void
gdk_selection_send_notify_for_display (GdkDisplay *display, gdk_selection_send_notify_for_display (GdkDisplay *display,
guint32 requestor, GdkNativeWindow requestor,
GdkAtom selection, GdkAtom selection,
GdkAtom target, GdkAtom target,
GdkAtom property, GdkAtom property,
guint32 time) guint32 time)
{ {
g_return_if_fail (display == _gdk_display); g_return_if_fail (display == _gdk_display);
@ -767,11 +767,11 @@ gdk_selection_send_notify_for_display (GdkDisplay *display,
(sel_name = gdk_atom_name (selection), (sel_name = gdk_atom_name (selection),
tgt_name = gdk_atom_name (target), tgt_name = gdk_atom_name (target),
prop_name = gdk_atom_name (property), prop_name = gdk_atom_name (property),
g_print ("gdk_selection_send_notify_for_display: %p %#x (%s) %#x (%s) %#x (%s)\n", g_print ("gdk_selection_send_notify_for_display: %p %p (%s) %p (%s) %p (%s)\n",
(gpointer) requestor, requestor,
(guint) selection, sel_name, selection, sel_name,
(guint) target, tgt_name, target, tgt_name,
(guint) property, prop_name), property, prop_name),
g_free (sel_name), g_free (sel_name),
g_free (tgt_name), g_free (tgt_name),
g_free (prop_name))); g_free (prop_name)));

View File

@ -387,12 +387,12 @@ gdk_selection_property_get (GdkWindow *requestor,
* Since: 2.2 * Since: 2.2
**/ **/
void void
gdk_selection_send_notify_for_display (GdkDisplay *display, gdk_selection_send_notify_for_display (GdkDisplay *display,
guint32 requestor, GdkNativeWindow requestor,
GdkAtom selection, GdkAtom selection,
GdkAtom target, GdkAtom target,
GdkAtom property, GdkAtom property,
guint32 time) guint32 time)
{ {
XSelectionEvent xevent; XSelectionEvent xevent;