mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 22:20:24 +00:00
Merge branch 'macos-control-click' into 'main'
macos: Add Ctrl+left-click mapping for context menus Closes #6724 See merge request GNOME/gtk!7523
This commit is contained in:
commit
4b5d503cf0
@ -978,9 +978,13 @@ gdk_event_get_axis (GdkEvent *event,
|
||||
* according to platform conventions.
|
||||
*
|
||||
* The right mouse button typically triggers context menus.
|
||||
* On macOS, Control+left mouse button also triggers.
|
||||
*
|
||||
* This function should always be used instead of simply checking for
|
||||
* event->button == %GDK_BUTTON_SECONDARY.
|
||||
*
|
||||
* ```c
|
||||
* event->button == GDK_BUTTON_SECONDARY
|
||||
* ```
|
||||
*
|
||||
* Returns: %TRUE if the event should trigger a context menu.
|
||||
*/
|
||||
@ -998,6 +1002,13 @@ gdk_event_triggers_context_menu (GdkEvent *event)
|
||||
if (bevent->button == GDK_BUTTON_SECONDARY &&
|
||||
! (bevent->state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK)))
|
||||
return TRUE;
|
||||
|
||||
#ifdef __APPLE__
|
||||
if (bevent->button == GDK_BUTTON_PRIMARY &&
|
||||
(bevent->state & GDK_CONTROL_MASK) &&
|
||||
! (bevent->state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK)))
|
||||
return TRUE;
|
||||
#endif
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
Loading…
Reference in New Issue
Block a user