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:
parent
ce61c8dc61
commit
0160f3c0a0
@ -143,8 +143,6 @@ MetaDbusSessionWatcher * meta_backend_get_dbus_session_watcher (MetaBackend *bac
|
||||
MetaRemoteDesktop * meta_backend_get_remote_desktop (MetaBackend *backend);
|
||||
|
||||
MetaScreenCast * meta_backend_get_screen_cast (MetaBackend *backend);
|
||||
|
||||
MetaEis * meta_backend_get_eis (MetaBackend *backend);
|
||||
#endif
|
||||
|
||||
MetaInputCapture * meta_backend_get_input_capture (MetaBackend *backend);
|
||||
|
@ -78,7 +78,6 @@
|
||||
|
||||
#ifdef HAVE_REMOTE_DESKTOP
|
||||
#include "backends/meta-dbus-session-watcher.h"
|
||||
#include "backends/meta-eis.h"
|
||||
#include "backends/meta-remote-access-controller-private.h"
|
||||
#include "backends/meta-remote-desktop.h"
|
||||
#include "backends/meta-screen-cast.h"
|
||||
@ -140,7 +139,6 @@ struct _MetaBackendPrivate
|
||||
#ifdef HAVE_REMOTE_DESKTOP
|
||||
MetaScreenCast *screen_cast;
|
||||
MetaRemoteDesktop *remote_desktop;
|
||||
MetaEis *eis;
|
||||
#endif
|
||||
MetaInputCapture *input_capture;
|
||||
|
||||
@ -210,7 +208,6 @@ meta_backend_dispose (GObject *object)
|
||||
#ifdef HAVE_REMOTE_DESKTOP
|
||||
g_clear_object (&priv->remote_desktop);
|
||||
g_clear_object (&priv->screen_cast);
|
||||
g_clear_object (&priv->eis);
|
||||
#endif
|
||||
g_clear_object (&priv->input_capture);
|
||||
g_clear_object (&priv->dbus_session_watcher);
|
||||
@ -584,7 +581,6 @@ meta_backend_real_post_init (MetaBackend *backend)
|
||||
meta_remote_access_controller_add (
|
||||
priv->remote_access_controller,
|
||||
META_DBUS_SESSION_MANAGER (priv->remote_desktop));
|
||||
priv->eis = meta_eis_new (backend);
|
||||
#endif /* HAVE_REMOTE_DESKTOP */
|
||||
|
||||
priv->input_capture = meta_input_capture_new (backend);
|
||||
@ -1443,16 +1439,6 @@ meta_backend_get_screen_cast (MetaBackend *backend)
|
||||
|
||||
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 */
|
||||
|
||||
MetaInputCapture *
|
||||
|
@ -56,12 +56,6 @@ meta_eis_get_backend (MetaEis *eis)
|
||||
return eis->backend;
|
||||
}
|
||||
|
||||
void
|
||||
meta_eis_remove_all_clients (MetaEis *eis)
|
||||
{
|
||||
g_hash_table_remove_all (eis->eis_clients);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_eis_remove_client (MetaEis *eis,
|
||||
struct eis_client *eis_client)
|
||||
|
@ -32,4 +32,3 @@ G_DECLARE_FINAL_TYPE (MetaEis, meta_eis,
|
||||
MetaEis * meta_eis_new (MetaBackend *backend);
|
||||
MetaBackend * meta_eis_get_backend (MetaEis *eis);
|
||||
int meta_eis_add_client_get_fd (MetaEis *eis);
|
||||
void meta_eis_remove_all_clients (MetaEis *eis);
|
||||
|
@ -88,6 +88,7 @@ struct _MetaRemoteDesktopSession
|
||||
gulong screen_cast_session_closed_handler_id;
|
||||
guint started : 1;
|
||||
|
||||
MetaEis *eis;
|
||||
ClutterVirtualInputDevice *virtual_pointer;
|
||||
ClutterVirtualInputDevice *virtual_keyboard;
|
||||
ClutterVirtualInputDevice *virtual_touchscreen;
|
||||
@ -223,8 +224,6 @@ meta_remote_desktop_session_close (MetaDbusSession *dbus_session)
|
||||
{
|
||||
MetaRemoteDesktopSession *session =
|
||||
META_REMOTE_DESKTOP_SESSION (dbus_session);
|
||||
MetaBackend *backend =
|
||||
meta_dbus_session_manager_get_backend (session->session_manager);
|
||||
MetaDBusRemoteDesktopSession *skeleton =
|
||||
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_keyboard);
|
||||
g_clear_object (&session->virtual_touchscreen);
|
||||
g_clear_object (&session->eis);
|
||||
|
||||
meta_dbus_session_notify_closed (META_DBUS_SESSION (session));
|
||||
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_eis_remove_all_clients (meta_backend_get_eis (backend));
|
||||
|
||||
g_object_unref (session);
|
||||
}
|
||||
|
||||
@ -1641,11 +1639,11 @@ handle_connect_to_eis (MetaDBusRemoteDesktopSession *skeleton,
|
||||
int fd_idx;
|
||||
GVariant *fd_variant;
|
||||
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)
|
||||
{
|
||||
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
||||
|
Loading…
Reference in New Issue
Block a user