Skip to content

Cannot simply (and safely) override default keymaps by plugins #2584

Closed

Description

@przepompownia

Setup (please complete the following information):

  • Distribution: Debian
  • Distribution release: Sid
  • Geeqie version [geeqie --version]: 3.1+git20260901-411d6c98 GTK4

Describe the bug
Image
When a plugin keymap (f.e. X-Geeqie-Hotkey=<control><shift>T) is used

  • the user isn't warned about the conflict with defaults (toggle tree view in this example).
  • the default keyboard is used and needs to be expliticly disabled

To reproduce
Steps to reproduce the behavior:

[Desktop Entry]
Version=1.0
Type=Application
Name=Terminal

Exec=x-terminal-emulator

Categories=X-Geeqie;
OnlyShowIn=X-Geeqie;

X-Geeqie-Menu-Path=EditMenu

X-Geeqie-Verbose=true

MimeType=image/jpeg;image/tiff;image/png;image/bmp;image/x-ms-bmp

X-Geeqie-Hotkey=<control><shift>T

Expected behavior

  • Geeqie can detect such conflict and warn the user about it
  • keymaps defined in plugin can override defaults

Please keep in mind possibly insecure third party plugins. Maybe a good solution may be

  • warning about conflict,
  • allowing the user to verify the new action(s), then choose the approved one.

