15708
|
1 |
diff -uprN metacity-2.26.0/src/core/schema-bindings.c metacity-2.26.0-new/src/core/schema-bindings.c
|
|
2 |
--- metacity-2.26.0/src/core/schema-bindings.c 2009-02-05 09:10:05.000000000 +0800
|
|
3 |
+++ metacity-2.26.0-new/src/core/schema-bindings.c 2009-05-04 13:49:09.440307433 +0800
|
|
4 |
@@ -87,6 +87,46 @@ single_stanza (gboolean is_window, const
|
|
5 |
g_free (escaped_default_value);
|
|
6 |
}
|
|
7 |
|
|
8 |
+static void
|
|
9 |
+single_list_stanza (gboolean is_window, const char *name,
|
|
10 |
+ const char *default_value,
|
|
11 |
+ gboolean can_reverse,
|
|
12 |
+ const char *description)
|
|
13 |
+{
|
|
14 |
+ char *keybinding_type = is_window? "window": "global";
|
|
15 |
+ char *escaped_default_value, *escaped_description;
|
|
16 |
+
|
|
17 |
+ if (description==NULL)
|
|
18 |
+ return; /* it must be undocumented, so it can't go in this table */
|
|
19 |
+
|
|
20 |
+ escaped_description = g_markup_escape_text (description, -1);
|
|
21 |
+ escaped_default_value = default_value==NULL? "disabled":
|
|
22 |
+ g_markup_escape_text (default_value, -1);
|
|
23 |
+
|
|
24 |
+ fprintf (target_file, " <schema>\n");
|
|
25 |
+ fprintf (target_file, " <key>/schemas/apps/metacity/%s_keybindings/%s_list</key>\n",
|
|
26 |
+ keybinding_type, name);
|
|
27 |
+ fprintf (target_file, " <applyto>/apps/metacity/%s_keybindings/%s_list</applyto>\n",
|
|
28 |
+ keybinding_type, name);
|
|
29 |
+ fprintf (target_file, " <owner>metacity</owner>\n");
|
|
30 |
+ fprintf (target_file, " <type>list</type>\n");
|
|
31 |
+ fprintf (target_file, " <list_type>string</list_type>\n");
|
|
32 |
+ fprintf (target_file, " <default>[%s]</default>\n", escaped_default_value);
|
|
33 |
+
|
|
34 |
+ fprintf (target_file, " <locale name=\"C\">\n");
|
|
35 |
+ fprintf (target_file, " <short>%s</short>\n", description);
|
|
36 |
+ fprintf (target_file, " <long>%s</long>\n",
|
|
37 |
+ can_reverse? about_reversible_keybindings:
|
|
38 |
+ about_keybindings);
|
|
39 |
+ fprintf (target_file, " </locale>\n");
|
|
40 |
+ fprintf (target_file, " </schema>\n\n");
|
|
41 |
+
|
|
42 |
+ g_free (escaped_description);
|
|
43 |
+
|
|
44 |
+ if (default_value!=NULL)
|
|
45 |
+ g_free (escaped_default_value);
|
|
46 |
+}
|
|
47 |
+
|
|
48 |
static void produce_bindings ();
|
|
49 |
|
|
50 |
static void
|
|
51 |
@@ -130,6 +170,13 @@ produce_bindings ()
|
|
52 |
stroke, \
|
|
53 |
flags & BINDING_REVERSES, \
|
|
54 |
description);
|
|
55 |
+#define list_keybind(name, handler, param, flags, stroke, description) \
|
|
56 |
+ single_list_stanza ( \
|
|
57 |
+ flags & BINDING_PER_WINDOW, \
|
|
58 |
+ #name, \
|
|
59 |
+ stroke, \
|
|
60 |
+ flags & BINDING_REVERSES, \
|
|
61 |
+ description);
|
|
62 |
#include "all-keybindings.h"
|
|
63 |
#undef keybind
|
|
64 |
}
|
|
65 |
diff -uprN metacity-2.26.0/src/include/all-keybindings.h metacity-2.26.0-new/src/include/all-keybindings.h
|
|
66 |
--- metacity-2.26.0/src/include/all-keybindings.h 2009-02-05 09:10:04.000000000 +0800
|
|
67 |
+++ metacity-2.26.0-new/src/include/all-keybindings.h 2009-05-04 13:54:10.708519198 +0800
|
|
68 |
@@ -68,6 +68,10 @@
|
|
69 |
#error "keybind () must be defined when you include screen-bindings.h"
|
|
70 |
#endif
|
|
71 |
|
|
72 |
+#ifndef list_keybind
|
|
73 |
+#define list_keybind keybind
|
|
74 |
+#endif
|
|
75 |
+
|
|
76 |
/***********************************/
|
|
77 |
|
|
78 |
#ifndef _BINDINGS_DEFINED_CONSTANTS
|
|
79 |
@@ -189,12 +193,20 @@ keybind (cycle_panels_backward, handl
|
|
80 |
|
|
81 |
keybind (show_desktop, handle_show_desktop, 0, 0, "<Control><Alt>d",
|
|
82 |
_("Hide all normal windows and set focus to the desktop"))
|
|
83 |
+list_keybind (show_desktop, handle_show_desktop, 0, 0, "<Mod4>d",
|
|
84 |
+ _("Hide all normal windows and set focus to the desktop"))
|
|
85 |
keybind (panel_main_menu, handle_panel,
|
|
86 |
META_KEYBINDING_ACTION_PANEL_MAIN_MENU, 0, "<Alt>F1",
|
|
87 |
_("Show the panel's main menu"))
|
|
88 |
+list_keybind (panel_main_menu, handle_panel,
|
|
89 |
+ META_KEYBINDING_ACTION_PANEL_MAIN_MENU, 0, "<Control>Escape",
|
|
90 |
+ _("Show the panel's main menu"))
|
|
91 |
keybind (panel_run_dialog, handle_panel,
|
|
92 |
META_KEYBINDING_ACTION_PANEL_RUN_DIALOG, 0, "<Alt>F2",
|
|
93 |
_("Show the panel's \"Run Application\" dialog box"))
|
|
94 |
+list_keybind (panel_run_dialog, handle_panel,
|
|
95 |
+ META_KEYBINDING_ACTION_PANEL_RUN_DIALOG, 0, "<Mod4>r",
|
|
96 |
+ _("Show the panel's \"Run Application\" dialog box"))
|
|
97 |
|
|
98 |
/* Yes, the param is offset by one. Historical reasons. (Maybe worth fixing
|
|
99 |
* at some point.) The description is NULL here because the stanza is
|
|
100 |
@@ -270,6 +282,8 @@ keybind (toggle_shaded, handle_toggle_sh
|
|
101 |
_("Toggle shaded state"))
|
|
102 |
keybind (minimize, handle_minimize, 0, BINDING_PER_WINDOW, "<Alt>F9",
|
|
103 |
_("Minimize window"))
|
|
104 |
+list_keybind (minimize, handle_minimize, 0, BINDING_PER_WINDOW, "F17",
|
|
105 |
+ _("Minimize window"))
|
|
106 |
keybind (close, handle_close, 0, BINDING_PER_WINDOW, "<Alt>F4",
|
|
107 |
_("Close window"))
|
|
108 |
keybind (begin_move, handle_begin_move, 0, BINDING_PER_WINDOW, "<Alt>F7",
|
15974
|
109 |
@@ -338,7 +338,7 @@
|
|
110 |
META_MOTION_DOWN, BINDING_PER_WINDOW, "<Control><Shift><Alt>Down",
|
|
111 |
_("Move window one workspace down"))
|
|
112 |
|
|
113 |
-keybind (raise_or_lower, handle_raise_or_lower, 0, BINDING_PER_WINDOW, NULL,
|
|
114 |
+keybind (raise_or_lower, handle_raise_or_lower, 0, BINDING_PER_WINDOW, "F15",
|
|
115 |
_("Raise window if it's covered by another window, otherwise lower it"))
|
|
116 |
keybind (raise, handle_raise, 0, BINDING_PER_WINDOW, NULL,
|
|
117 |
_("Raise window above other windows"))
|
16986
|
118 |
@@ -346,7 +360,7 @@ keybind (lower, handle_lower, 0, BINDING
|
|
119 |
_("Lower window below other windows"))
|
|
120 |
|
|
121 |
keybind (maximize_vertically, handle_maximize_vertically, 0,
|
|
122 |
- BINDING_PER_WINDOW, NULL,
|
|
123 |
+ BINDING_PER_WINDOW, "<Shift><Alt>F10",
|
|
124 |
_("Maximize window vertically"))
|
|
125 |
|
|
126 |
keybind (maximize_horizontally, handle_maximize_horizontally, 0,
|