mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
remote-desktop/session: Only add configured streams as viewports
This means they will have a valid size/position. This makes absolute pointer events work on virtual monitor streams again. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3241>
This commit is contained in:
parent
264d29b435
commit
1a1a16324b
@ -321,12 +321,34 @@ ensure_virtual_device (MetaRemoteDesktopSession *session,
|
||||
*virtual_device_ptr = clutter_seat_create_virtual_device (seat, device_type);
|
||||
}
|
||||
|
||||
static void
|
||||
on_stream_is_configured (MetaScreenCastStream *stream,
|
||||
GParamSpec *pspec,
|
||||
MetaRemoteDesktopSession *session)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (stream,
|
||||
on_stream_is_configured,
|
||||
session);
|
||||
|
||||
g_return_if_fail (meta_screen_cast_stream_is_configured (stream));
|
||||
|
||||
meta_eis_add_viewport (session->eis, META_EIS_VIEWPORT (stream));
|
||||
}
|
||||
|
||||
static void
|
||||
on_stream_added (MetaScreenCastSession *screen_cast_session,
|
||||
MetaScreenCastStream *stream,
|
||||
MetaRemoteDesktopSession *session)
|
||||
{
|
||||
meta_eis_add_viewport (session->eis, META_EIS_VIEWPORT (stream));
|
||||
if (meta_screen_cast_stream_is_configured (stream))
|
||||
{
|
||||
meta_eis_add_viewport (session->eis, META_EIS_VIEWPORT (stream));
|
||||
}
|
||||
else
|
||||
{
|
||||
g_signal_connect (stream, "notify::is-configured",
|
||||
G_CALLBACK (on_stream_is_configured), session);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@ -334,7 +356,10 @@ on_stream_removed (MetaScreenCastSession *screen_cast_session,
|
||||
MetaScreenCastStream *stream,
|
||||
MetaRemoteDesktopSession *session)
|
||||
{
|
||||
meta_eis_remove_viewport (session->eis, META_EIS_VIEWPORT (stream));
|
||||
if (g_signal_handlers_disconnect_by_func (stream,
|
||||
on_stream_is_configured,
|
||||
session) == 0)
|
||||
meta_eis_remove_viewport (session->eis, META_EIS_VIEWPORT (stream));
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user