From 2757f1c6914e794a09f47c486daf2114d091f181 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Sun, 24 Jun 2012 10:50:16 +0200 Subject: [PATCH] ui: do not modify callback parameters Other registered callbacks might get confused if we change the parameters. Hence, we use a static copy for further actions. Signed-off-by: David Herrmann --- src/ui.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ui.c b/src/ui.c index 2f0216d..0e57681 100644 --- a/src/ui.c +++ b/src/ui.c @@ -54,6 +54,7 @@ static void video_event(struct uterm_video *video, struct kmscon_ui *ui = data; int ret; struct uterm_display *disp; + struct uterm_video_hotplug fev = *ev; if (ev->action == UTERM_NEW) { if (uterm_display_get_state(ev->display) == UTERM_DISPLAY_INACTIVE) { @@ -68,9 +69,9 @@ static void video_event(struct uterm_video *video, } else if (ev->action == UTERM_WAKE_UP) { disp = uterm_video_get_displays(video); while (disp) { - ev->display = disp; - ev->action = UTERM_NEW; - video_event(video, ev, data); + fev.display = disp; + fev.action = UTERM_NEW; + video_event(video, &fev, data); disp = uterm_display_next(disp); } }