[gtk+] x11: Get selection atom useing GDK functions
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] x11: Get selection atom useing GDK functions
- Date: Tue, 19 Feb 2013 13:49:08 +0000 (UTC)
commit c91843edeac7436374e33f56752ba9364a354223
Author: Benjamin Otte <otte redhat com>
Date: Fri Feb 15 20:06:56 2013 +0100
x11: Get selection atom useing GDK functions
Don't call XInternAtoms ourselves.
gdk/x11/xsettings-client.c | 13 ++++---------
1 files changed, 4 insertions(+), 9 deletions(-)
---
diff --git a/gdk/x11/xsettings-client.c b/gdk/x11/xsettings-client.c
index 065b12f..5edeb46 100644
--- a/gdk/x11/xsettings-client.c
+++ b/gdk/x11/xsettings-client.c
@@ -530,9 +530,7 @@ XSettingsClient *
xsettings_client_new (GdkScreen *screen)
{
XSettingsClient *client;
- char buffer[256];
- char *atom_names[1];
- Atom atoms[1];
+ char *selection_atom_name;
client = g_new (XSettingsClient, 1);
if (!client)
@@ -544,12 +542,9 @@ xsettings_client_new (GdkScreen *screen)
client->manager_window = None;
client->settings = NULL;
- sprintf(buffer, "_XSETTINGS_S%d", gdk_x11_screen_get_screen_number (screen));
- atom_names[0] = buffer;
-
- XInternAtoms (client->display, atom_names, 1, False, atoms);
-
- client->selection_atom = atoms[0];
+ selection_atom_name = g_strdup_printf ("_XSETTINGS_S%d", gdk_x11_screen_get_screen_number (screen));
+ client->selection_atom = gdk_x11_get_xatom_by_name_for_display (gdk_screen_get_display (screen),
selection_atom_name);
+ g_free (selection_atom_name);
gdk_xsettings_watch (gdk_x11_window_get_xid (gdk_screen_get_root_window (screen)), True, client->screen);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]