main: poll video devices on hotplug
authorDavid Herrmann <dh.herrmann@googlemail.com>
Sat, 26 May 2012 11:47:23 +0000 (13:47 +0200)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Sat, 26 May 2012 11:47:23 +0000 (13:47 +0200)
When the monitor notifies us about an hoptplug event, then we need to poll
the current video device. Otherwise, we might miss hotplugged monitors.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/main.c

index 9bd1782..5253d1a 100644 (file)
@@ -219,6 +219,10 @@ static void monitor_event(struct uterm_monitor *mon,
                        uterm_input_remove_dev(seat->input, ev->dev_node);
                break;
        case UTERM_MONITOR_HOTPLUG_DEV:
+               seat = ev->seat_data;
+               if (!seat || seat->vdev != ev->dev)
+                       break;
+               uterm_video_poll(seat->video);
                break;
        }
 }