remote-desktop/session: Take over EIS context

This means there will be an EIS context per session, which will enable
per session devices and region.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3228>
This commit is contained in:
Jonas Ådahl 2023-08-28 17:01:03 +02:00 committed by Marge Bot
parent ce61c8dc61
commit 0160f3c0a0
5 changed files with 5 additions and 30 deletions

View File

@ -143,8 +143,6 @@ MetaDbusSessionWatcher * meta_backend_get_dbus_session_watcher (MetaBackend *bac
MetaRemoteDesktop * meta_backend_get_remote_desktop (MetaBackend *backend); MetaRemoteDesktop * meta_backend_get_remote_desktop (MetaBackend *backend);
MetaScreenCast * meta_backend_get_screen_cast (MetaBackend *backend); MetaScreenCast * meta_backend_get_screen_cast (MetaBackend *backend);
MetaEis * meta_backend_get_eis (MetaBackend *backend);
#endif #endif
MetaInputCapture * meta_backend_get_input_capture (MetaBackend *backend); MetaInputCapture * meta_backend_get_input_capture (MetaBackend *backend);

View File

@ -78,7 +78,6 @@
#ifdef HAVE_REMOTE_DESKTOP #ifdef HAVE_REMOTE_DESKTOP
#include "backends/meta-dbus-session-watcher.h" #include "backends/meta-dbus-session-watcher.h"
#include "backends/meta-eis.h"
#include "backends/meta-remote-access-controller-private.h" #include "backends/meta-remote-access-controller-private.h"
#include "backends/meta-remote-desktop.h" #include "backends/meta-remote-desktop.h"
#include "backends/meta-screen-cast.h" #include "backends/meta-screen-cast.h"
@ -140,7 +139,6 @@ struct _MetaBackendPrivate
#ifdef HAVE_REMOTE_DESKTOP #ifdef HAVE_REMOTE_DESKTOP
MetaScreenCast *screen_cast; MetaScreenCast *screen_cast;
MetaRemoteDesktop *remote_desktop; MetaRemoteDesktop *remote_desktop;
MetaEis *eis;
#endif #endif
MetaInputCapture *input_capture; MetaInputCapture *input_capture;
@ -210,7 +208,6 @@ meta_backend_dispose (GObject *object)
#ifdef HAVE_REMOTE_DESKTOP #ifdef HAVE_REMOTE_DESKTOP
g_clear_object (&priv->remote_desktop); g_clear_object (&priv->remote_desktop);
g_clear_object (&priv->screen_cast); g_clear_object (&priv->screen_cast);
g_clear_object (&priv->eis);
#endif #endif
g_clear_object (&priv->input_capture); g_clear_object (&priv->input_capture);
g_clear_object (&priv->dbus_session_watcher); g_clear_object (&priv->dbus_session_watcher);
@ -584,7 +581,6 @@ meta_backend_real_post_init (MetaBackend *backend)
meta_remote_access_controller_add ( meta_remote_access_controller_add (
priv->remote_access_controller, priv->remote_access_controller,
META_DBUS_SESSION_MANAGER (priv->remote_desktop)); META_DBUS_SESSION_MANAGER (priv->remote_desktop));
priv->eis = meta_eis_new (backend);
#endif /* HAVE_REMOTE_DESKTOP */ #endif /* HAVE_REMOTE_DESKTOP */
priv->input_capture = meta_input_capture_new (backend); priv->input_capture = meta_input_capture_new (backend);
@ -1443,16 +1439,6 @@ meta_backend_get_screen_cast (MetaBackend *backend)
return priv->screen_cast; return priv->screen_cast;
} }
/**
* meta_backend_get_eis: (skip)
*/
MetaEis *
meta_backend_get_eis (MetaBackend *backend)
{
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
return priv->eis;
}
#endif /* HAVE_REMOTE_DESKTOP */ #endif /* HAVE_REMOTE_DESKTOP */
MetaInputCapture * MetaInputCapture *

View File

