Set the mnemonic modifier key to Alt-Ctrl for the Quartz Gdk backend.
This avoids interference with the use of the Alt/Option key for extending the keyboard. Fixes #6943.
This commit is contained in:
parent
3d7479969f
commit
0a38a6352f
@ -35,6 +35,7 @@ _LOG = logging.getLogger(".dialog")
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from gi.repository import GObject
|
from gi.repository import GObject
|
||||||
from gi.repository import Gtk
|
from gi.repository import Gtk
|
||||||
|
from gi.repository import Gdk
|
||||||
from gi.repository import GdkPixbuf
|
from gi.repository import GdkPixbuf
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@ -46,6 +47,7 @@ from gramps.gen.const import GRAMPS_LOCALE as glocale
|
|||||||
_ = glocale.translation.gettext
|
_ = glocale.translation.gettext
|
||||||
from gramps.gen.const import ICON, URL_BUGHOME
|
from gramps.gen.const import ICON, URL_BUGHOME
|
||||||
from gramps.gen.config import config
|
from gramps.gen.config import config
|
||||||
|
from gramps.gen.constfunc import is_quartz
|
||||||
from .glade import Glade
|
from .glade import Glade
|
||||||
from .display import display_url
|
from .display import display_url
|
||||||
|
|
||||||
@ -506,6 +508,12 @@ def main(args):
|
|||||||
win = Gtk.Window()
|
win = Gtk.Window()
|
||||||
win.set_title('Dialog test window')
|
win.set_title('Dialog test window')
|
||||||
win.set_position(Gtk.WindowPosition.CENTER)
|
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):
|
def cb(window, event):
|
||||||
Gtk.main_quit()
|
Gtk.main_quit()
|
||||||
win.connect('delete-event', cb)
|
win.connect('delete-event', cb)
|
||||||
|
@ -38,6 +38,7 @@ from io import StringIO
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from gi.repository import Gtk
|
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.const import GLADE_FILE, ICON
|
||||||
from gramps.gen.errors import WindowActiveError
|
from gramps.gen.errors import WindowActiveError
|
||||||
from gramps.gen.config import config
|
from gramps.gen.config import config
|
||||||
|
from gramps.gen.constfunc import is_quartz
|
||||||
from .glade import Glade
|
from .glade import Glade
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@ -488,6 +490,13 @@ class ManagedWindow:
|
|||||||
#closing the Gtk.Window must also close ManagedWindow
|
#closing the Gtk.Window must also close ManagedWindow
|
||||||
self.window = window
|
self.window = window
|
||||||
self.window.connect('delete-event', self.close)
|
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:
|
if self.modal:
|
||||||
self.window.set_modal(True)
|
self.window.set_modal(True)
|
||||||
# The following makes sure that we only have one modal window open;
|
# The following makes sure that we only have one modal window open;
|
||||||
|
@ -55,6 +55,7 @@ LOG = logging.getLogger(".")
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from gi.repository import Gtk
|
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_icon_from_file(ICON)
|
||||||
self.window.set_default_size(width, height)
|
self.window.set_default_size(width, height)
|
||||||
self.window.move(horiz_position, vert_position)
|
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)
|
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||||
self.window.add(vbox)
|
self.window.add(vbox)
|
||||||
hpane = Gtk.Paned()
|
hpane = Gtk.Paned()
|
||||||
|
@ -52,7 +52,7 @@ from gi.repository import Pango
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from gramps.gen.errors import MaskError, ValidationError, WindowActiveError
|
from gramps.gen.errors import MaskError, ValidationError, WindowActiveError
|
||||||
from .undoableentry import UndoableEntry
|
from .undoableentry import UndoableEntry
|
||||||
|
from gramps.gen.constfunc import is_quartz
|
||||||
#============================================================================
|
#============================================================================
|
||||||
#
|
#
|
||||||
# MaskedEntry and ValidatableMaskedEntry copied and merged from the Kiwi
|
# MaskedEntry and ValidatableMaskedEntry copied and merged from the Kiwi
|
||||||
@ -1248,6 +1248,12 @@ def main(args):
|
|||||||
win = Gtk.Window()
|
win = Gtk.Window()
|
||||||
win.set_title('ValidatableMaskedEntry test window')
|
win.set_title('ValidatableMaskedEntry test window')
|
||||||
win.set_position(Gtk.WindowPosition.CENTER)
|
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):
|
def cb(window, event):
|
||||||
Gtk.main_quit()
|
Gtk.main_quit()
|
||||||
win.connect('delete-event', cb)
|
win.connect('delete-event', cb)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user