[mutter] remote-desktop/virtual: Drop absolute events if not active
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] remote-desktop/virtual: Drop absolute events if not active
- Date: Fri, 4 Mar 2022 19:04:53 +0000 (UTC)
commit 1e50ca005744c6aab68cff2c603795a1e4717e60
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Wed Mar 2 11:24:40 2022 +0100
remote-desktop/virtual: Drop absolute events if not active
If the remote desktop service emits absolute input events (e.g. absolute
pointer events) before the stream has started streaming, we don't have a
virtual monitor, as the size has not been negotiated yet. When this
happens, just drop the event. Remote desktop services should probably
make sure not to send events before the streaming has started, but them
doing so anyway shouldn't trigger a crash, which would be the case
otherwise.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2270>
src/backends/meta-screen-cast-stream-src.c | 2 +-
src/backends/meta-screen-cast-stream-src.h | 2 ++
src/backends/meta-screen-cast-virtual-stream.c | 3 +++
3 files changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/backends/meta-screen-cast-stream-src.c b/src/backends/meta-screen-cast-stream-src.c
index e86f9a2b7c..539cd998e3 100644
--- a/src/backends/meta-screen-cast-stream-src.c
+++ b/src/backends/meta-screen-cast-stream-src.c
@@ -678,7 +678,7 @@ meta_screen_cast_stream_src_maybe_record_frame (MetaScreenCastStreamSrc *src,
pw_stream_queue_buffer (priv->pipewire_stream, buffer);
}
-static gboolean
+gboolean
meta_screen_cast_stream_src_is_enabled (MetaScreenCastStreamSrc *src)
{
MetaScreenCastStreamSrcPrivate *priv =
diff --git a/src/backends/meta-screen-cast-stream-src.h b/src/backends/meta-screen-cast-stream-src.h
index 0e14dbb61b..2eafa57242 100644
--- a/src/backends/meta-screen-cast-stream-src.h
+++ b/src/backends/meta-screen-cast-stream-src.h
@@ -82,6 +82,8 @@ struct _MetaScreenCastStreamSrcClass
void meta_screen_cast_stream_src_close (MetaScreenCastStreamSrc *src);
+gboolean meta_screen_cast_stream_src_is_enabled (MetaScreenCastStreamSrc *src);
+
void meta_screen_cast_stream_src_maybe_record_frame (MetaScreenCastStreamSrc *src,
MetaScreenCastRecordFlag flags);
diff --git a/src/backends/meta-screen-cast-virtual-stream.c b/src/backends/meta-screen-cast-virtual-stream.c
index 34dd2a00cc..46f187c434 100644
--- a/src/backends/meta-screen-cast-virtual-stream.c
+++ b/src/backends/meta-screen-cast-virtual-stream.c
@@ -93,6 +93,9 @@ meta_screen_cast_virtual_stream_transform_position (MetaScreenCastStream *stream
ClutterStageView *view;
MetaRectangle view_layout;
+ if (!meta_screen_cast_stream_src_is_enabled (src))
+ return FALSE;
+
view = meta_screen_cast_virtual_stream_src_get_view (virtual_src);
if (!view)
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]