From 9864445b1f9a320318ef59f14beb907b925f747a Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 31 Jan 2011 06:43:18 +0100 Subject: API: gdk: Change GdkEventOwnerChange to not take GdkNativeWindow Use GdkWindow instead. This requires calling gdk_x11_window_foreign_new_for_display(), so might cause a slight performance penalty, but is required to be portable. --- gdk/gdkevents.c | 8 ++++++++ gdk/gdkevents.h | 2 +- gdk/x11/gdkdisplay-x11.c | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c index 21c57d56fa..66a14ec924 100644 --- a/gdk/gdkevents.c +++ b/gdk/gdkevents.c @@ -567,6 +567,10 @@ gdk_event_copy (const GdkEvent *event) sizeof (gdouble) * gdk_device_get_n_axes (event->motion.device)); break; + case GDK_OWNER_CHANGE: + new_event->owner_change.owner = g_object_ref (event->owner_change.owner); + break; + default: break; } @@ -636,6 +640,10 @@ gdk_event_free (GdkEvent *event) g_free (event->setting.name); break; + case GDK_OWNER_CHANGE: + g_object_unref (event->owner_change.owner); + break; + default: break; } diff --git a/gdk/gdkevents.h b/gdk/gdkevents.h index 4786b2f3b7..4902601e3c 100644 --- a/gdk/gdkevents.h +++ b/gdk/gdkevents.h @@ -840,7 +840,7 @@ struct _GdkEventOwnerChange GdkEventType type; GdkWindow *window; gint8 send_event; - GdkNativeWindow owner; + GdkWindow *owner; GdkOwnerChange reason; GdkAtom selection; guint32 time; diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c index ff74830fbc..20735ccf6f 100644 --- a/gdk/x11/gdkdisplay-x11.c +++ b/gdk/x11/gdkdisplay-x11.c @@ -919,7 +919,8 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, event->owner_change.type = GDK_OWNER_CHANGE; event->owner_change.window = window; - event->owner_change.owner = selection_notify->owner; + event->owner_change.owner = gdk_x11_window_foreign_new_for_display (display, + selection_notify->owner); event->owner_change.reason = selection_notify->subtype; event->owner_change.selection = gdk_x11_xatom_to_atom_for_display (display, -- cgit v1.2.1