@ -56,12 +56,6 @@ meta_eis_get_backend (MetaEis *eis)
return eis->backend; return eis->backend;
} }
void
meta_eis_remove_all_clients (MetaEis *eis)
{
g_hash_table_remove_all (eis->eis_clients);
}
static void static void
meta_eis_remove_client (MetaEis *eis, meta_eis_remove_client (MetaEis *eis,
struct eis_client *eis_client) struct eis_client *eis_client)

View File

@ -32,4 +32,3 @@ G_DECLARE_FINAL_TYPE (MetaEis, meta_eis,
MetaEis * meta_eis_new (MetaBackend *backend); MetaEis * meta_eis_new (MetaBackend *backend);
MetaBackend * meta_eis_get_backend (MetaEis *eis); MetaBackend * meta_eis_get_backend (MetaEis *eis);
int meta_eis_add_client_get_fd (MetaEis *eis); int meta_eis_add_client_get_fd (MetaEis *eis);
void meta_eis_remove_all_clients (MetaEis *eis);

View File

@ -88,6 +88,7 @@ struct _MetaRemoteDesktopSession
gulong screen_cast_session_closed_handler_id; gulong screen_cast_session_closed_handler_id;
guint started : 1; guint started : 1;
MetaEis *eis;
ClutterVirtualInputDevice *virtual_pointer; ClutterVirtualInputDevice *virtual_pointer;
ClutterVirtualInputDevice *virtual_keyboard; ClutterVirtualInputDevice *virtual_keyboard;
ClutterVirtualInputDevice *virtual_touchscreen; ClutterVirtualInputDevice *virtual_touchscreen;
@ -223,8 +224,6 @@ meta_remote_desktop_session_close (MetaDbusSession *dbus_session)
{ {
MetaRemoteDesktopSession *session = MetaRemoteDesktopSession *session =
META_REMOTE_DESKTOP_SESSION (dbus_session); META_REMOTE_DESKTOP_SESSION (dbus_session);
MetaBackend *backend =
meta_dbus_session_manager_get_backend (session->session_manager);
MetaDBusRemoteDesktopSession *skeleton = MetaDBusRemoteDesktopSession *skeleton =
META_DBUS_REMOTE_DESKTOP_SESSION (session); META_DBUS_REMOTE_DESKTOP_SESSION (session);
@ -244,6 +243,7 @@ meta_remote_desktop_session_close (MetaDbusSession *dbus_session)
g_clear_object (&session->virtual_pointer); g_clear_object (&session->virtual_pointer);
g_clear_object (&session->virtual_keyboard); g_clear_object (&session->virtual_keyboard);
g_clear_object (&session->virtual_touchscreen); g_clear_object (&session->virtual_touchscreen);
g_clear_object (&session->eis);
meta_dbus_session_notify_closed (META_DBUS_SESSION (session)); meta_dbus_session_notify_closed (META_DBUS_SESSION (session));
meta_dbus_remote_desktop_session_emit_closed (skeleton); meta_dbus_remote_desktop_session_emit_closed (skeleton);
@ -257,8 +257,6 @@ meta_remote_desktop_session_close (MetaDbusSession *dbus_session)
meta_remote_access_handle_notify_stopped (remote_access_handle); meta_remote_access_handle_notify_stopped (remote_access_handle);
} }
meta_eis_remove_all_clients (meta_backend_get_eis (backend));
g_object_unref (session); g_object_unref (session);
} }
@ -1641,11 +1639,11 @@ handle_connect_to_eis (MetaDBusRemoteDesktopSession *skeleton,
int fd_idx; int fd_idx;
GVariant *fd_variant; GVariant *fd_variant;
int fd; int fd;
MetaEis *meis;
meis = meta_backend_get_eis (backend); if (!session->eis)
session->eis = meta_eis_new (backend);
fd = meta_eis_add_client_get_fd (meis); fd = meta_eis_add_client_get_fd (session->eis);
if (fd < 0) if (fd < 0)
{ {
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,