summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2017-12-14 13:02:50 +0100
committerBenjamin Otte <otte@redhat.com>2017-12-14 13:35:32 +0100
commit920259c25070986b13675fd86f3def1b805dc00d (patch)
tree7bf7398788e69f87a541f49c2655b2e778984892 /gdk
parent52b1a465496be8bf763bbf6a1945ec769be653b5 (diff)
downloadgtk+-920259c25070986b13675fd86f3def1b805dc00d.tar.gz
x11: Get rid of default Atom converters
No, using the default Wayland display is not okay to query Atoms.
Diffstat (limited to 'gdk')
-rw-r--r--gdk/x11/gdkdevicemanager-xi2.c2
-rw-r--r--gdk/x11/gdkproperty-x11.c66
-rw-r--r--gdk/x11/gdkx11property.h8
3 files changed, 1 insertions, 75 deletions
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index 676ed976ea..e6908debb1 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -990,7 +990,7 @@ handle_property_change (GdkX11DeviceManagerXI2 *device_manager,
device = g_hash_table_lookup (device_manager->id_table,
GUINT_TO_POINTER (ev->deviceid));
- if (ev->property == gdk_x11_get_xatom_by_name ("Wacom Serial IDs"))
+ if (ev->property == gdk_x11_get_xatom_by_name_for_display (gdk_device_get_display (device), "Wacom Serial IDs"))
{
GdkDeviceTool *tool = NULL;
guint serial_id = 0, tool_id = 0;
diff --git a/gdk/x11/gdkproperty-x11.c b/gdk/x11/gdkproperty-x11.c
index dc3ca81ead..be26586a92 100644
--- a/gdk/x11/gdkproperty-x11.c
+++ b/gdk/x11/gdkproperty-x11.c
@@ -145,21 +145,6 @@ _gdk_x11_precache_atoms (GdkDisplay *display,
}
/**
- * gdk_x11_atom_to_xatom:
- * @atom: A #GdkAtom
- *
- * Converts from a #GdkAtom to the X atom for the default GDK display
- * with the same string value.
- *
- * Returns: the X atom corresponding to @atom.
- **/
-Atom
-gdk_x11_atom_to_xatom (GdkAtom atom)
-{
- return gdk_x11_atom_to_xatom_for_display (gdk_display_get_default (), atom);
-}
-
-/**
* gdk_x11_xatom_to_atom_for_display:
* @display: (type GdkX11Display): A #GdkDisplay
* @xatom: an X atom
@@ -217,21 +202,6 @@ gdk_x11_xatom_to_atom_for_display (GdkDisplay *display,
}
/**
- * gdk_x11_xatom_to_atom:
- * @xatom: an X atom for the default GDK display
- *
- * Convert from an X atom for the default display to the corresponding
- * #GdkAtom.
- *
- * Returns: (transfer none): the corresponding G#dkAtom.
- **/
-GdkAtom
-gdk_x11_xatom_to_atom (Atom xatom)
-{
- return gdk_x11_xatom_to_atom_for_display (gdk_display_get_default (), xatom);
-}
-
-/**
* gdk_x11_get_xatom_by_name_for_display:
* @display: (type GdkX11Display): a #GdkDisplay
* @atom_name: a string
@@ -273,23 +243,6 @@ _gdk_x11_get_xatom_for_display_printf (GdkDisplay *display,
}
/**
- * gdk_x11_get_xatom_by_name:
- * @atom_name: a string
- *
- * Returns the X atom for GDK’s default display corresponding to @atom_name.
- * This function caches the result, so if called repeatedly it is much
- * faster than XInternAtom(), which is a round trip to the server each time.
- *
- * Returns: a X atom for GDK’s default display.
- **/
-Atom
-gdk_x11_get_xatom_by_name (const gchar *atom_name)
-{
- return gdk_x11_get_xatom_by_name_for_display (gdk_display_get_default (),
- atom_name);
-}
-
-/**
* gdk_x11_get_xatom_name_for_display:
* @display: (type GdkX11Display): the #GdkDisplay where @xatom is defined
* @xatom: an X atom
@@ -313,22 +266,3 @@ gdk_x11_get_xatom_name_for_display (GdkDisplay *display,
return (const char *)gdk_x11_xatom_to_atom_for_display (display, xatom);
}
-/**
- * gdk_x11_get_xatom_name:
- * @xatom: an X atom for GDK’s default display
- *
- * Returns the name of an X atom for GDK’s default display. This
- * function is meant mainly for debugging, so for convenience, unlike
- * XAtomName() and the result
- * doesn’t need to be freed. Also, this function will never return %NULL,
- * even if @xatom is invalid.
- *
- * Returns: name of the X atom; this string is owned by GTK+,
- * so it shouldn’t be modifed or freed.
- **/
-const gchar *
-gdk_x11_get_xatom_name (Atom xatom)
-{
- return (const char *)gdk_x11_xatom_to_atom (xatom);
-}
-
diff --git a/gdk/x11/gdkx11property.h b/gdk/x11/gdkx11property.h
index 55d4fbaf46..9b3e694319 100644
--- a/gdk/x11/gdkx11property.h
+++ b/gdk/x11/gdkx11property.h
@@ -49,14 +49,6 @@ Atom gdk_x11_get_xatom_by_name_for_display (GdkDisplay *displa
GDK_AVAILABLE_IN_ALL
const gchar * gdk_x11_get_xatom_name_for_display (GdkDisplay *display,
Atom xatom);
-GDK_AVAILABLE_IN_ALL
-Atom gdk_x11_atom_to_xatom (GdkAtom atom);
-GDK_AVAILABLE_IN_ALL
-GdkAtom gdk_x11_xatom_to_atom (Atom xatom);
-GDK_AVAILABLE_IN_ALL
-Atom gdk_x11_get_xatom_by_name (const gchar *atom_name);
-GDK_AVAILABLE_IN_ALL
-const gchar * gdk_x11_get_xatom_name (Atom xatom);
G_END_DECLS