Skip to content

Conversation

@samw-26
Copy link
Contributor

@samw-26 samw-26 commented Sep 7, 2025

When using the menu overlay keybinding, if there are menus with the same keybinding, then it will prioritize opening the menu on the current monitor (monitor with the mouse cursor).

@samw-26 samw-26 marked this pull request as draft September 7, 2025 04:35
@samw-26 samw-26 force-pushed the menu-shortcut-priority branch from 7341c50 to c45dded Compare September 7, 2025 11:49
@samw-26 samw-26 marked this pull request as ready for review September 7, 2025 11:50
@samw-26 samw-26 marked this pull request as draft September 7, 2025 12:40
…ioritize the menu on the monitor with the mouse cursor.
@samw-26 samw-26 force-pushed the menu-shortcut-priority branch from c45dded to 2347907 Compare September 7, 2025 13:09
@samw-26 samw-26 marked this pull request as ready for review September 7, 2025 13:10
@clefebvre clefebvre changed the title [email protected]: If multiple menus share an overlay keybinding, prioritize the menu on the current monitor menu: If multiple menus share a keybinding, prioritize the menu on the current monitor Oct 1, 2025
@clefebvre clefebvre self-assigned this Oct 1, 2025
@mtwebster
Copy link
Member

Just a heads-up, since 95e9d25, keybinding settings will complain about duplicate keybindings anywhere. You can dismiss the popup without being forced to take action.

Actual behavior while using them is unchanged, but we would have to make a determination to 'ignore cases of a keybinding in multiple applet instances' or something...

mtwebster added a commit that referenced this pull request Nov 17, 2025
same applet.

This restores existing, expected behavior where multiple instances
of the same applet can have the same keybinding configured.

ref: #13079
@mtwebster
Copy link
Member

I don't really like that this only works for the menu applet. A number of default cinnamon applets support shortcuts, and there are lots of third-party spices that do also.

I'd prefer to consider a solution that would address it globally.

  • applet registers shortcut by calling a special KeybindingManager.addAppletKeybinding() method (instead of the typical addHotKeyArray or whatever). This could detect a duplicate uuid and store additional {uuid:callback} sets, but stop short of trying to add the keybinding to muffin again.
  • It binds the shortcut to its own internal callback, which will, when triggered, do the work of figuring out which applet instance's real callback should be used

mtwebster added a commit that referenced this pull request Nov 21, 2025
multi-instance xlet handling.

Multi-instance applets with duplicate shortcuts (which will be their
default, at least when first added), will now allow the shortcut to
open the instance on the current monitor, if there is one, rather
than ending up always being the most-recently-loaded instance.

For example, two default menu applets, one per monitor.
- By default, the super keys will open whichever instance is on the
  active monitor.
- If you assign a shortcut to one instance that is different from
  the other, it will open only that instance, regardless of which
  monitor is active.

ref:
#13079
@mtwebster
Copy link
Member

Implemented what I talked about above in 40e360d

Third-party xlets will need to make minor, simple changes to take advantage of this.

@mtwebster mtwebster closed this Nov 21, 2025
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.

3 participants