[gtk+/gdk-backend: 64/91] Get rid of the _gdk_selection_property global
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gdk-backend: 64/91] Get rid of the _gdk_selection_property global
- Date: Sat, 18 Dec 2010 01:11:12 +0000 (UTC)
commit 6f23ca7b02a0f5392017bd4f71c4340c04ea8045
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Dec 15 18:42:38 2010 -0500
Get rid of the _gdk_selection_property global
gdk/x11/gdkdisplay-x11.c | 7 ++++---
gdk/x11/gdkglobals-x11.c | 1 -
gdk/x11/gdkmain-x11.c | 2 --
gdk/x11/gdkselection-x11.c | 18 +++++++++---------
4 files changed, 13 insertions(+), 15 deletions(-)
---
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index d5cb0b6..7db72d8 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -154,7 +154,8 @@ static const char *const precache_atoms[] = {
"_NET_WM_WINDOW_TYPE",
"_NET_WM_WINDOW_TYPE_NORMAL",
"_NET_WM_USER_TIME",
- "_NET_VIRTUAL_ROOTS"
+ "_NET_VIRTUAL_ROOTS",
+ "GDK_SELECTION"
};
static char *gdk_sm_client_id;
@@ -2153,8 +2154,8 @@ gdk_x11_display_store_clipboard (GdkDisplay *display,
int i;
if (n_targets > 0)
- {
- property_name = gdk_x11_atom_to_xatom_for_display (display, _gdk_selection_property);
+ {
+ property_name = gdk_x11_get_xatom_by_name_for_display (display, "GDK_SELECTION");
xatoms = g_new (Atom, n_targets);
for (i = 0; i < n_targets; i++)
diff --git a/gdk/x11/gdkglobals-x11.c b/gdk/x11/gdkglobals-x11.c
index de61609..d9e900e 100644
--- a/gdk/x11/gdkglobals-x11.c
+++ b/gdk/x11/gdkglobals-x11.c
@@ -33,5 +33,4 @@
gboolean _gdk_use_xshm = TRUE; /* used as a cmd line arg */
-GdkAtom _gdk_selection_property;
gboolean _gdk_synchronize = FALSE;
diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c
index 42be400..2ab6276 100644
--- a/gdk/x11/gdkmain-x11.c
+++ b/gdk/x11/gdkmain-x11.c
@@ -102,8 +102,6 @@ _gdk_x11_windowing_init (void)
g_queue_init (&gdk_error_traps);
XSetErrorHandler (gdk_x_error);
XSetIOErrorHandler (gdk_x_io_error);
-
- _gdk_selection_property = gdk_atom_intern_static_string ("GDK_SELECTION");
}
GdkGrabStatus
diff --git a/gdk/x11/gdkselection-x11.c b/gdk/x11/gdkselection-x11.c
index e90f522..6ce9ee1 100644
--- a/gdk/x11/gdkselection-x11.c
+++ b/gdk/x11/gdkselection-x11.c
@@ -241,10 +241,10 @@ gdk_selection_convert (GdkWindow *requestor,
display = GDK_WINDOW_DISPLAY (requestor);
XConvertSelection (GDK_WINDOW_XDISPLAY (requestor),
- gdk_x11_atom_to_xatom_for_display (display, selection),
- gdk_x11_atom_to_xatom_for_display (display, target),
- gdk_x11_atom_to_xatom_for_display (display, _gdk_selection_property),
- GDK_WINDOW_XID (requestor), time);
+ gdk_x11_atom_to_xatom_for_display (display, selection),
+ gdk_x11_atom_to_xatom_for_display (display, target),
+ gdk_x11_get_xatom_by_name_for_display (display, "GDK_SELECTION"),
+ GDK_WINDOW_XID (requestor), time);
}
/**
@@ -297,11 +297,11 @@ gdk_selection_property_get (GdkWindow *requestor,
notified of PropertyChange events _before_ the property is deleted.
Otherwise there's no guarantee we'll win the race ... */
if (XGetWindowProperty (GDK_WINDOW_XDISPLAY (requestor),
- GDK_WINDOW_XID (requestor),
- gdk_x11_atom_to_xatom_for_display (display, _gdk_selection_property),
- 0, 0x1FFFFFFF /* MAXINT32 / 4 */, False,
- AnyPropertyType, &prop_type, &prop_format,
- &nitems, &nbytes, &t) != Success)
+ GDK_WINDOW_XID (requestor),
+ gdk_x11_get_xatom_by_name_for_display (display, "GDK_SELECTION"),
+ 0, 0x1FFFFFFF /* MAXINT32 / 4 */, False,
+ AnyPropertyType, &prop_type, &prop_format,
+ &nitems, &nbytes, &t) != Success)
goto err;
if (prop_type != None)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]