Deal gracefully with unowned selections

If a selection looses its owner without a replacement, owner is
None, which we did not handle very well.

https://bugzilla.gnome.org/show_bug.cgi?id=641042
This commit is contained in:
Matthias Clasen
2011-01-31 19:35:51 -05:00
parent fc43e42bf2
commit b52db73f59
3 changed files with 17 additions and 11 deletions

View File

@ -919,8 +919,11 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
event->owner_change.type = GDK_OWNER_CHANGE;
event->owner_change.window = window;
event->owner_change.owner = gdk_x11_window_foreign_new_for_display (display,
selection_notify->owner);
if (selection_notify->owner != None)
event->owner_change.owner = gdk_x11_window_foreign_new_for_display (display,
selection_notify->owner);
else
event->owner_change.owner = NULL;
event->owner_change.reason = selection_notify->subtype;
event->owner_change.selection =
gdk_x11_xatom_to_atom_for_display (display,