libgtk2/libgtk-2.16.4-gdk_x11_atom_to_xatom_for_display_tra.patch

62 lines
2.2 KiB
Diff

From dbe4cf21970ec47ad56ab41b8ca1081f35b04130 Mon Sep 17 00:00:00 2001
From: Martin Nordholts <martinn@src.gnome.org>
Date: Fri, 22 May 2009 21:57:14 +0200
Subject: [PATCH] =?utf-8?q?Bug=20580511=20=E2=80=93=20gdk=5Fx11=5Fatom=5Fto=5Fxatom=5Ffor=5Fdisplay=20translates=20GDK=5FNONE=20as?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Allow None <=> GDK_NONE conversions and remove special casing. If we
don't allow these conversions we need to add special casing to more
places so it's better to just allow the conversions.
---
gdk/x11/gdkproperty-x11.c | 8 ++++++--
gdk/x11/gdkselection-x11.c | 5 +----
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/gdk/x11/gdkproperty-x11.c b/gdk/x11/gdkproperty-x11.c
index 116f47d..fff30f9 100644
--- a/gdk/x11/gdkproperty-x11.c
+++ b/gdk/x11/gdkproperty-x11.c
@@ -189,7 +189,9 @@ gdk_x11_atom_to_xatom_for_display (GdkDisplay *display,
Atom xatom = None;
g_return_val_if_fail (GDK_IS_DISPLAY (display), None);
- g_return_val_if_fail (atom != GDK_NONE, None);
+
+ if (atom == GDK_NONE)
+ return None;
if (display->closed)
return None;
@@ -293,7 +295,9 @@ gdk_x11_xatom_to_atom_for_display (GdkDisplay *display,
GdkAtom virtual_atom = GDK_NONE;
g_return_val_if_fail (GDK_IS_DISPLAY (display), GDK_NONE);
- g_return_val_if_fail (xatom != None, GDK_NONE);
+
+ if (xatom == None)
+ return GDK_NONE;
if (display->closed)
return GDK_NONE;
diff --git a/gdk/x11/gdkselection-x11.c b/gdk/x11/gdkselection-x11.c
index 6045dad..fd482e2 100644
--- a/gdk/x11/gdkselection-x11.c
+++ b/gdk/x11/gdkselection-x11.c
@@ -404,10 +404,7 @@ gdk_selection_send_notify_for_display (GdkDisplay *display,
xevent.requestor = requestor;
xevent.selection = gdk_x11_atom_to_xatom_for_display (display, selection);
xevent.target = gdk_x11_atom_to_xatom_for_display (display, target);
- if (property == GDK_NONE)
- xevent.property = None;
- else
- xevent.property = gdk_x11_atom_to_xatom_for_display (display, property);
+ xevent.property = gdk_x11_atom_to_xatom_for_display (display, property);
xevent.time = time;
_gdk_send_xevent (display, requestor, False, NoEventMask, (XEvent*) & xevent);
--
1.6.0.6