From c69a55923995c931646b5d977980efec23af5712 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 26 May 2015 21:29:45 -0400 Subject: [PATCH] X11: generate clipboard update events (thanks, "chw"!). Partially fixes Bugzilla #2266. --- src/video/x11/SDL_x11events.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index e6172b66d1bef..6ef4fa07c67bf 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -1219,6 +1219,16 @@ X11_DispatchEvent(_THIS) } 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);