[gnome-shell] main: Move 'toggle-recording' binding into the shell



commit 4fea5b5ca3f96756284138ff9fd88f2d34de6c37
Author: Florian MÃllner <fmuellner gnome org>
Date:   Wed Apr 18 20:45:09 2012 +0200

    main: Move 'toggle-recording' binding into the shell
    
    The keybinding to toggle the screen recorder was implemented as a
    signal on MetaScreen, as keybindings could only be defined in mutter
    core. As this is no longer the case, we can move the binding into the
    shell where it belongs.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=674377

 data/org.gnome.shell.gschema.xml.in |    7 +++++++
 js/ui/main.js                       |    5 ++++-
 2 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/data/org.gnome.shell.gschema.xml.in b/data/org.gnome.shell.gschema.xml.in
index 92a239f..db23eda 100644
--- a/data/org.gnome.shell.gschema.xml.in
+++ b/data/org.gnome.shell.gschema.xml.in
@@ -88,6 +88,13 @@ value here is from the GsmPresenceStatus enumeration.</_summary>
         Keybinding to open the application menu.
       </_description>
     </key>
+    <key name="toggle-recording" type="as">
+      <default><![CDATA[['<Control><Shift><Alt>r']]]></default>
+      <_summary>Keybinding to toggle the screen recorder</_summary>
+      <_description>
+        Keybinding to start/stop the builtin screen recorder.
+      </_description>
+    </key>
   </schema>
 
   <schema id="org.gnome.shell.keyboard" path="/org/gnome/shell/keyboard/"
diff --git a/js/ui/main.js b/js/ui/main.js
index 07a3174..523dabf 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -101,8 +101,11 @@ function _createGDMSession() {
 
 function _initRecorder() {
     let recorderSettings = new Gio.Settings({ schema: 'org.gnome.shell.recorder' });
+    let bindingSettings = new Gio.Settings({ schema: 'org.gnome.shell.keybindings' });
 
-    global.screen.connect('toggle-recording', function() {
+    global.display.add_keybinding('toggle-recording',
+                                  bindingSettings,
+                                  Meta.KeyBindingFlags.NONE, function() {
         if (recorder == null) {
             recorder = new Shell.Recorder({ stage: global.stage });
         }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]