Skip to content

Alternative mouse shortcuts support#1

Open
gryzly123 wants to merge 1 commit into
nohackjustnoobb:masterfrom
gryzly123:mouse-clicks-support
Open

Alternative mouse shortcuts support#1
gryzly123 wants to merge 1 commit into
nohackjustnoobb:masterfrom
gryzly123:mouse-clicks-support

Conversation

@gryzly123

@gryzly123 gryzly123 commented Jun 24, 2026

Copy link
Copy Markdown

Hey, first of all, thanks for the great app, it works really well 😄 I thought it would be cool if it could also support managing windows without the need to use the overlay - simply hover and middle click to close a window - so I added it. I will note that I'm very new to both Swift and macOS itself, so hopefully I didn't make too many mistakes - would love to hear your comments.


Adds right and middle click detection inside Mission Control. The action to be performed is customizable using a picker in Settings view. Both click actions are set to None by default and must be manually enabled by the user.

Screenshot 2026-06-24 at 02-17-00

OpenMissionControlCore refactors:

  • available window actions (quit, close, minimize, maximize) are now grouped in a WindowAction enum
  • the method performWindowAction has been renamed to performWindowOSAction
  • a new method performWindowAction has been added to have a single code path for all possible actions - it is used by both mouse, keyboard and overlay handler functions - removes some redundancy
  • new Instigator enum has been added and is passed to performWindowAction in order not to break current debug logging functionality - we can still track who (overlay, keyboard, mouse click) requested the window action despite printing being kept solely within performWindowAction
  • fixes a bug where the hardcoded width of the overlay was small enough so that the 4th overlay button could never be clicked, and unnecessarily blocked some space when only 1 or 2 icons were enabled. The overlay rect width is now calculated dynamically

SettingsView refactors:

  • since Theme is no longer the only picker in the Settings view, a SettingPickerRow class has been introduced - similar to the existing SettingToggleRow
  • SettingPickerRow and SettingToggleRow now receive color as LinearGradient rather than raw Color - required to retain the rainbow icon in Theme within SettingPickerRow. Additional helper builder function solidColor has been added to convert colors to linear gradients

Adds right and middle click detection in Mission Control.
The action to perform is customizable using a picker in Settings view.

This commit also does some minor refactors:
* window actions are now grouped in an enum, and both
  mouse, keyboard and overlay handler functions use the same method
  for all windows and actions (instigator is passed as a parameter
  to that method only for logging purposes)
* since Theme is no longer the only picker in the Settings view,
  a SettingPickerRow class has been introduced
* SettingPickerRow and SettingToggleRow now receive color as LinearGradient
  rather than raw Color - required for rainbow icon. Additional helper
  builder function has been added to convert colors to linear gradients.
* fixes bug where the hardcoded width of the overlay was small enough
  so that the 4th overlay button could never be clicked. The width
  is now always calculated dynamically
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.

1 participant