Activity

  1. added a commit that references this issue on Sep 2, 2026
    4c217ab
  2. tomaszg7 commented on Sep 2, 2026

    @tomaszg7
    Contributor

    I'm afraid the fix doesn't work for me. I assigned shortcuts to two plugins (darktable and gimp) and neither is working. Nor did Geeqie warn me that one of them (shift-g) was already assigned to other action (grayscale).

    Edit: sorry, apparently problem lies elsewhere: keystroke converter doesn't work correctly for combinations shift-x. It just produces uppercase letter X, instead of <Shift>x. When I changed it by hand, the shortcuts work now fine. The other part of remark is still valid though. Geeqie didn't complain that <Shift>g was already assigned.

  3. added a commit that references this issue on Sep 2, 2026
    1dd8fa5
  4. caclark commented on Sep 2, 2026

    @caclark
    Collaborator

    @tomaszg7

    Everything should be fixed now, including use of shifted characters in the keystroke converter box.

  5. tomaszg7 commented on Sep 2, 2026

    @tomaszg7
    Contributor

    Seems to be fine now, thanks. However I notice another problem with preferences window (probably unrelated though): notice weird transparent borders on the windows on the screenshot below, as if window content didn't fit the full window:

    Image
  6. caclark commented on Sep 2, 2026

    @caclark
    Collaborator

    @tomaszg7

    Thanks. I now see it. It is another X11 problem :-(

  7. tomaszg7 commented on Sep 2, 2026

    @tomaszg7
    Contributor

    Thanks. I now see it. It is another X11 problem :-(

    It's not ;) It is on Wayland/Sway.

  8. caclark commented on Sep 2, 2026

    @caclark
    Collaborator

    Thanks again. I do not see the problem when using Wayland, but only when I log in on X11.

    mañana... traa dy liooar ... etc

  9. tomaszg7 commented on Sep 2, 2026

    @tomaszg7
    Contributor

    It gets worse... trying to reassign duplicate shortcut gives segfault:

    Thread 1 "geeqie" received signal SIGSEGV, Segmentation fault.
    0x00007ffff7710690 in ?? () from /usr/lib64/libgtk-4.so.1
    (gdb) bt
    #0  0x00007ffff7710690 in ??? () at /usr/lib64/libgtk-4.so.1
    #1  0x00007ffff7710f15 in ??? () at /usr/lib64/libgtk-4.so.1
    #2  0x00007ffff76ecf76 in ??? () at /usr/lib64/libgtk-4.so.1
    #3  0x00007ffff76ed8ad in ??? () at /usr/lib64/libgtk-4.so.1
    #4  0x00007ffff76ed969 in ??? () at /usr/lib64/libgtk-4.so.1
    #5  0x00007ffff789d557 in ??? () at /usr/lib64/libgtk-4.so.1
    #6  0x00007ffff701d931 in ??? () at /usr/lib64/libgobject-2.0.so.0
    #7  0x00007ffff7033fb4 in ??? () at /usr/lib64/libgobject-2.0.so.0
    #8  0x00007ffff703ad78 in g_signal_emit_valist () at /usr/lib64/libgobject-2.0.so.0
    #9  0x00007ffff703ae4b in g_signal_emit () at /usr/lib64/libgobject-2.0.so.0
    #10 0x00007ffff756d5dd in ??? () at /usr/lib64/libgtk-4.so.1
    #11 0x00007ffff756bd41 in ??? () at /usr/lib64/libgtk-4.so.1
    #12 0x00007ffff76cfef7 in ??? () at /usr/lib64/libgtk-4.so.1
    #13 0x00007ffff75e75e3 in ??? () at /usr/lib64/libgtk-4.so.1
    #14 0x00007ffff789d557 in ??? () at /usr/lib64/libgtk-4.so.1
    #15 0x00007ffff793d5b9 in ??? () at /usr/lib64/libgtk-4.so.1
    #16 0x00007ffff701d931 in ??? () at /usr/lib64/libgobject-2.0.so.0
    #17 0x00007ffff7033fb4 in ??? () at /usr/lib64/libgobject-2.0.so.0
    #18 0x00007ffff703ad78 in g_signal_emit_valist () at /usr/lib64/libgobject-2.0.so.0
    #19 0x00007ffff703ae4b in g_signal_emit () at /usr/lib64/libgobject-2.0.so.0
    #20 0x00007ffff79412e6 in ??? () at /usr/lib64/libgtk-4.so.1
    #21 0x00007ffff78a54f3 in ??? () at /usr/lib64/libgtk-4.so.1
    #22 0x00007ffff6f06d95 in ??? () at /usr/lib64/libglib-2.0.so.0
    #23 0x00007ffff6f0a757 in ??? () at /usr/lib64/libglib-2.0.so.0
    #24 0x00007ffff6f0af10 in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0
    #25 0x00007ffff71615ed in g_application_run () at /usr/lib64/libgio-2.0.so.0
    #26 0x00005555555d1e3d in main (argc=1, argv=0x7fffffffd578) at ../src/main.cc:1013
    

    It's enough to try to define a duplicate shortcut and click "replace" in the popup warning about duplicate.

  10. przepompownia commented on Sep 2, 2026

    @przepompownia
    ContributorAuthor
    Image

    It's helpful even with this minimal form!

    Making the action names selectable would be useful at this moment.

    After finding and clearing the default assignment (toggle tree view in this example), the new keystroke works, but the menu does not show the hint, even after restart Geeqie.

    Image
  11. caclark commented on Sep 3, 2026

    @caclark
    Collaborator

    @przepompownia

    Making the action names selectable would be useful at this moment.

    I see this as a problem that only happens once - and then the user fixes it. Any other duplicates will be trapped by Geeqie as the user tries to make them.
    Please make a separate feature request for this.

    After finding and clearing the default assignment (toggle tree view in this example), the new keystroke works, but the menu does not show the hint, even after restart Geeqie.

    I do not see this problem.

  12. caclark commented on Sep 3, 2026

    @caclark
    Collaborator

    @tomaszg7

    trying to reassign duplicate shortcut gives segfault:

    I do not see this problem

  13. przepompownia commented on Sep 3, 2026

    @przepompownia
    ContributorAuthor

    After finding and clearing the default assignment (toggle tree view in this example), the new keystroke works, but the menu does not show the hint, even after restart Geeqie.

    I do not see this problem.

    My imprecision: hints appear in the main menu, as opposed to the context menu.

  14. 3 remaining items

  15. przepompownia commented on Sep 4, 2026

    @przepompownia
    ContributorAuthor

    Thank you!
    Image

    I tried to ask LLM why plugin menu items do not contain shortcut hint since 4c217ab (pointed by git bisect). First it suggested a label modification in plugins_menu_populate, which caused a duplicated hints in main menu items. Then I got the following comment, not sure if worth mention 😉

    The accelerator registration that was removed needs to happen for both the editor plugins AND to be preserved across config reloads. The fix should be in ensuring editor_plugin_accel_register() is called at the right times (which the commit actually does via editor_plugin_accels_reload() in preferences.cc).
    The keyboard hints should appear automatically through GTK's accelerator system, not by modifying labels. If they're still missing, the problem is that editor_plugin_accel_register() isn't being called early enough or frequently enough.

  16. przepompownia commented on Sep 4, 2026

    @przepompownia
    ContributorAuthor

    6f53c1c shows that this change could prove helpful also in resolving internal conflicts (i.e. between defaults).

  17. caclark commented on Sep 4, 2026

    @caclark
    Collaborator

    @tomaszg7

    . trying to reassign duplicate shortcut gives segfault:

    I do not see this bug. Is it still happening?

  18. caclark commented on Sep 4, 2026

    @caclark
    Collaborator

    @przepompownia

    plugin menu items do not contain shortcut hint

    Are we looking at the same problem? This is what I see - test1 shortcut is defined in the .desktop file and test2 shortcut is defined within Geeqie:

    Image
  19. tomaszg7 commented on Sep 5, 2026

    @tomaszg7
    Contributor

    @tomaszg7

    . trying to reassign duplicate shortcut gives segfault:

    I do not see this bug. Is it still happening?

    Yes, it still happens each time I press "replace" for a duplicate shortcut.

    I also don't see hints in plugins context menu. I do see them when I go via main menu toolbar.

  20. caclark commented on Sep 5, 2026

    @caclark
    Collaborator

    I also don't see hints in plugins context menu.

    Fixed in commit 0408839

  21. caclark commented on Sep 5, 2026

    @caclark
    Collaborator

    @tomaszg7

    trying to reassign duplicate shortcut gives segfault:

    I still cannot replicate this. Are you compiling with -Dbuildtype=debug ?

  22. tomaszg7 commented on Sep 5, 2026

    @tomaszg7
    Contributor

    I still cannot replicate this. Are you compiling with -Dbuildtype=debug ?

    Right now I have buildtype=release and debug=true, but the same thing happened with debug=false. Should I try to change buildtype?

  23. pinned this issue on Sep 5, 2026
  24. caclark commented on Sep 5, 2026

    @caclark
    Collaborator

    Please try with this style:
    rm -rf build; meson setup -Dbuildtype=debug build

  25. przepompownia commented on Sep 5, 2026

    @przepompownia
    ContributorAuthor

    @caclark I could not respond in the meantime, but now I see shortcuts at the end of plugin labels, apparently since 0408839. Thank you again!

  26. tomaszg7 commented on Sep 5, 2026

    @tomaszg7
    Contributor

    meson setup -Dbuildtype=debug build

    The same result:

    Geeqie fatal error
    Signal: Invalid memory reference
    Code: Address not mapped
    Address: 0x0000000000000018
    src/geeqie(+0x12cee9) [0x558f78398ee9]
    /usr/lib64/libc.so.6(+0x3da60) [0x7fbdb8667a60]
    /usr/lib64/libgtk-4.so.1(+0x310690) [0x7fbdba710690]
    /usr/lib64/libgtk-4.so.1(+0x310f15) [0x7fbdba710f15]
    /usr/lib64/libgtk-4.so.1(+0x2ecf76) [0x7fbdba6ecf76]
    /usr/lib64/libgtk-4.so.1(+0x2ed8ad) [0x7fbdba6ed8ad]
    /usr/lib64/libgtk-4.so.1(+0x2ed969) [0x7fbdba6ed969]
    /usr/lib64/libgtk-4.so.1(+0x49d557) [0x7fbdba89d557]
    /usr/lib64/libgobject-2.0.so.0(+0x18931) [0x7fbdb9ff5931]
    /usr/lib64/libgobject-2.0.so.0(+0x2efb4) [0x7fbdba00bfb4]
    /usr/lib64/libgobject-2.0.so.0(g_signal_emit_valist+0x38) [0x7fbdba012d78]
    /usr/lib64/libgobject-2.0.so.0(g_signal_emit+0x9b) [0x7fbdba012e4b]
    /usr/lib64/libgtk-4.so.1(+0x16d5dd) [0x7fbdba56d5dd]
    /usr/lib64/libgtk-4.so.1(+0x16bd41) [0x7fbdba56bd41]
    /usr/lib64/libgtk-4.so.1(+0x2cfef7) [0x7fbdba6cfef7]
    /usr/lib64/libgtk-4.so.1(+0x1e75e3) [0x7fbdba5e75e3]
    /usr/lib64/libgtk-4.so.1(+0x49d557) [0x7fbdba89d557]
    /usr/lib64/libgtk-4.so.1(+0x53d5b9) [0x7fbdba93d5b9]
    /usr/lib64/libgobject-2.0.so.0(+0x18931) [0x7fbdb9ff5931]
    /usr/lib64/libgobject-2.0.so.0(+0x2efb4) [0x7fbdba00bfb4]
    /usr/lib64/libgobject-2.0.so.0(g_signal_emit_valist+0x38) [0x7fbdba012d78]
    /usr/lib64/libgobject-2.0.so.0(g_signal_emit+0x9b) [0x7fbdba012e4b]
    /usr/lib64/libgtk-4.so.1(+0x5412e6) [0x7fbdba9412e6]
    /usr/lib64/libgtk-4.so.1(+0x4a54f3) [0x7fbdba8a54f3]
    /usr/lib64/libglib-2.0.so.0(+0x5dd95) [0x7fbdb9eded95]
    /usr/lib64/libglib-2.0.so.0(+0x61757) [0x7fbdb9ee2757]
    /usr/lib64/libglib-2.0.so.0(g_main_context_iteration+0x30) [0x7fbdb9ee2f10]
    /usr/lib64/libgio-2.0.so.0(g_application_run+0x1ed) [0x7fbdba1395ed]
    src/geeqie(main+0x21d) [0x558f782e9f1d]
    /usr/lib64/libc.so.6(+0x2747e) [0x7fbdb865147e]
    /usr/lib64/libc.so.6(__libc_start_main+0x8b) [0x7fbdb865159b]
    src/geeqie(_start+0x25) [0x558f782ea985]
    
  27. caclark commented on Sep 6, 2026

    @caclark
    Collaborator

    @tomaszg7
    I still cannot replicate this, and I am reluctant to make a blind fix.
    I would appreciate it if you would try this patch:

    2584-1.diff.gz

    gunzip 2584-1.diff.gz
    patch -p1 < 2584-1.diff

  28. tomaszg7 commented on Sep 6, 2026

    @tomaszg7
    Contributor

    Yes, it seems to do the trick!

  29. added a commit that references this issue on Sep 6, 2026
    5f43aba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions