Skip to content

Commit

Permalink
Fix regression with macOS keyboard shortcuts in GTK 4.16
Browse files Browse the repository at this point in the history
The Cmd key was fixed to be mapped to GDK_META_MASK instead of the mysterious GDK_MOD2_MASK (https://gitlab.gnome.org/GNOME/gtk/-/commit/b7f3beda005bd8bfe42223024f8afdfec234019c)
  • Loading branch information
cameronwhite committed Sep 21, 2024
1 parent b810a6f commit e827f2a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Pinta.Core/Extensions/GdkExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,8 @@ public static bool IsShiftPressed (this ModifierType m)
/// </summary>
public static bool IsControlPressed (this ModifierType m)
{
// The Cmd key is GDK_MOD2_MASK, which is no longer a public constant as of GTK4
if (PintaCore.System.OperatingSystem == OS.Mac) {
var modifier_val = (uint) m;
return (modifier_val & 16) != 0;
return m.HasFlag (ModifierType.MetaMask);
} else
return m.HasFlag (ModifierType.ControlMask);
}
Expand Down

0 comments on commit e827f2a

Please sign in to comment.