X11: generate clipboard update events (thanks, "chw"!).
authorRyan C. Gordon <icculus@icculus.org>
Tue, 26 May 2015 21:29:45 -0400
changeset 9652b5a26bd8b0e7
parent 9651 565009735397
child 9653 0a2de253c67e
X11: generate clipboard update events (thanks, "chw"!).

Partially fixes Bugzilla #2266.
src/video/x11/SDL_x11events.c
     1.1 --- a/src/video/x11/SDL_x11events.c	Tue May 26 21:30:41 2015 -0400
     1.2 +++ b/src/video/x11/SDL_x11events.c	Tue May 26 21:29:45 2015 -0400
     1.3 @@ -1219,6 +1219,16 @@
     1.4          }
     1.5          break;
     1.6  
     1.7 +    case SelectionClear: {
     1.8 +            Atom XA_CLIPBOARD = X11_XInternAtom(display, "CLIPBOARD", 0);
     1.9 +
    1.10 +            if (xevent.xselectionclear.selection == XA_PRIMARY ||
    1.11 +                (XA_CLIPBOARD != None && xevent.xselectionclear.selection == XA_CLIPBOARD)) {
    1.12 +                SDL_SendClipboardUpdate();
    1.13 +            }
    1.14 +        }
    1.15 +        break;
    1.16 +
    1.17      default:{
    1.18  #ifdef DEBUG_XEVENTS
    1.19              printf("window %p: Unhandled event %d\n", data, xevent.type);