remote-desktop/session: Limit device type access when using libei

The portal could limit access to certain device types, but this was not
forwarded to the EIS context. Add a way to do this, and make use of it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3228>
This commit is contained in:
Jonas Ådahl
2023-08-28 17:21:35 +02:00
committed by Marge Bot
parent 21f3e2a323
commit 2eda81aadf
7 changed files with 83 additions and 17 deletions

View File

@ -45,6 +45,8 @@ struct _MetaEis
struct eis *eis;
MetaEventSource *event_source;
MetaEisDeviceTypes device_types;
GHashTable *eis_clients; /* eis_client => MetaEisClient */
};
@ -238,13 +240,15 @@ meta_eis_add_client_get_fd (MetaEis *eis)
}
MetaEis *
meta_eis_new (MetaBackend *backend)
meta_eis_new (MetaBackend *backend,
MetaEisDeviceTypes device_types)
{
MetaEis *eis;
int fd;
eis = g_object_new (META_TYPE_EIS, NULL);
eis->backend = backend;
eis->device_types = device_types;
eis->eis = eis_new (eis);
eis_log_set_handler (eis->eis, eis_logger);
@ -284,3 +288,9 @@ meta_eis_class_init (MetaEisClass *klass)
object_class->finalize = meta_eis_finalize;
}
MetaEisDeviceTypes
meta_eis_get_device_types (MetaEis *eis)
{
return eis->device_types;
}