mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
screen-cast: Clean up sessions on 'prepare-shutdown'
However, leave the remote desktop screen cast sessions to the remote desktop manager to close. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1891>
This commit is contained in:
parent
97c6a68b0d
commit
2a81c6d393
@ -194,6 +194,12 @@ meta_screen_cast_session_get_peer_name (MetaScreenCastSession *session)
|
||||
return session->peer_name;
|
||||
}
|
||||
|
||||
MetaScreenCastSessionType
|
||||
meta_screen_cast_session_get_session_type (MetaScreenCastSession *session)
|
||||
{
|
||||
return session->session_type;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
check_permission (MetaScreenCastSession *session,
|
||||
GDBusMethodInvocation *invocation)
|
||||
|
@ -49,6 +49,8 @@ char * meta_screen_cast_session_get_object_path (MetaScreenCastSession *session)
|
||||
|
||||
char * meta_screen_cast_session_get_peer_name (MetaScreenCastSession *session);
|
||||
|
||||
MetaScreenCastSessionType meta_screen_cast_session_get_session_type (MetaScreenCastSession *session);
|
||||
|
||||
MetaScreenCastSession * meta_screen_cast_session_new (MetaScreenCast *screen_cast,
|
||||
MetaScreenCastSessionType session_type,
|
||||
const char *peer_name,
|
||||
|
@ -323,14 +323,23 @@ meta_screen_cast_finalize (GObject *object)
|
||||
if (screen_cast->dbus_name_id)
|
||||
g_bus_unown_name (screen_cast->dbus_name_id);
|
||||
|
||||
g_assert (!screen_cast->sessions);
|
||||
|
||||
G_OBJECT_CLASS (meta_screen_cast_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
on_prepare_shutdown (MetaBackend *backend,
|
||||
MetaScreenCast *screen_cast)
|
||||
{
|
||||
while (screen_cast->sessions)
|
||||
{
|
||||
MetaScreenCastSession *session = screen_cast->sessions->data;
|
||||
|
||||
meta_screen_cast_session_close (session);
|
||||
if (meta_screen_cast_session_get_session_type (session) !=
|
||||
META_SCREEN_CAST_SESSION_TYPE_REMOTE_DESKTOP)
|
||||
meta_screen_cast_session_close (session);
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (meta_screen_cast_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
MetaScreenCast *
|
||||
@ -343,6 +352,10 @@ meta_screen_cast_new (MetaBackend *backend,
|
||||
screen_cast->backend = backend;
|
||||
screen_cast->session_watcher = session_watcher;
|
||||
|
||||
g_signal_connect (backend, "prepare-shutdown",
|
||||
G_CALLBACK (on_prepare_shutdown),
|
||||
screen_cast);
|
||||
|
||||
return screen_cast;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user