Skip to content

GTK: Middle click events should be forwarded to TUIs even when enable-primary-paste is disabled via GSettings #12940

Closed

Description

@pluiedev

Reported by @Aleksanaa over DMs

Regression caused by #10328 — we seem to be discarding the middle click event before the surface callback even has a chance to report the event to the underlying TUI via mouse reporting. This, in turn, breaks all TUI apps that rely on middle click events when gtk-enable-primary-paste is disabled.

Activity

  1. added
    gtkIssues exclusive to GTK which are not OS-specific
    on Jun 6, 2026
  2. added theissue type on Jun 6, 2026
  3. added this to the 1.3.2 milestone on Jun 6, 2026
  4. added
    contributor friendlyA well-scoped, approachable issue for someone looking to contribute.
    inputKeyboard or mouse input
    on Jun 6, 2026
  5. simonepelosi commented on Jun 6, 2026

    @simonepelosi

    @pluiedev hey! I'm interested in contributing!

  6. pluiedev commented on Jun 6, 2026

    @pluiedev
    MemberAuthor

    @simonepelosi PRs welcome on this one :) Just make one and we'll vouch you

  7. mjrochford commented on Jun 7, 2026

    @mjrochford
    Contributor

    I've figured the cause of the the regression in #10328, in apprt/gtk/class/Surface.zig respecting gtk-enable-primary-paste was acheived through an early return in gcMouseUp and gcMouseDown. I have a preliminary fix in my fork. I have used the gsettings.get, but now the priv.gtk_enable_primary_paste is dead code which I have yet to remove.

  8. Bekon241 commented on Jul 7, 2026

    @Bekon241

    Hi i have same problem version 1.3.1 not work middle click paste in Nobara linux... All other terminal browser or text box middle click mouse and paste work normal in all OS.

  9. oekelly commented on Jul 9, 2026

    @oekelly

    Also seeing this with ghostty 1.3.1-2.fc44 on Nobara 44

    ❯ ghostty +version
    Ghostty 1.3.1-2.fc44
    
    Version
      - version: 1.3.1-2.fc44
      - channel: tip
    Build Config
      - Zig version   : 0.15.2
      - build mode    : .ReleaseFast
      - app runtime   : .gtk
      - font engine   : .fontconfig_freetype
      - renderer      : renderer.generic.Renderer(renderer.OpenGL)
      - libxev        : io_uring
      - kernel version: 7.1.3-200.nobara.fc44.x86_64
      - desktop env   : other
      - GTK version   :
        build         : 4.22.3
        runtime       : 4.22.4
      - libadwaita    : enabled
        build         : 1.9.0
        runtime       : 1.9.2
      - libX11        : enabled
      - libwayland    : enabled
    
  10. SimeonEhrig commented on Jul 10, 2026

    @SimeonEhrig

    Can confirm on Nobara 44, but not on every system. I have to systems running with Nobara 44. On one system the middle click is working, on the other system not. Both display the same version info:

    Ghostty 1.3.1-2.fc44
    
    Version
      - version: 1.3.1-2.fc44
      - channel: tip
    Build Config
      - Zig version   : 0.15.2
      - build mode    : .ReleaseFast
      - app runtime   : .gtk
      - font engine   : .fontconfig_freetype
      - renderer      : renderer.generic.Renderer(renderer.OpenGL)
      - libxev        : io_uring
      - kernel version: 7.1.3-200.nobara.fc44.x86_64
      - desktop env   : other
      - GTK version   :
        build         : 4.22.3
        runtime       : 4.22.4
      - libadwaita    : enabled
        build         : 1.9.0
        runtime       : 1.9.2
      - libX11        : enabled
      - libwayland    : enabled
    
  11. oekelly commented on Jul 14, 2026

    @oekelly

    FYI even though I'm running KDE and not GNOME, this 'gsettings' setting (via Reddit: https://www.reddit.com/r/gnome/comments/1t27aqy/middle_click_paste_from_historical_default_gone/ ) seems to have fixed the issue:

    gsettings set org.gnome.desktop.interface gtk-enable-primary-paste true

    I noticed that whilst Ghostty was the primary place I missed the middle-click-paste, it also wasn't working in a handful of other apps after a week or so of daily driving, and Google Chrome was also affected. So possibly this is just related to GTK setting and the upstream change the GNOME project to disable this feature by default.

  12. SimeonEhrig commented on Jul 15, 2026

    @SimeonEhrig

    FYI even though I'm running KDE and not GNOME, this 'gsettings' setting (via Reddit: https://www.reddit.com/r/gnome/comments/1t27aqy/middle_click_paste_from_historical_default_gone/ ) seems to have fixed the issue:

    gsettings set org.gnome.desktop.interface gtk-enable-primary-paste true

    I noticed that whilst Ghostty was the primary place I missed the middle-click-paste, it also wasn't working in a handful of other apps after a week or so of daily driving, and Google Chrome was also affected. So possibly this is just related to GTK setting and the upstream change the GNOME project to disable this feature by default.

    Thanks for the fix. That solves my problem and that is actual the difference of my two Nobara 44 system. On the working system, org.gnome.desktop.interface gtk-enable-primary-paste was already set to true.

  13. JoeJoeflyn commented on Jul 31, 2026

    @JoeJoeflyn

    Can I work on a fix for this? Would you vouch me so I can open a PR?

  14. Bekon241 commented on Aug 4, 2026

    @Bekon241

    Problem solved~
    Hi
    I use this on Nobara:
    gsettings get org.gnome.desktop.interface gtk-enable-primary-paste
    return me
    false
    then
    gsettings set org.gnome.desktop.interface gtk-enable-primary-paste true
    i check again and return true.
    And ghostty work like charm again with middle click. :) Idk why that setting was off because i not change anything before.
    Fixed for me when i write this Nobara 44 KDE Plasma 6.7.3 Wayland.

    Wierd is only one thing why other terminal like alacritty not need this ON for middle click paste idk why.

  15. Bekon241 commented on Aug 4, 2026

    @Bekon241

    Can I work on a fix for this? Would you vouch me so I can open a PR?

    This is not problem with ghostty only gsetting in KDE :) example same setting in niri work without problem... Above cli fix this for me :)

  16. JoeJoeflyn commented on Aug 4, 2026

    @JoeJoeflyn

    Thanks for the heads-up

  17. pluiedev commented on Aug 4, 2026

    @pluiedev
    MemberAuthor

    Fixed in #13108

  18. Bekon241 commented on Aug 4, 2026

    @Bekon241

    Thanks for the heads-up

    Your welcome :) Cheers from Poland :) Im happy i can use ghostty again any other terminal dont give me soo nice backgroud in config some of them can but i like ghostty :)

  19. modified the milestones: 1.3.2, 1.4.0 on Oct 13, 2026
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

    contributor friendlyA well-scoped, approachable issue for someone looking to contribute.gtkIssues exclusive to GTK which are not OS-specificinputKeyboard or mouse input

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions