Skip to content

Fix Zoom Shortcuts (fixes issue #9797)

programmer_ceds requested to merge programmer_ceds/gimp:FixZoomShortcuts into master

Since the commit mentioned in issue #9797 (closed) the view-zoom-xxx shortcuts don't work as they now require a target value. This means that in gtk_application_set_accels_for_action() a detailed action name, including a target, has to be supplied - for instance "view-zoom-8-1(80000)" instead of "view-zoom-8-1".

The issue actually affects all GIMP radio actions.

The initial approach was to add the targets to all three places that each action appears and modify the code that reads shortcutsrc to add the targets to the entries read from the file the first time the new version of GIMP was run. This approach was discarded for the following reasons. Firstly it would mean that a shortcutsrc file saved by the new version of GIMP would not be readable by an older version. Secondly anyone adding radio actions in the future would have to be aware that the target values must be included. Thirdly, the main reason for abandoning the approach, I couldn't get GIMP modified in this way to get through startup without segfaulting.

The submitted MR uses the existing action names within GIMP but adds the target values when calling GTK to setup the shortcuts and removes them, temporarily, when reading them back from GTK.

Merge request reports