From 98552f1d75ac04fa5dd07e6b23bd43cd5045a4e1 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Sun, 9 Mar 2014 13:18:58 +0100 Subject: [PATCH] Added caching of X11 NULL atom. --- src/x11_clipboard.c | 2 +- src/x11_init.c | 1 + src/x11_platform.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/x11_clipboard.c b/src/x11_clipboard.c index d8fd4d39..e42d1b8d 100644 --- a/src/x11_clipboard.c +++ b/src/x11_clipboard.c @@ -139,7 +139,7 @@ static Atom writeTargetToProperty(const XSelectionRequestEvent* request) XChangeProperty(_glfw.x11.display, request->requestor, request->property, - XInternAtom(_glfw.x11.display, "NULL", False), + _glfw.x11._NULL, 32, PropModeReplace, NULL, diff --git a/src/x11_init.c b/src/x11_init.c index 33ea7baf..18d92fdd 100644 --- a/src/x11_init.c +++ b/src/x11_init.c @@ -524,6 +524,7 @@ static GLboolean initExtensions(void) detectEWMH(); // Find or create string format atoms + _glfw.x11._NULL = XInternAtom(_glfw.x11.display, "NULL", False); _glfw.x11.UTF8_STRING = XInternAtom(_glfw.x11.display, "UTF8_STRING", False); _glfw.x11.COMPOUND_STRING = diff --git a/src/x11_platform.h b/src/x11_platform.h index 235c0f3f..25a54612 100644 --- a/src/x11_platform.h +++ b/src/x11_platform.h @@ -136,6 +136,7 @@ typedef struct _GLFWlibraryX11 Atom CLIPBOARD; Atom CLIPBOARD_MANAGER; Atom SAVE_TARGETS; + Atom _NULL; Atom UTF8_STRING; Atom COMPOUND_STRING; Atom ATOM_PAIR;