Re-worked and fixed X11 clipboard support.

This commit is contained in:
Camilla Berglund
2012-04-11 23:32:50 +02:00
parent ad48c0e5ef
commit f231ed37f0
4 changed files with 144 additions and 135 deletions
+9 -1
View File
@@ -597,11 +597,15 @@ static GLboolean initDisplay(void)
// the keyboard mapping.
updateKeyCodeLUT();
// Find or create selection property atom
_glfwLibrary.X11.selection.property =
XInternAtom(_glfwLibrary.X11.display, "GLFW_SELECTION", False);
// Find or create clipboard atom
_glfwLibrary.X11.selection.atom =
XInternAtom(_glfwLibrary.X11.display, "CLIPBOARD", False);
// Find or create selection atoms
// Find or create selection target atoms
_glfwLibrary.X11.selection.formats[_GLFW_CLIPBOARD_FORMAT_UTF8] =
XInternAtom(_glfwLibrary.X11.display, "UTF8_STRING", False);
_glfwLibrary.X11.selection.formats[_GLFW_CLIPBOARD_FORMAT_COMPOUND] =
@@ -609,6 +613,10 @@ static GLboolean initDisplay(void)
_glfwLibrary.X11.selection.formats[_GLFW_CLIPBOARD_FORMAT_STRING] =
XA_STRING;
_glfwLibrary.X11.selection.targets = XInternAtom(_glfwLibrary.X11.display,
"TARGETS",
False);
return GL_TRUE;
}