Skip to content

Commit

Permalink
H.G.Muller's patch to avoid collisions with built-in OSX text edit ac…
Browse files Browse the repository at this point in the history
…cellerators

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.
  • Loading branch information
Joshua Pettus committed Oct 27, 2015
1 parent 8126e25 commit 452daf8
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions gtk/xoptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 452daf8

Please sign in to comment.