Commit b6dfef73 authored by Frediano Ziglio's avatar Frediano Ziglio

x11-randr: Avoid passing XEvent as value

The structure is not that small and is not necessary to copy
the value.
This also removed a Coverity warning.
Signed-off-by: Frediano Ziglio's avatarFrediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso's avatarVictor Toso <victortoso@redhat.com>
parent 6bfbd03e
......@@ -152,7 +152,7 @@ void vdagent_x11_send_daemon_guest_xorg_res(struct vdagent_x11 *x11,
void vdagent_x11_randr_handle_root_size_change(struct vdagent_x11 *x11,
int screen, int width, int height);
int vdagent_x11_randr_handle_event(struct vdagent_x11 *x11,
XEvent event);
const XEvent *event);
void vdagent_x11_set_error_handler(struct vdagent_x11 *x11,
int (*handler)(Display *, XErrorEvent *));
int vdagent_x11_restore_error_handler(struct vdagent_x11 *x11);
......
......@@ -529,14 +529,14 @@ void vdagent_x11_randr_handle_root_size_change(struct vdagent_x11 *x11,
}
int vdagent_x11_randr_handle_event(struct vdagent_x11 *x11,
XEvent event)
const XEvent *event)
{
int handled = TRUE;
switch (event.type - x11->xrandr_event_base) {
switch (event->type - x11->xrandr_event_base) {
case RRScreenChangeNotify: {
XRRScreenChangeNotifyEvent *sce =
(XRRScreenChangeNotifyEvent *) &event;
const XRRScreenChangeNotifyEvent *sce =
(const XRRScreenChangeNotifyEvent *) event;
vdagent_x11_randr_handle_root_size_change(x11, 0,
sce->width, sce->height);
break;
......
......@@ -545,7 +545,7 @@ static void vdagent_x11_handle_event(struct vdagent_x11 *x11, XEvent event)
}
#endif
if (vdagent_x11_randr_handle_event(x11, event))
if (vdagent_x11_randr_handle_event(x11, &event))
return;
switch (event.type) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment