From 00095667e87ddd0bc6b699ad6b9e72c3a8637296 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Tue, 10 Oct 2017 13:41:32 -0700 Subject: [PATCH] Replace is_right_click implementation with Gdk.Event.triggers_context_menu(). --- gramps/gui/utils.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/gramps/gui/utils.py b/gramps/gui/utils.py index 88abaa043..4e8072367 100644 --- a/gramps/gui/utils.py +++ b/gramps/gui/utils.py @@ -467,21 +467,11 @@ def process_pending_events(max_count=10): def is_right_click(event): """ - Returns True if the event is a button-3 or equivalent + Returns True if the event is to open the context menu. """ from gi.repository import Gdk - - if event.type == Gdk.EventType.BUTTON_PRESS: - if is_quartz(): - # Catch quartz emulation of right-click for single-button - # mouse. Note that in this case we want CONTROL_MASK not - # PRIMARY_ACCELERATOR! - if (event.button == 3 - or (event.button == 1 and event.get_state() & Gdk.ModifierType.CONTROL_MASK)): - return True - - if event.button == 3: - return True + if Gdk.Event.triggers_context_menu(event): + return True def color_graph_box(alive=False, gender=Person.MALE): """