Skip to content

Commit

Permalink
linux-capture: Add getter to screencast portal version
Browse files Browse the repository at this point in the history
This will be used by the next commit to verify whether or not
to pass the restore token and persist mode options.
  • Loading branch information
GeorgesStavracas authored and jp9000 committed Nov 24, 2021
1 parent dc63f63 commit 8537c75
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions plugins/linux-capture/portal.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,22 @@ uint32_t portal_get_available_capture_types(void)
return available_source_types;
}

uint32_t portal_get_screencast_version(void)
{
g_autoptr(GVariant) cached_version = NULL;
uint32_t version;

ensure_proxy();

if (!proxy)
return 0;

cached_version = g_dbus_proxy_get_cached_property(proxy, "version");
version = cached_version ? g_variant_get_uint32(cached_version) : 0;

return version;
}

GDBusConnection *portal_get_dbus_connection(void)
{
ensure_proxy();
Expand Down
1 change: 1 addition & 0 deletions plugins/linux-capture/portal.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <gio/gio.h>

uint32_t portal_get_available_capture_types(void);
uint32_t portal_get_screencast_version(void);

GDBusConnection *portal_get_dbus_connection(void);
GDBusProxy *portal_get_dbus_proxy(void);

0 comments on commit 8537c75

Please sign in to comment.