Skip to content

fix(context-menu): ignore non-primary clicks on menu rows - #2190

Merged
l0gicgate merged 2 commits into
lgse:mainfrom
JoeJoeflyn:fix/2109-context-menu-secondary-click
Nov 12, 2026
Merged

l0gicgate merged 2 commits into
lgse:mainfrom
JoeJoeflyn:fix/2109-context-menu-secondary-click

Conversation

@JoeJoeflyn

@JoeJoeflyn JoeJoeflyn commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Description

In an open context menu, secondary (right) or middle clicking any row ran that row, exactly like a primary click (#2109). This happened because GTK's GtkModelButton uses a primary-only click gesture, but gtk_gesture_click_handle_event emits unpaired-release for non-primary button releases when the gesture has no active press. gesture_unpaired_release in gtkmodelbutton.c then activates the button without checking which button was released.

The context menu's guard_unpaired_release now verifies that releases belong to the primary mouse button (BUTTON_PRIMARY) in addition to verifying that a press was observed inside the menu, dropping secondary and middle releases before they reach GtkModelButton.

Visual evidence

screenrecording-2026-11-12_18-08-58.mp4

How to test

  1. Right-click any file to open its context menu.
  2. Right-click on any menu row (e.g. "Properties", "Move to Trash").
  3. Middle-click on any menu row.

Expected result: The menu stays open and the row action does not execute. Primary clicks (left click), Enter, and Space continue to activate rows normally.

Related issue

Closes #2109

Drop secondary and middle button releases in the context menu release guard so non-primary clicks do not activate GtkModelButton rows via GTK's unpaired-release mechanism.

Closes lgse#2109
@github-actions github-actions Bot added the fix label Nov 12, 2026
Update entry-menu-named-actions quality.note with right-click row rejection and clarify is_primary_button scope.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Secondary or middle click on a context menu row runs that row

2 participants