X11 copying code and support PRIMARY & CLIPBOARD clipboards.

This commit is contained in:
Ralph Eastwood
2011-09-22 12:03:45 +01:00
parent 57522db6e2
commit 9f41e5b67a
6 changed files with 179 additions and 40 deletions
+19 -2
View File
@@ -41,8 +41,8 @@
#define _NET_WM_STATE_TOGGLE 2
// Additional mouse button names for XButtonEvent
#define Button6 6
#define Button7 7
#define Button6 6
#define Button7 7
//========================================================================
// Error handler for BadMatch errors when requesting context with
@@ -1394,6 +1394,23 @@ static void processSingleEvent(void)
break;
}
case SelectionRequest:
{
XSelectionRequestEvent *request = &event.xselectionrequest;
// Construct the response
XEvent response;
response.xselection.property = _glfwSelectionRequest(request);
response.xselection.type = SelectionNotify;
response.xselection.display = request->display;
response.xselection.requestor = request->requestor;
response.xselection.selection = request->selection;
response.xselection.target = request->target;
response.xselection.time = request->time;
// Send off the event
XSendEvent(_glfwLibrary.X11.display, request->requestor, 0, 0, &response);
break;
}
// Was the window destroyed?
case DestroyNotify:
return;