Skip to content

Commit

Permalink
Properly report xdp screencast implementation version
Browse files Browse the repository at this point in the history
  • Loading branch information
danshick committed Apr 9, 2020
1 parent c50fdc8 commit 89e2ec6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/screencast_common.h
Expand Up @@ -5,6 +5,10 @@
#include <spa/param/video/format-utils.h>
#include <wayland-client-protocol.h>

// this seems to be right based on
// https://github.com/flatpak/xdg-desktop-portal/blob/309a1fc0cf2fb32cceb91dbc666d20cf0a3202c2/src/screen-cast.c#L955
#define XDP_CAST_PROTO_VER 2

enum cursor_modes {
HIDDEN = 1,
EMBEDDED = 2,
Expand Down
1 change: 1 addition & 0 deletions include/xdpw.h
Expand Up @@ -18,6 +18,7 @@ struct xdpw_state {
struct xdpw_screencast_context screencast;
enum source_types screencast_source_types;
enum cursor_modes screencast_cursor_modes;
uint32_t screencast_version;
};

struct xdpw_request {
Expand Down
1 change: 1 addition & 0 deletions src/core/main.c
Expand Up @@ -101,6 +101,7 @@ int main(int argc, char *argv[]) {
.pw_loop = pw_loop,
.screencast_source_types = MONITOR,
.screencast_cursor_modes = HIDDEN | EMBEDDED,
.screencast_version = XDP_CAST_PROTO_VER,
};

wl_list_init(&state.xdpw_sessions);
Expand Down
3 changes: 3 additions & 0 deletions src/screencast/screencast.c
Expand Up @@ -400,6 +400,9 @@ static const sd_bus_vtable screencast_vtable[] = {
SD_BUS_PROPERTY("AvailableCursorModes", "u", NULL,
offsetof(struct xdpw_state, screencast_cursor_modes),
SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("version", "u", NULL,
offsetof(struct xdpw_state, screencast_version),
SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_VTABLE_END
};

Expand Down

0 comments on commit 89e2ec6

Please sign in to comment.