Emit "detached" control event

detached-mode
Andri Yngvason 2023-11-14 20:36:41 +00:00
parent 861e140205
commit 2c524e28fc
5 changed files with 14 additions and 0 deletions

View File

@ -39,6 +39,7 @@ enum event_type {
EVT_CAPTURE_CHANGED,
EVT_CLIENT_CONNECTED,
EVT_CLIENT_DISCONNECTED,
EVT_DETACHED,
EVT_UNKNOWN,
};
#define EVT_LIST_LEN EVT_UNKNOWN

View File

@ -82,3 +82,5 @@ void ctl_server_event_disconnected(struct ctl*,
void ctl_server_event_capture_changed(struct ctl*,
const char* captured_output);
void ctl_server_event_detached(struct ctl*);

View File

@ -124,6 +124,10 @@ struct cmd_info ctl_event_list[] = {
"Sent by waynvc when a VNC client disconnects",
{ CLIENT_EVENT_PARAMS("not including") }
},
[EVT_DETACHED] = {"detached",
"Sent after detaching from compositor",
{}
},
};
enum cmd_type ctl_command_parse_name(const char* name)

View File

@ -973,3 +973,8 @@ void ctl_server_event_capture_changed(struct ctl* self,
ctl_server_enqueue_event(self, EVT_CAPTURE_CHANGED,
json_pack("{s:s}", "output", captured_output));
}
void ctl_server_event_detached(struct ctl* self)
{
ctl_server_enqueue_event(self, EVT_DETACHED, json_object());
}

View File

@ -440,6 +440,8 @@ static void wayland_detach(struct wayvnc* self)
wl_display_disconnect(self->display);
self->display = NULL;
ctl_server_event_detached(self->ctl);
}
void wayvnc_destroy(struct wayvnc* self)