From 4fe1360b2c6deecfb2226da4738dfa5eee9a7a1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 22 May 2013 17:48:56 +0200 Subject: [PATCH] recorder: Hide cursor while magnifier is active The magnifier adds its own copy of the system cursor to apply the expected transformations, so we don't need to add it again in the recorder; this avoids two different cursors showing up in recordings, but doesn't address the case where the cursor should not be recorded at all, but the magnifier adds it anyway. https://bugzilla.gnome.org/show_bug.cgi?id=700488 --- src/shell-recorder.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/shell-recorder.c b/src/shell-recorder.c index 8d84a7ac1..eb0d44748 100644 --- a/src/shell-recorder.c +++ b/src/shell-recorder.c @@ -25,6 +25,9 @@ /* This is also hard-coded in mutter and GDK */ #define VIRTUAL_CORE_POINTER_ID 2 +#define A11Y_APPS_SCHEMA "org.gnome.desktop.a11y.applications" +#define MAGNIFIER_ACTIVE_KEY "screen-magnifier-enabled" + typedef enum { RECORDER_STATE_CLOSED, RECORDER_STATE_RECORDING @@ -68,6 +71,7 @@ struct _ShellRecorder { CoglHandle recording_icon; /* icon shown while playing */ + GSettings *a11y_settings; gboolean draw_cursor; cairo_surface_t *cursor_image; int cursor_hot_x; @@ -277,6 +281,8 @@ shell_recorder_init (ShellRecorder *recorder) recorder->recording_icon = create_recording_icon (); recorder->memory_target = get_memory_target(); + recorder->a11y_settings = g_settings_new (A11Y_APPS_SCHEMA); + recorder->state = RECORDER_STATE_CLOSED; recorder->framerate = DEFAULT_FRAMES_PER_SECOND; recorder->draw_cursor = TRUE; @@ -299,6 +305,8 @@ shell_recorder_finalize (GObject *object) cogl_handle_unref (recorder->recording_icon); + g_clear_object (&recorder->a11y_settings); + G_OBJECT_CLASS (shell_recorder_parent_class)->finalize (object); } @@ -580,7 +588,8 @@ recorder_record_frame (ShellRecorder *recorder) GST_BUFFER_PTS(buffer) = now - recorder->start_time; - if (recorder->draw_cursor) + if (recorder->draw_cursor && + !g_settings_get_boolean (recorder->a11y_settings, MAGNIFIER_ACTIVE_KEY)) recorder_draw_cursor (recorder, buffer); shell_recorder_src_add_buffer (SHELL_RECORDER_SRC (recorder->current_pipeline->src), buffer);