diff --git a/gramps/gui/dialog.py b/gramps/gui/dialog.py index 0bb6d19ae..01f8f2cb9 100644 --- a/gramps/gui/dialog.py +++ b/gramps/gui/dialog.py @@ -35,6 +35,7 @@ _LOG = logging.getLogger(".dialog") #------------------------------------------------------------------------- from gi.repository import GObject from gi.repository import Gtk +from gi.repository import Gdk from gi.repository import GdkPixbuf #------------------------------------------------------------------------- @@ -46,6 +47,7 @@ from gramps.gen.const import GRAMPS_LOCALE as glocale _ = glocale.translation.gettext from gramps.gen.const import ICON, URL_BUGHOME from gramps.gen.config import config +from gramps.gen.constfunc import is_quartz from .glade import Glade from .display import display_url @@ -506,6 +508,12 @@ def main(args): win = Gtk.Window() win.set_title('Dialog test window') win.set_position(Gtk.WindowPosition.CENTER) + #Set the mnemonic modifier on Macs to alt-ctrl so that it + #doesn't interfere with the extended keyboard, see + #https://gramps-project.org/bugs/view.php?id=6943 + if is_quartz(): + win.set_mnemonic_modifier( + Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.MOD1_MASK) def cb(window, event): Gtk.main_quit() win.connect('delete-event', cb) diff --git a/gramps/gui/managedwindow.py b/gramps/gui/managedwindow.py index b21a33018..a6b41a1af 100644 --- a/gramps/gui/managedwindow.py +++ b/gramps/gui/managedwindow.py @@ -38,6 +38,7 @@ from io import StringIO # #------------------------------------------------------------------------- from gi.repository import Gtk +from gi.repository import Gdk #------------------------------------------------------------------------- # @@ -47,6 +48,7 @@ from gi.repository import Gtk from gramps.gen.const import GLADE_FILE, ICON from gramps.gen.errors import WindowActiveError from gramps.gen.config import config +from gramps.gen.constfunc import is_quartz from .glade import Glade #------------------------------------------------------------------------- @@ -488,6 +490,13 @@ class ManagedWindow: #closing the Gtk.Window must also close ManagedWindow self.window = window self.window.connect('delete-event', self.close) + #Set the mnemonic modifier on Macs to alt-ctrl so that it + #doesn't interfere with the extended keyboard, see + #https://gramps-project.org/bugs/view.php?id=6943 + if is_quartz(): + self.window.set_mnemonic_modifier( + Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.MOD1_MASK) + if self.modal: self.window.set_modal(True) # The following makes sure that we only have one modal window open; diff --git a/gramps/gui/viewmanager.py b/gramps/gui/viewmanager.py index 2c1f3f5f2..46e8dc69b 100644 --- a/gramps/gui/viewmanager.py +++ b/gramps/gui/viewmanager.py @@ -55,6 +55,7 @@ LOG = logging.getLogger(".") # #------------------------------------------------------------------------- from gi.repository import Gtk +from gi.repository import Gdk #------------------------------------------------------------------------- # @@ -394,7 +395,12 @@ class ViewManager(CLIManager): self.window.set_icon_from_file(ICON) self.window.set_default_size(width, height) self.window.move(horiz_position, vert_position) - + #Set the mnemonic modifier on Macs to alt-ctrl so that it + #doesn't interfere with the extended keyboard, see + #https://gramps-project.org/bugs/view.php?id=6943 + if is_quartz(): + self.window.set_mnemonic_modifier( + Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.MOD1_MASK) vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) self.window.add(vbox) hpane = Gtk.Paned() diff --git a/gramps/gui/widgets/validatedmaskedentry.py b/gramps/gui/widgets/validatedmaskedentry.py index 341a9fbc1..3235b9a52 100644 --- a/gramps/gui/widgets/validatedmaskedentry.py +++ b/gramps/gui/widgets/validatedmaskedentry.py @@ -52,7 +52,7 @@ from gi.repository import Pango #------------------------------------------------------------------------- from gramps.gen.errors import MaskError, ValidationError, WindowActiveError from .undoableentry import UndoableEntry - +from gramps.gen.constfunc import is_quartz #============================================================================ # # MaskedEntry and ValidatableMaskedEntry copied and merged from the Kiwi @@ -1248,6 +1248,12 @@ def main(args): win = Gtk.Window() win.set_title('ValidatableMaskedEntry test window') win.set_position(Gtk.WindowPosition.CENTER) + #Set the mnemonic modifier on Macs to alt-ctrl so that it + #doesn't interfere with the extended keyboard, see + #https://gramps-project.org/bugs/view.php?id=6943 + if is_quartz(): + win.set_mnemonic_modifier( + Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.MOD1_MASK) def cb(window, event): Gtk.main_quit() win.connect('delete-event', cb)