diff --git a/client/displayservers/X11/clipboard.c b/client/displayservers/X11/clipboard.c index 8535638b..967f7dbd 100644 --- a/client/displayservers/X11/clipboard.c +++ b/client/displayservers/X11/clipboard.c @@ -59,30 +59,30 @@ static void x11CBSelectionIncr(const XPropertyEvent e); static void x11CBSelectionNotify(const XSelectionEvent e); static void x11CBXFixesSelectionNotify(const XFixesSelectionNotifyEvent e); -void x11CBEventThread(const XEvent xe) +bool x11CBEventThread(const XEvent xe) { switch(xe.type) { case SelectionRequest: x11CBSelectionRequest(xe.xselectionrequest); - break; + return true; case SelectionClear: x11CBSelectionClear(xe.xselectionclear); - break; + return true; case SelectionNotify: x11CBSelectionNotify(xe.xselection); - break; + return true; case PropertyNotify: if (xe.xproperty.atom == x11atoms.SEL_DATA) { if (x11cb.lowerBound == 0) - break; + return true; x11CBSelectionIncr(xe.xproperty); - break; + return true; } break; @@ -91,9 +91,12 @@ void x11CBEventThread(const XEvent xe) { XFixesSelectionNotifyEvent * sne = (XFixesSelectionNotifyEvent *)&xe; x11CBXFixesSelectionNotify(*sne); + return true; } break; } + + return false; } bool x11CBInit() diff --git a/client/displayservers/X11/clipboard.h b/client/displayservers/X11/clipboard.h index 5512ae87..a508bd3f 100644 --- a/client/displayservers/X11/clipboard.h +++ b/client/displayservers/X11/clipboard.h @@ -25,7 +25,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA #include "interface/displayserver.h" -void x11CBEventThread(const XEvent xe); +bool x11CBEventThread(const XEvent xe); bool x11CBInit(); void x11CBNotice(LG_ClipboardData type); diff --git a/client/displayservers/X11/x11.c b/client/displayservers/X11/x11.c index 7f99a86e..683e1dc4 100644 --- a/client/displayservers/X11/x11.c +++ b/client/displayservers/X11/x11.c @@ -558,6 +558,10 @@ static int x11EventThread(void * unused) XEvent xe; XNextEvent(x11.display, &xe); + // call the clipboard handling code + if (x11CBEventThread(xe)) + continue; + switch(xe.type) { case ClientMessage: @@ -666,9 +670,6 @@ static int x11EventThread(void * unused) } break; } - - // call the clipboard handling code - x11CBEventThread(xe); } return 0;