Emit "detached" control event
parent
3af4851e4d
commit
27a8008edf
|
@ -39,6 +39,7 @@ enum event_type {
|
||||||
EVT_CAPTURE_CHANGED,
|
EVT_CAPTURE_CHANGED,
|
||||||
EVT_CLIENT_CONNECTED,
|
EVT_CLIENT_CONNECTED,
|
||||||
EVT_CLIENT_DISCONNECTED,
|
EVT_CLIENT_DISCONNECTED,
|
||||||
|
EVT_DETACHED,
|
||||||
EVT_UNKNOWN,
|
EVT_UNKNOWN,
|
||||||
};
|
};
|
||||||
#define EVT_LIST_LEN EVT_UNKNOWN
|
#define EVT_LIST_LEN EVT_UNKNOWN
|
||||||
|
|
|
@ -82,3 +82,5 @@ void ctl_server_event_disconnected(struct ctl*,
|
||||||
|
|
||||||
void ctl_server_event_capture_changed(struct ctl*,
|
void ctl_server_event_capture_changed(struct ctl*,
|
||||||
const char* captured_output);
|
const char* captured_output);
|
||||||
|
|
||||||
|
void ctl_server_event_detached(struct ctl*);
|
||||||
|
|
|
@ -124,6 +124,10 @@ struct cmd_info ctl_event_list[] = {
|
||||||
"Sent by waynvc when a VNC client disconnects",
|
"Sent by waynvc when a VNC client disconnects",
|
||||||
{ CLIENT_EVENT_PARAMS("not including") }
|
{ CLIENT_EVENT_PARAMS("not including") }
|
||||||
},
|
},
|
||||||
|
[EVT_DETACHED] = {"detached",
|
||||||
|
"Sent after detaching from compositor",
|
||||||
|
{}
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
enum cmd_type ctl_command_parse_name(const char* name)
|
enum cmd_type ctl_command_parse_name(const char* name)
|
||||||
|
|
|
@ -973,3 +973,8 @@ void ctl_server_event_capture_changed(struct ctl* self,
|
||||||
ctl_server_enqueue_event(self, EVT_CAPTURE_CHANGED,
|
ctl_server_enqueue_event(self, EVT_CAPTURE_CHANGED,
|
||||||
json_pack("{s:s}", "output", captured_output));
|
json_pack("{s:s}", "output", captured_output));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ctl_server_event_detached(struct ctl* self)
|
||||||
|
{
|
||||||
|
ctl_server_enqueue_event(self, EVT_DETACHED, json_object());
|
||||||
|
}
|
||||||
|
|
|
@ -440,6 +440,8 @@ static void wayland_detach(struct wayvnc* self)
|
||||||
|
|
||||||
wl_display_disconnect(self->display);
|
wl_display_disconnect(self->display);
|
||||||
self->display = NULL;
|
self->display = NULL;
|
||||||
|
|
||||||
|
ctl_server_event_detached(self->ctl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wayvnc_destroy(struct wayvnc* self)
|
void wayvnc_destroy(struct wayvnc* self)
|
||||||
|
|
Loading…
Reference in New Issue