[gnome-settings-daemon] media-keys: Move some metacity shortcuts into g-s-d



commit f32ae44259468baedc2044403237301ab7c0cd7b
Author: Florian MÃllner <fmuellner gnome org>
Date:   Mon Nov 7 18:13:15 2011 +0100

    media-keys: Move some metacity shortcuts into g-s-d
    
    The shortcuts for launching a terminal and taking screenshots have
    been provided by the wm historically, but it makes more sense to
    handle them like other global shortcuts in the media-keys plugin.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=663623

 ...ngs-daemon.plugins.media-keys.gschema.xml.in.in |   10 ++++++++++
 plugins/media-keys/gsd-media-keys-manager.c        |    6 ++++++
 plugins/media-keys/shortcuts-list.h                |    4 ++++
 3 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/data/org.gnome.settings-daemon.plugins.media-keys.gschema.xml.in.in b/data/org.gnome.settings-daemon.plugins.media-keys.gschema.xml.in.in
index 85438c5..7383082 100644
--- a/data/org.gnome.settings-daemon.plugins.media-keys.gschema.xml.in.in
+++ b/data/org.gnome.settings-daemon.plugins.media-keys.gschema.xml.in.in
@@ -95,6 +95,16 @@
       <_summary>Volume up</_summary>
       <_description>Binding to raise the system volume.</_description>
     </key>
+    <key name="screenshot" type="s">
+      <default>'Print'</default>
+      <_summary>Take a screenshot</_summary>
+      <_description>Binding to take a screenshot.</_description>
+    </key>
+    <key name="window-screenshot" type="s">
+      <default>'&lt;Alt&gt;Print'</default>
+      <_summary>Take a screenshot of a window</_summary>
+      <_description>Binding to take a screenshot of a window.</_description>
+    </key>
     <key name="www" type="s">
       <default>'XF86WWW'</default>
       <_summary>Launch web browser</_summary>
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index 26b01d6..560de98 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -1778,6 +1778,12 @@ do_action (GsdMediaKeysManager *manager,
         case HELP_KEY:
                 do_url_action (manager, "ghelp", timestamp);
                 break;
+        case SCREENSHOT_KEY:
+                execute (manager, "gnome-screenshot", FALSE);
+                break;
+        case WINDOW_SCREENSHOT_KEY:
+                execute (manager, "gnome-screenshot --window", FALSE);
+                break;
         case WWW_KEY:
                 do_url_action (manager, "http", timestamp);
                 break;
diff --git a/plugins/media-keys/shortcuts-list.h b/plugins/media-keys/shortcuts-list.h
index 71b0f76..42a0649 100644
--- a/plugins/media-keys/shortcuts-list.h
+++ b/plugins/media-keys/shortcuts-list.h
@@ -44,6 +44,8 @@ typedef enum {
         EMAIL_KEY,
         SCREENSAVER_KEY,
         HELP_KEY,
+        SCREENSHOT_KEY,
+        WINDOW_SCREENSHOT_KEY,
         WWW_KEY,
         PLAY_KEY,
         PAUSE_KEY,
@@ -101,6 +103,8 @@ static struct {
         { SCREENSAVER_KEY, "screensaver", NULL },
         { SCREENSAVER_KEY, NULL, "XF86ScreenSaver" },
         { HELP_KEY, "help", NULL },
+        { SCREENSHOT_KEY, "screenshot", NULL },
+        { WINDOW_SCREENSHOT_KEY, "window-screenshot", NULL },
         { WWW_KEY, "www", NULL },
         { PLAY_KEY, "play", NULL },
         { PAUSE_KEY, "pause", NULL },



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