[client] x11: pass large struct by reference

This commit is contained in:
Geoffrey McRae 2023-11-11 11:36:24 +11:00
parent 3c1405719c
commit b70811dcb9
3 changed files with 11 additions and 11 deletions

View File

@ -60,38 +60,38 @@ static void x11CBSelectionIncr(const XPropertyEvent e);
static void x11CBSelectionNotify(const XSelectionEvent e); static void x11CBSelectionNotify(const XSelectionEvent e);
static void x11CBXFixesSelectionNotify(const XFixesSelectionNotifyEvent 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: case SelectionRequest:
x11CBSelectionRequest(xe.xselectionrequest); x11CBSelectionRequest(xe->xselectionrequest);
return true; return true;
case SelectionClear: case SelectionClear:
x11CBSelectionClear(xe.xselectionclear); x11CBSelectionClear(xe->xselectionclear);
return true; return true;
case SelectionNotify: case SelectionNotify:
x11CBSelectionNotify(xe.xselection); x11CBSelectionNotify(xe->xselection);
return true; return true;
case PropertyNotify: case PropertyNotify:
if (xe.xproperty.state != PropertyNewValue) if (xe->xproperty.state != PropertyNewValue)
break; break;
if (xe.xproperty.atom == x11atoms.SEL_DATA) if (xe->xproperty.atom == x11atoms.SEL_DATA)
{ {
if (x11cb.lowerBound == 0) if (x11cb.lowerBound == 0)
return true; return true;
x11CBSelectionIncr(xe.xproperty); x11CBSelectionIncr(xe->xproperty);
return true; return true;
} }
break; break;
default: default:
if (xe.type == x11.eventBase + XFixesSelectionNotify) if (xe->type == x11.eventBase + XFixesSelectionNotify)
{ {
XFixesSelectionNotifyEvent * sne = (XFixesSelectionNotifyEvent *)&xe; XFixesSelectionNotifyEvent * sne = (XFixesSelectionNotifyEvent *)&xe;
x11CBXFixesSelectionNotify(*sne); x11CBXFixesSelectionNotify(*sne);

View File

@ -26,7 +26,7 @@
#include "interface/displayserver.h" #include "interface/displayserver.h"
bool x11CBEventThread(const XEvent xe); bool x11CBEventThread(const XEvent * xe);
bool x11CBInit(void); bool x11CBInit(void);
void x11CBNotice(LG_ClipboardData type); void x11CBNotice(LG_ClipboardData type);

View File

@ -897,7 +897,7 @@ static int x11EventThread(void * unused)
XNextEvent(x11.display, &xe); XNextEvent(x11.display, &xe);
// call the clipboard handling code // call the clipboard handling code
if (x11CBEventThread(xe)) if (x11CBEventThread(&xe))
continue; continue;
switch(xe.type) switch(xe.type)