X11: generate clipboard update events (thanks, "chw"!).
authorRyan C. Gordon <icculus@icculus.org>
Tue, 26 May 2015 21:29:45 -0400
changeset 9652 b5a26bd8b0e7
parent 9651 565009735397
child 9653 0a2de253c67e
X11: generate clipboard update events (thanks, "chw"!). Partially fixes Bugzilla #2266.
src/video/x11/SDL_x11events.c
--- a/src/video/x11/SDL_x11events.c	Tue May 26 21:30:41 2015 -0400
+++ b/src/video/x11/SDL_x11events.c	Tue May 26 21:29:45 2015 -0400
@@ -1219,6 +1219,16 @@
         }
         break;
 
+    case SelectionClear: {
+            Atom XA_CLIPBOARD = X11_XInternAtom(display, "CLIPBOARD", 0);
+
+            if (xevent.xselectionclear.selection == XA_PRIMARY ||
+                (XA_CLIPBOARD != None && xevent.xselectionclear.selection == XA_CLIPBOARD)) {
+                SDL_SendClipboardUpdate();
+            }
+        }
+        break;
+
     default:{
 #ifdef DEBUG_XEVENTS
             printf("window %p: Unhandled event %d\n", data, xevent.type);