commit 392a4875b151236e444643236ded47f9b948dcb1
parent 294be06dc6b4b2f1531fd8577bcabdabc6dddab8
Author: Alexander Kojevnikov <alexander@kojevnikov.com>
Date: Tue, 19 Apr 2011 22:24:09 +0800
osx: Replace Ctrl-X shortcuts with Cmd-X
Diffstat:
1 file changed, 14 insertions(+), 0 deletions(-)
diff --git a/src/spek-platform.c b/src/spek-platform.c
@@ -65,6 +65,18 @@ void spek_platform_fix_args (gchar **argv, gint argc) {
#endif
}
+#ifdef G_OS_DARWIN
+static void accel_map_foreach (gpointer data, const gchar *accel_path, guint accel_key, GdkModifierType
+accel_mods, gboolean changed)
+{
+ if (accel_mods & GDK_CONTROL_MASK) {
+ accel_mods &= ~GDK_CONTROL_MASK;
+ accel_mods |= GDK_META_MASK;
+ gtk_accel_map_change_entry (accel_path, accel_key, accel_mods, FALSE);
+ }
+}
+#endif
+
void spek_platform_fix_ui (GtkUIManager *ui)
{
#ifdef G_OS_DARWIN
@@ -90,6 +102,8 @@ void spek_platform_fix_ui (GtkUIManager *ui)
group = gtk_osxapplication_add_app_menu_group (app);
gtk_osxapplication_add_app_menu_item (app, group, GTK_MENU_ITEM (edit_preferences));
+ gtk_accel_map_foreach (NULL, accel_map_foreach);
+
gtk_osxapplication_ready (app);
#endif
}