patches/metacity-02-shortcut.diff
author yippi
Mon, 27 Sep 2010 21:07:51 +0000
changeset 20108 51df67ca9307
parent 16986 fe96184d74b9
child 21819 9cd5115a9e9a
permissions -rw-r--r--
I had these modules listed as being owned by me, but they are really owned by wangke, correcting.

diff -uprN metacity-2.26.0/src/core/schema-bindings.c metacity-2.26.0-new/src/core/schema-bindings.c
--- metacity-2.26.0/src/core/schema-bindings.c	2009-02-05 09:10:05.000000000 +0800
+++ metacity-2.26.0-new/src/core/schema-bindings.c	2009-05-04 13:49:09.440307433 +0800
@@ -87,6 +87,46 @@ single_stanza (gboolean is_window, const
     g_free (escaped_default_value);
 }
 
+static void
+single_list_stanza (gboolean is_window, const char *name,
+               const char *default_value,
+               gboolean can_reverse,
+               const char *description)
+{
+  char *keybinding_type = is_window? "window": "global";
+  char *escaped_default_value, *escaped_description;
+
+  if (description==NULL)
+    return; /* it must be undocumented, so it can't go in this table */
+
+  escaped_description = g_markup_escape_text (description, -1);
+  escaped_default_value = default_value==NULL? "disabled":
+        g_markup_escape_text (default_value, -1);
+  
+  fprintf (target_file, "    <schema>\n");
+  fprintf (target_file, "      <key>/schemas/apps/metacity/%s_keybindings/%s_list</key>\n",
+            keybinding_type, name);
+  fprintf (target_file, "      <applyto>/apps/metacity/%s_keybindings/%s_list</applyto>\n",
+            keybinding_type, name);
+  fprintf (target_file, "      <owner>metacity</owner>\n");
+  fprintf (target_file, "      <type>list</type>\n");
+  fprintf (target_file, "      <list_type>string</list_type>\n");
+  fprintf (target_file, "      <default>[%s]</default>\n", escaped_default_value);
+  
+  fprintf (target_file, "      <locale name=\"C\">\n");
+  fprintf (target_file, "        <short>%s</short>\n", description);
+  fprintf (target_file, "        <long>%s</long>\n",
+                   can_reverse? about_reversible_keybindings:
+                   about_keybindings);
+  fprintf (target_file, "      </locale>\n");
+  fprintf (target_file, "    </schema>\n\n");
+
+  g_free (escaped_description);
+
+  if (default_value!=NULL)
+    g_free (escaped_default_value);
+}
+
 static void produce_bindings ();
 
 static void
@@ -130,6 +170,13 @@ produce_bindings ()
                stroke, \
                flags & BINDING_REVERSES, \
                description);
+#define list_keybind(name, handler, param, flags, stroke, description) \
+  single_list_stanza ( \
+               flags & BINDING_PER_WINDOW, \
+               #name, \
+               stroke, \
+               flags & BINDING_REVERSES, \
+               description);
 #include "all-keybindings.h"
 #undef keybind
     }
diff -uprN metacity-2.26.0/src/include/all-keybindings.h metacity-2.26.0-new/src/include/all-keybindings.h
--- metacity-2.26.0/src/include/all-keybindings.h	2009-02-05 09:10:04.000000000 +0800
+++ metacity-2.26.0-new/src/include/all-keybindings.h	2009-05-04 13:54:10.708519198 +0800
@@ -68,6 +68,10 @@
 #error "keybind () must be defined when you include screen-bindings.h"
 #endif
 
+#ifndef list_keybind
+#define list_keybind keybind
+#endif
+
 /***********************************/
 
 #ifndef _BINDINGS_DEFINED_CONSTANTS
@@ -189,12 +193,20 @@ keybind (cycle_panels_backward,    handl
      
 keybind (show_desktop, handle_show_desktop, 0, 0, "<Control><Alt>d",
       _("Hide all normal windows and set focus to the desktop"))
+list_keybind (show_desktop, handle_show_desktop, 0, 0, "<Mod4>d",
+      _("Hide all normal windows and set focus to the desktop"))
 keybind (panel_main_menu, handle_panel,
        META_KEYBINDING_ACTION_PANEL_MAIN_MENU, 0, "<Alt>F1",
       _("Show the panel's main menu"))
+list_keybind (panel_main_menu, handle_panel,
+       META_KEYBINDING_ACTION_PANEL_MAIN_MENU, 0, "<Control>Escape",
+      _("Show the panel's main menu"))
 keybind (panel_run_dialog, handle_panel,
        META_KEYBINDING_ACTION_PANEL_RUN_DIALOG, 0, "<Alt>F2",
       _("Show the panel's \"Run Application\" dialog box"))
+list_keybind (panel_run_dialog, handle_panel,
+       META_KEYBINDING_ACTION_PANEL_RUN_DIALOG, 0, "<Mod4>r",
+      _("Show the panel's \"Run Application\" dialog box"))
 
 /* Yes, the param is offset by one.  Historical reasons.  (Maybe worth fixing
  * at some point.)  The description is NULL here because the stanza is
@@ -270,6 +282,8 @@ keybind (toggle_shaded, handle_toggle_sh
         _("Toggle shaded state"))
 keybind (minimize, handle_minimize, 0, BINDING_PER_WINDOW, "<Alt>F9",
         _("Minimize window"))
+list_keybind (minimize, handle_minimize, 0, BINDING_PER_WINDOW, "F17",
+        _("Minimize window"))
 keybind (close, handle_close, 0, BINDING_PER_WINDOW, "<Alt>F4",
         _("Close window"))
 keybind (begin_move, handle_begin_move, 0, BINDING_PER_WINDOW, "<Alt>F7",
@@ -338,7 +338,7 @@
          META_MOTION_DOWN, BINDING_PER_WINDOW, "<Control><Shift><Alt>Down",
         _("Move window one workspace down"))
 
-keybind (raise_or_lower, handle_raise_or_lower, 0, BINDING_PER_WINDOW, NULL,
+keybind (raise_or_lower, handle_raise_or_lower, 0, BINDING_PER_WINDOW, "F15",
         _("Raise window if it's covered by another window, otherwise lower it"))
 keybind (raise, handle_raise, 0, BINDING_PER_WINDOW, NULL,
         _("Raise window above other windows"))
@@ -346,7 +360,7 @@ keybind (lower, handle_lower, 0, BINDING
         _("Lower window below other windows"))
 
 keybind (maximize_vertically, handle_maximize_vertically, 0,
-        BINDING_PER_WINDOW, NULL,
+        BINDING_PER_WINDOW, "<Shift><Alt>F10",
         _("Maximize window vertically"))
 
 keybind (maximize_horizontally, handle_maximize_horizontally, 0,