From 8e4e7498f755756037667e365793f88a2bdd6166 Mon Sep 17 00:00:00 2001 From: Joshua Pettus Date: Thu, 28 Jan 2016 17:55:56 -0500 Subject: [PATCH] H.G.Muller's patch to avoid collisions with built-in OSX text edit accellerators Unfortunately this means many of the menus items use the standard linux ctrl-letter style accelerators as oppose to the cmd-letter OSX style ones. But at least we can copy, paste, and cut text into xboard dialogs as well as select all. --- gtk/xoptions.c | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/gtk/xoptions.c b/gtk/xoptions.c index af2cdc8..c49d139 100644 --- a/gtk/xoptions.c +++ b/gtk/xoptions.c @@ -444,9 +444,19 @@ CreateMenuPopup (Option *opt, int n, int def) gtk_accelerator_parse(mb[i].accel, &accelerator_key, &accelerator_mods); #ifdef OSXAPP - if(accelerator_mods & GDK_CONTROL_MASK) { // in OSX use Meta where Linux uses Ctrl - accelerator_mods &= ~GDK_CONTROL_MASK; // clear Ctrl flag - accelerator_mods |= GDK_META_MASK; // set Meta flag + if(accelerator_mods & GDK_CONTROL_MASK && + accelerator_key != 'v' && // don't use Cmd+V + accelerator_key != 'c' && // and Cmd+C + accelerator_key != 'x' && // and CMD+X + accelerator_key != 'a' && // and CMD+A + accelerator_key != 'w' && // and evreything else in mode menu for umiformity's sake + accelerator_key != 'b' && + accelerator_key != 't' && + accelerator_key != 'g' && + accelerator_key != 'e' + ) { // in OSX use Meta (Cmd) where Linux uses Ctrl + accelerator_mods &= ~GDK_CONTROL_MASK; // clear Ctrl flag + accelerator_mods |= GDK_META_MASK; // set Meta flag } #endif gtk_widget_add_accelerator (GTK_WIDGET(entry), "activate",GtkAccelerators, -- 1.7.0.4