screen-cast: Add 'is-recording' option to record methods
This can be used by the Shell to change the UI to be the same as the current built in screen recording. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1377
This commit is contained in:
parent
14cd78a016
commit
153357cd36
@ -310,6 +310,7 @@ handle_record_monitor (MetaDBusScreenCastSession *skeleton,
|
|||||||
meta_backend_get_monitor_manager (backend);
|
meta_backend_get_monitor_manager (backend);
|
||||||
MetaMonitor *monitor;
|
MetaMonitor *monitor;
|
||||||
MetaScreenCastCursorMode cursor_mode;
|
MetaScreenCastCursorMode cursor_mode;
|
||||||
|
gboolean is_recording;
|
||||||
MetaScreenCastFlag flags;
|
MetaScreenCastFlag flags;
|
||||||
ClutterStage *stage;
|
ClutterStage *stage;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
@ -357,9 +358,14 @@ handle_record_monitor (MetaDBusScreenCastSession *skeleton,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!g_variant_lookup (properties_variant, "is-recording", "b", &is_recording))
|
||||||
|
is_recording = FALSE;
|
||||||
|
|
||||||
stage = CLUTTER_STAGE (meta_backend_get_stage (backend));
|
stage = CLUTTER_STAGE (meta_backend_get_stage (backend));
|
||||||
|
|
||||||
flags = META_SCREEN_CAST_FLAG_NONE;
|
flags = META_SCREEN_CAST_FLAG_NONE;
|
||||||
|
if (is_recording)
|
||||||
|
flags |= META_SCREEN_CAST_FLAG_IS_RECORDING;
|
||||||
|
|
||||||
monitor_stream = meta_screen_cast_monitor_stream_new (session,
|
monitor_stream = meta_screen_cast_monitor_stream_new (session,
|
||||||
connection,
|
connection,
|
||||||
@ -402,6 +408,7 @@ handle_record_window (MetaDBusScreenCastSession *skeleton,
|
|||||||
GDBusConnection *connection;
|
GDBusConnection *connection;
|
||||||
MetaWindow *window;
|
MetaWindow *window;
|
||||||
MetaScreenCastCursorMode cursor_mode;
|
MetaScreenCastCursorMode cursor_mode;
|
||||||
|
gboolean is_recording;
|
||||||
MetaScreenCastFlag flags;
|
MetaScreenCastFlag flags;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
MetaDisplay *display;
|
MetaDisplay *display;
|
||||||
@ -459,10 +466,15 @@ handle_record_window (MetaDBusScreenCastSession *skeleton,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!g_variant_lookup (properties_variant, "is-recording", "b", &is_recording))
|
||||||
|
is_recording = FALSE;
|
||||||
|
|
||||||
interface_skeleton = G_DBUS_INTERFACE_SKELETON (skeleton);
|
interface_skeleton = G_DBUS_INTERFACE_SKELETON (skeleton);
|
||||||
connection = g_dbus_interface_skeleton_get_connection (interface_skeleton);
|
connection = g_dbus_interface_skeleton_get_connection (interface_skeleton);
|
||||||
|
|
||||||
flags = META_SCREEN_CAST_FLAG_NONE;
|
flags = META_SCREEN_CAST_FLAG_NONE;
|
||||||
|
if (is_recording)
|
||||||
|
flags |= META_SCREEN_CAST_FLAG_IS_RECORDING;
|
||||||
|
|
||||||
window_stream = meta_screen_cast_window_stream_new (session,
|
window_stream = meta_screen_cast_window_stream_new (session,
|
||||||
connection,
|
connection,
|
||||||
@ -509,6 +521,7 @@ handle_record_area (MetaDBusScreenCastSession *skeleton,
|
|||||||
MetaBackend *backend;
|
MetaBackend *backend;
|
||||||
ClutterStage *stage;
|
ClutterStage *stage;
|
||||||
MetaScreenCastCursorMode cursor_mode;
|
MetaScreenCastCursorMode cursor_mode;
|
||||||
|
gboolean is_recording;
|
||||||
MetaScreenCastFlag flags;
|
MetaScreenCastFlag flags;
|
||||||
g_autoptr (GError) error = NULL;
|
g_autoptr (GError) error = NULL;
|
||||||
MetaRectangle rect;
|
MetaRectangle rect;
|
||||||
@ -539,12 +552,17 @@ handle_record_area (MetaDBusScreenCastSession *skeleton,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!g_variant_lookup (properties_variant, "is-recording", "b", &is_recording))
|
||||||
|
is_recording = FALSE;
|
||||||
|
|
||||||
interface_skeleton = G_DBUS_INTERFACE_SKELETON (skeleton);
|
interface_skeleton = G_DBUS_INTERFACE_SKELETON (skeleton);
|
||||||
connection = g_dbus_interface_skeleton_get_connection (interface_skeleton);
|
connection = g_dbus_interface_skeleton_get_connection (interface_skeleton);
|
||||||
backend = meta_screen_cast_get_backend (session->screen_cast);
|
backend = meta_screen_cast_get_backend (session->screen_cast);
|
||||||
stage = CLUTTER_STAGE (meta_backend_get_stage (backend));
|
stage = CLUTTER_STAGE (meta_backend_get_stage (backend));
|
||||||
|
|
||||||
flags = META_SCREEN_CAST_FLAG_NONE;
|
flags = META_SCREEN_CAST_FLAG_NONE;
|
||||||
|
if (is_recording)
|
||||||
|
flags |= META_SCREEN_CAST_FLAG_IS_RECORDING;
|
||||||
|
|
||||||
rect = (MetaRectangle) {
|
rect = (MetaRectangle) {
|
||||||
.x = x,
|
.x = x,
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#define META_SCREEN_CAST_DBUS_SERVICE "org.gnome.Mutter.ScreenCast"
|
#define META_SCREEN_CAST_DBUS_SERVICE "org.gnome.Mutter.ScreenCast"
|
||||||
#define META_SCREEN_CAST_DBUS_PATH "/org/gnome/Mutter/ScreenCast"
|
#define META_SCREEN_CAST_DBUS_PATH "/org/gnome/Mutter/ScreenCast"
|
||||||
#define META_SCREEN_CAST_API_VERSION 3
|
#define META_SCREEN_CAST_API_VERSION 4
|
||||||
|
|
||||||
struct _MetaScreenCast
|
struct _MetaScreenCast
|
||||||
{
|
{
|
||||||
|
@ -40,6 +40,7 @@ typedef enum _MetaScreenCastCursorMode
|
|||||||
typedef enum _MetaScreenCastFlag
|
typedef enum _MetaScreenCastFlag
|
||||||
{
|
{
|
||||||
META_SCREEN_CAST_FLAG_NONE = 0,
|
META_SCREEN_CAST_FLAG_NONE = 0,
|
||||||
|
META_SCREEN_CAST_FLAG_IS_RECORDING = 1 << 0,
|
||||||
} MetaScreenCastFlag;
|
} MetaScreenCastFlag;
|
||||||
|
|
||||||
#define META_TYPE_SCREEN_CAST (meta_screen_cast_get_type ())
|
#define META_TYPE_SCREEN_CAST (meta_screen_cast_get_type ())
|
||||||
|
@ -79,6 +79,9 @@
|
|||||||
|
|
||||||
* "cursor-mode" (u): Cursor mode. Default: 'hidden' (see below)
|
* "cursor-mode" (u): Cursor mode. Default: 'hidden' (see below)
|
||||||
Available since API version 2.
|
Available since API version 2.
|
||||||
|
* "is-recording" (b): Whether this is a screen recording. May be
|
||||||
|
be used for choosing appropriate visual feedback.
|
||||||
|
Default: false. Available since API version 4.
|
||||||
|
|
||||||
Available cursor mode values:
|
Available cursor mode values:
|
||||||
|
|
||||||
@ -105,6 +108,9 @@
|
|||||||
|
|
||||||
* "window-id" (t): Id of the window to record.
|
* "window-id" (t): Id of the window to record.
|
||||||
* "cursor-mode" (u): Cursor mode. Default: 'hidden' (see RecordMonitor).
|
* "cursor-mode" (u): Cursor mode. Default: 'hidden' (see RecordMonitor).
|
||||||
|
* "is-recording" (b): Whether this is a screen recording. May be
|
||||||
|
be used for choosing panel icon.
|
||||||
|
Default: false. Available since API version 4.
|
||||||
|
|
||||||
-->
|
-->
|
||||||
<method name="RecordWindow">
|
<method name="RecordWindow">
|
||||||
@ -129,6 +135,9 @@
|
|||||||
|
|
||||||
* "cursor-mode" (u): Cursor mode. Default: 'hidden' (see below)
|
* "cursor-mode" (u): Cursor mode. Default: 'hidden' (see below)
|
||||||
Available since API version 2.
|
Available since API version 2.
|
||||||
|
* "is-recording" (b): Whether this is a screen recording. May be
|
||||||
|
be used for choosing panel icon.
|
||||||
|
Default: false. Available since API version 4.
|
||||||
|
|
||||||
Available cursor mode values:
|
Available cursor mode values:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user