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.
This commit is contained in:
Benjamin Otte 2011-01-31 06:43:18 +01:00
parent cfa6505504
commit 9864445b1f
3 changed files with 11 additions and 2 deletions

View File

@ -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;
}

View File

@ -840,7 +840,7 @@ struct _GdkEventOwnerChange
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkNativeWindow owner;
GdkWindow *owner;
GdkOwnerChange reason;
GdkAtom selection;
guint32 time;

View File

@ -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,