Merge lp:~darkxst/ubuntu/trusty/gnome-settings-daemon/lp1265127 into lp:~ubuntu-desktop/gnome-settings-daemon/ubuntu

Proposed by Tim Lunn
Status: Merged
Merged at revision: 452
Proposed branch: lp:~darkxst/ubuntu/trusty/gnome-settings-daemon/lp1265127
Merge into: lp:~ubuntu-desktop/gnome-settings-daemon/ubuntu
Diff against target: 225 lines (+205/-0)
3 files modified
debian/changelog (+8/-0)
debian/patches/git_new_screencast_keybinding.patch (+196/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~darkxst/ubuntu/trusty/gnome-settings-daemon/lp1265127
Reviewer Review Type Date Requested Status
Martin Pitt Approve
Sebastien Bacher Needs Information
Review via email: mp+201995@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for your work, what would happen under Unity sessions? Is that keybinding going to be listed in the UI but to do nothing? If that's the case we need to hide it from the interface

review: Needs Information
Revision history for this message
Tim Lunn (darkxst) wrote :

Seb, this patch does not expose the setting in gnome/unity-control-center.
That requires a seperate patch that would be applied only to gnome-control-center.

Revision history for this message
Martin Pitt (pitti) wrote :

Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2013-11-12 19:32:31 +0000
3+++ debian/changelog 2014-01-16 20:30:25 +0000
4@@ -1,3 +1,11 @@
5+gnome-settings-daemon (3.8.6.1-0ubuntu3) UNRELEASED; urgency=medium
6+
7+ * debian/patches/git_new_screencast_keybinding.patch: git patch to add
8+ required keybinding for gnome-shell screencasts. This is required by
9+ gnome-shell 3.10 (LP: #1265127)
10+
11+ -- Tim Lunn <tim@feathertop.org> Fri, 17 Jan 2014 07:19:26 +1100
12+
13 gnome-settings-daemon (3.8.6.1-0ubuntu2) trusty; urgency=low
14
15 * debian/patches/git_xsettings_segfaults.patch:
16
17=== added file 'debian/patches/git_new_screencast_keybinding.patch'
18--- debian/patches/git_new_screencast_keybinding.patch 1970-01-01 00:00:00 +0000
19+++ debian/patches/git_new_screencast_keybinding.patch 2014-01-16 20:30:25 +0000
20@@ -0,0 +1,196 @@
21+From 1ae70dc6ff141e248e8198ee1d82e1bec6ed4434 Mon Sep 17 00:00:00 2001
22+From: Jasper St. Pierre <jstpierre@mecheye.net>
23+Date: Thu, 18 Jul 2013 01:10:02 +0000
24+Subject: media-keys: Add a binding to take a short screencast of the screen
25+
26+https://bugzilla.gnome.org/show_bug.cgi?id=704435
27+---
28+--- a/data/org.gnome.settings-daemon.plugins.media-keys.gschema.xml.in.in
29++++ b/data/org.gnome.settings-daemon.plugins.media-keys.gschema.xml.in.in
30+@@ -135,6 +135,11 @@
31+ <_summary>Launch terminal</_summary>
32+ <_description>Binding to launch the terminal.</_description>
33+ </key>
34++ <key name="screencast" type="s">
35++ <default>'&lt;Ctrl&gt;&lt;Shift&gt;&lt;Alt&gt;R'</default>
36++ <_summary>Record a short video of the screen</_summary>
37++ <description>Binding to record a short video of the screen</description>
38++ </key>
39+ <key name="www" type="s">
40+ <default>'XF86WWW'</default>
41+ <_summary>Launch web browser</_summary>
42+--- a/plugins/media-keys/gsd-media-keys-manager.c
43++++ b/plugins/media-keys/gsd-media-keys-manager.c
44+@@ -86,6 +86,9 @@
45+
46+ #define SHELL_GRABBER_RETRY_INTERVAL 1
47+
48++/* Screencasts last for 5 mins */
49++#define SCREENCAST_LENGTH 300
50++
51+ static const gchar introspection_xml[] =
52+ "<node name='/org/gnome/SettingsDaemon/MediaKeys'>"
53+ " <interface name='org.gnome.SettingsDaemon.MediaKeys'>"
54+@@ -184,6 +187,11 @@
55+ GCancellable *shell_cancellable;
56+ GCancellable *grab_cancellable;
57+
58++ /* Screencast stuff */
59++ GDBusProxy *screencast_proxy;
60++ guint screencast_timeout_id;
61++ GCancellable *screencast_cancellable;
62++
63+ /* systemd stuff */
64+ GDBusProxy *logind_proxy;
65+ gint inhibit_keys_fd;
66+@@ -2368,6 +2376,61 @@
67+ }
68+
69+ static void
70++screencast_stop (GsdMediaKeysManager *manager)
71++{
72++ if (manager->priv->screencast_timeout_id > 0) {
73++ g_source_remove (manager->priv->screencast_timeout_id);
74++ manager->priv->screencast_timeout_id = 0;
75++ }
76++
77++ g_dbus_proxy_call (manager->priv->screencast_proxy,
78++ "StopScreencast", NULL,
79++ G_DBUS_CALL_FLAGS_NONE, -1,
80++ manager->priv->screencast_cancellable,
81++ NULL, NULL);
82++}
83++
84++static gboolean
85++screencast_timeout (gpointer user_data)
86++{
87++ GsdMediaKeysManager *manager = user_data;
88++ screencast_stop (manager);
89++ return G_SOURCE_REMOVE;
90++}
91++
92++static void
93++screencast_start (GsdMediaKeysManager *manager)
94++{
95++ g_dbus_proxy_call (manager->priv->screencast_proxy,
96++ "Screencast",
97++ /* Translators: this is a filename used for screencast
98++ * recording, where "%d" and "%t" date and time, e.g.
99++ * "Screencast from 07-17-2013 10:00:46 PM.webm" */
100++ /* xgettext:no-c-format */
101++ g_variant_new_parsed ("(%s, @a{sv} {})",
102++ _("Screencast from %d %t.webm")),
103++ G_DBUS_CALL_FLAGS_NONE, -1,
104++ manager->priv->screencast_cancellable,
105++ NULL, NULL);
106++
107++ manager->priv->screencast_timeout_id = g_timeout_add_seconds (SCREENCAST_LENGTH,
108++ screencast_timeout,
109++ manager);
110++}
111++
112++static void
113++do_screencast_action (GsdMediaKeysManager *manager)
114++{
115++ if (manager->priv->screencast_proxy == NULL)
116++ return;
117++
118++ if (manager->priv->screencast_timeout_id == 0)
119++ screencast_start (manager);
120++ else
121++ screencast_stop (manager);
122++}
123++
124++static void
125+ do_custom_action (GsdMediaKeysManager *manager,
126+ guint deviceid,
127+ MediaKey *key,
128+@@ -2445,6 +2508,9 @@
129+ case TERMINAL_KEY:
130+ do_terminal_action (manager);
131+ break;
132++ case SCREENCAST_KEY:
133++ do_screencast_action (manager);
134++ break;
135+ case WWW_KEY:
136+ do_url_action (manager, "http", timestamp);
137+ break;
138+@@ -2729,6 +2795,17 @@
139+ }
140+
141+ static void
142++on_screencast_proxy_ready (GObject *source,
143++ GAsyncResult *result,
144++ gpointer data)
145++{
146++ GsdMediaKeysManager *manager = data;
147++
148++ manager->priv->screencast_proxy =
149++ g_dbus_proxy_new_for_bus_finish (result, NULL);
150++}
151++
152++static void
153+ on_key_grabber_ready (GObject *source,
154+ GAsyncResult *result,
155+ gpointer data)
156+@@ -2772,6 +2849,14 @@
157+ SHELL_DBUS_NAME,
158+ manager->priv->shell_cancellable,
159+ on_shell_proxy_ready, manager);
160++
161++ g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION,
162++ 0, NULL,
163++ name_owner,
164++ SHELL_DBUS_PATH "/Screencast",
165++ SHELL_DBUS_NAME ".Screencast",
166++ manager->priv->screencast_cancellable,
167++ on_screencast_proxy_ready, manager);
168+ }
169+
170+ static void
171+@@ -2895,6 +2980,7 @@
172+
173+ ensure_cancellable (&manager->priv->grab_cancellable);
174+ ensure_cancellable (&manager->priv->shell_cancellable);
175++ ensure_cancellable (&manager->priv->screencast_cancellable);
176+
177+ manager->priv->name_owner_id =
178+ g_bus_watch_name (G_BUS_TYPE_SESSION,
179+@@ -2982,6 +3068,7 @@
180+ g_clear_object (&priv->power_proxy);
181+ g_clear_object (&priv->power_screen_proxy);
182+ g_clear_object (&priv->power_keyboard_proxy);
183++ g_clear_object (&priv->screencast_proxy);
184+
185+ if (manager->priv->name_owner_id) {
186+ g_bus_unwatch_name (manager->priv->name_owner_id);
187+@@ -3045,6 +3132,11 @@
188+ g_clear_object (&priv->shell_cancellable);
189+ }
190+
191++ if (priv->screencast_cancellable != NULL) {
192++ g_cancellable_cancel (priv->screencast_cancellable);
193++ g_clear_object (&priv->screencast_cancellable);
194++ }
195++
196+ g_clear_pointer (&priv->screens, g_slist_free);
197+ g_clear_object (&priv->sink);
198+ g_clear_object (&priv->source);
199+--- a/plugins/media-keys/shortcuts-list.h
200++++ b/plugins/media-keys/shortcuts-list.h
201+@@ -53,6 +53,7 @@
202+ SCREENSHOT_CLIP_KEY,
203+ WINDOW_SCREENSHOT_CLIP_KEY,
204+ AREA_SCREENSHOT_CLIP_KEY,
205++ SCREENCAST_KEY,
206+ TERMINAL_KEY,
207+ WWW_KEY,
208+ PLAY_KEY,
209+@@ -127,6 +128,7 @@
210+ { SCREENSHOT_CLIP_KEY, "screenshot-clip", NULL, NULL, SHELL_KEYBINDING_MODE_ALL },
211+ { WINDOW_SCREENSHOT_CLIP_KEY, "window-screenshot-clip", NULL, NULL, SHELL_KEYBINDING_MODE_NORMAL },
212+ { AREA_SCREENSHOT_CLIP_KEY, "area-screenshot-clip", NULL, NULL, SHELL_KEYBINDING_MODE_ALL },
213++ { SCREENCAST_KEY, "screencast", NULL, NULL, SHELL_KEYBINDING_MODE_ALL },
214+ { TERMINAL_KEY, "terminal", NULL, NULL, GSD_KEYBINDING_MODE_LAUNCHER },
215+ { WWW_KEY, "www", NULL, NULL, GSD_KEYBINDING_MODE_LAUNCHER },
216+ { PLAY_KEY, "play", NULL, NULL, SHELL_KEYBINDING_MODE_ALL },
217
218=== modified file 'debian/patches/series'
219--- debian/patches/series 2013-11-12 19:32:12 +0000
220+++ debian/patches/series 2014-01-16 20:30:25 +0000
221@@ -28,3 +28,4 @@
222 unity-modifier-media-keys.patch
223 ubuntu-lid-open-reset-ideletime.patch
224 git_xsettings_segfaults.patch
225+git_new_screencast_keybinding.patch

Subscribers

People subscribed via source and target branches

to all changes: