Skip to content

Conversation

@carsteneu
Copy link

Fixes #13416

The menu search field didn't support right-click copy/paste. Users could only paste with Ctrl+V keyboard shortcut.

Added CinnamonEntry.addContextMenu() to the search entry, enabling the standard right-click context menu with copy/paste/select all options.

Enable copy/paste via right-click in the start menu search field
by using CinnamonEntry.addContextMenu(). Previously only Ctrl+V
worked for pasting.

Fixes linuxmint#13416
@fredcw
Copy link
Contributor

fredcw commented Jan 22, 2026

This doesn't seem to work well for me. When I click paste, the applet just closes. And copy seems always greyed out even if there's text in the search entry.

Fixes linuxmint#13416

The menu search field didn't support right-click copy/paste properly.
Users could only paste with Ctrl+V keyboard shortcut.

Changes:
- Add CinnamonEntry.addContextMenu() to enable right-click context menu
- Prevent context menu from grabbing modal focus (shouldGrab = false)
- Close context menu when main menu closes
- Extend _eventIsOnActiveMenu to treat context menu as part of active menu
- Add manual hover effect using mouse position polling and CSS pseudo-class
  (required because MenuManager blocks normal hover events)
@carsteneu
Copy link
Author

Thank you very much @fredcw for testing and the valuable feedback!

I've updated the PR to fix the issues you reported:

What's fixed:

Clicking "Paste" no longer closes the menu - it now works as expected. I tested before, but I think I only checked that the context menu appeared, not the actual paste action. My apologies for that oversight!
Hover highlighting on menu items now works properly. This turned out to be quite complex to achieve - I found no other way than implementing it manually with mouse position polling.
A note on "Copy" being greyed out:
I believe this is the expected behavior - "Copy" should only be enabled when text is selected in the search field. Without a selection, there's nothing to copy. Similarly, "Paste" is only active when there's something in the clipboard.

Technical details:
The fix required extending the MenuManager's event handling to treat the context menu as part of the active menu, plus a manual hover implementation since the MenuManager blocks normal hover events.

Please test again when you have a chance - I really appreciate your help!

@fredcw
Copy link
Contributor

fredcw commented Jan 24, 2026

This works well now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot insert content by right-clicking in the Start menu input field

2 participants