From b70811dcb9539f22dc837b55583862766f45f515 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sat, 11 Nov 2023 11:36:24 +1100 Subject: [PATCH] [client] x11: pass large struct by reference --- client/displayservers/X11/clipboard.c | 18 +++++++++--------- client/displayservers/X11/clipboard.h | 2 +- client/displayservers/X11/x11.c | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/client/displayservers/X11/clipboard.c b/client/displayservers/X11/clipboard.c index 4794024f..9fa15074 100644 --- a/client/displayservers/X11/clipboard.c +++ b/client/displayservers/X11/clipboard.c @@ -60,38 +60,38 @@ static void x11CBSelectionIncr(const XPropertyEvent e); static void x11CBSelectionNotify(const XSelectionEvent e); static void x11CBXFixesSelectionNotify(const XFixesSelectionNotifyEvent e); -bool x11CBEventThread(const XEvent xe) +bool x11CBEventThread(const XEvent * xe) { - switch(xe.type) + switch(xe->type) { case SelectionRequest: - x11CBSelectionRequest(xe.xselectionrequest); + x11CBSelectionRequest(xe->xselectionrequest); return true; case SelectionClear: - x11CBSelectionClear(xe.xselectionclear); + x11CBSelectionClear(xe->xselectionclear); return true; case SelectionNotify: - x11CBSelectionNotify(xe.xselection); + x11CBSelectionNotify(xe->xselection); return true; case PropertyNotify: - if (xe.xproperty.state != PropertyNewValue) + if (xe->xproperty.state != PropertyNewValue) break; - if (xe.xproperty.atom == x11atoms.SEL_DATA) + if (xe->xproperty.atom == x11atoms.SEL_DATA) { if (x11cb.lowerBound == 0) return true; - x11CBSelectionIncr(xe.xproperty); + x11CBSelectionIncr(xe->xproperty); return true; } break; default: - if (xe.type == x11.eventBase + XFixesSelectionNotify) + if (xe->type == x11.eventBase + XFixesSelectionNotify) { XFixesSelectionNotifyEvent * sne = (XFixesSelectionNotifyEvent *)&xe; x11CBXFixesSelectionNotify(*sne); diff --git a/client/displayservers/X11/clipboard.h b/client/displayservers/X11/clipboard.h index 19c02834..d39ca625 100644 --- a/client/displayservers/X11/clipboard.h +++ b/client/displayservers/X11/clipboard.h @@ -26,7 +26,7 @@ #include "interface/displayserver.h" -bool x11CBEventThread(const XEvent xe); +bool x11CBEventThread(const XEvent * xe); bool x11CBInit(void); void x11CBNotice(LG_ClipboardData type); diff --git a/client/displayservers/X11/x11.c b/client/displayservers/X11/x11.c index 855b520a..7b423540 100644 --- a/client/displayservers/X11/x11.c +++ b/client/displayservers/X11/x11.c @@ -897,7 +897,7 @@ static int x11EventThread(void * unused) XNextEvent(x11.display, &xe); // call the clipboard handling code - if (x11CBEventThread(xe)) + if (x11CBEventThread(&xe)) continue; switch(xe.type)