akiraux / Akira

Native Linux App for UI and UX Design built in Vala and GTK
GNU General Public License v3.0
5.24k stars 202 forks source link

Drop Gdk.ModifierType #730

Closed Alecaddd closed 1 year ago

Alecaddd commented 1 year ago

We're currently using the Gdk.ModifierType to detect if the CTRL or SHIFT key are pressed. We randomly use these inside various methods and it's not efficient.

Those modifiers they're not always accurate as they interfere with the OS window management shortcuts and they don't "clear" themselves nicely, resulting in inconsistent behaviors.

We have more efficient methods in the ViewCanvas called ctrl_is_pressed() and shift_is_pressed(), which use the more reliable modifier mask at the time of the interaction (click or keypress) and don't linger around.

We should replace the usage of Gdk.ModifierType.SHIFT_MASK and Gdk.ModifierType.CONTROL_MASK with those methods.