X11: Add native access to primary selection

This adds the native access functions glfwSetX11SelectionString and
glfwGetX11SelectionString under GLFW_EXPOSE_NATIVE_X11.  They are
similar to glfwSetClipboardString and glfwGetClipboardString but operate
on the PRIMARY selection.

The primary selection is widely used in X11, and so seems important to
support.  Primary selection is mostly an X11-specific thing, hence it's
exposed as an X11 native interface.

Fixes #894.
Closes #1056.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
This commit is contained in:
Kristian Nielsen
2017-08-02 16:10:13 +02:00
committed by Camilla Löwy
parent 3ee7f8f695
commit 29a75ab09d
6 changed files with 180 additions and 72 deletions
+3
View File
@@ -161,6 +161,8 @@ typedef struct _GLFWlibraryX11
XIM im;
// Most recent error code received by X error handler
int errorCode;
// Primary selection string (while the primary selection is owned)
char* primarySelectionString;
// Clipboard string (while the selection is owned)
char* clipboardString;
// Key name string
@@ -214,6 +216,7 @@ typedef struct _GLFWlibraryX11
Atom TARGETS;
Atom MULTIPLE;
Atom CLIPBOARD;
Atom PRIMARY;
Atom CLIPBOARD_MANAGER;
Atom SAVE_TARGETS;
Atom NULL_;