[gtk+] x11: Handle obsolete selection requests without crashing
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] x11: Handle obsolete selection requests without crashing
- Date: Sun, 25 Jan 2015 00:53:29 +0000 (UTC)
commit 5fc8cf43317b1eef865fddefd69093b30a544976
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Jan 24 19:31:11 2015 -0500
x11: Handle obsolete selection requests without crashing
The ICCCM says:
If the specified property is None, the requestor is an obsolete client.
Owners are encouraged to support these clients by using the specified
target atom as the property name to be used for the reply.
Lets do that, instead of crashing.
https://bugzilla.gnome.org/show_bug.cgi?id=740613
The previous fix for this issue in 732af31424b8f382d was incomplete.
gdk/x11/gdkdisplay-x11.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index e658780..1477a75 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -919,7 +919,10 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
event->selection.window = window;
event->selection.selection = gdk_x11_xatom_to_atom_for_display (display,
xevent->xselectionrequest.selection);
event->selection.target = gdk_x11_xatom_to_atom_for_display (display,
xevent->xselectionrequest.target);
- event->selection.property = gdk_x11_xatom_to_atom_for_display (display,
xevent->xselectionrequest.property);
+ if (xevent->xselectionrequest.property == None)
+ event->selection.property = event->selection.target;
+ else
+ event->selection.property = gdk_x11_xatom_to_atom_for_display (display,
xevent->xselectionrequest.property);
if (xevent->xselectionrequest.requestor != None)
event->selection.requestor = gdk_x11_window_foreign_new_for_display (display,
xevent->xselectionrequest.requestor);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]