Project

General

Profile

Bug #11824

Some custom shortcuts with <Shift> modifier don't work

Added by Rikard Öxler about 1 year ago. Updated about 1 year ago.

Status:
Fixed
Priority:
Low
Assignee:
-
Category:
General
Target version:
Start date:
11/18/2017
Due date:
% Done:

100%

Affected Version:
git master branch
System:
all
bitness:
64-bit
hardware architecture:
amd64/x86

Description

When I change the shortcut for e.g. sticky preview to '<Shift>z' it only works until restart of darktable.
I have noticed this behaviour on windows but debugged it on macOS.

The problem is that gtk_accel_map_save() and gtk_accel_map_load() are not symmretical.
gtk_accelerator_name(90, GDK_SHIFT_MASK) and gtk_accelerator_name(122, GDK_SHIFT_MASK) both return '<Shift>z'
But gtk_accelerator_parse() for '<Shift>z' gets 122 as accelerator_key.

In darktable after assigning the shortcut, accels->lighttable_preview_sticky.accel_key = 90 but after restart it is 122.
One possible solution is to use gdk_keyval_to_lower() for shortcut preferences assigment and the key_pressed()/key_released() functions where the keyval is compared later.

Attached is a patch that fixes the problem for me, but I don't know of any possible side effects.

0001-fix-shortcuts-with-shift-modifier.patch Magnifier (1.85 KB) Rikard Öxler, 11/18/2017 04:11 PM

History

#2 Updated by Tobias Ellinghaus about 1 year ago

  • % Done changed from 0 to 100
  • Status changed from New to Fixed

#3 Updated by Roman Lebedev about 1 year ago

  • Target version set to 2.6.0

Also available in: Atom PDF