Skip to content

Add CloseAll and CloseAllOthers as bindable mouse actions#34

Open
nynjapirate wants to merge 1 commit into
klangman:mainfrom
nynjapirate:feature/close-all-mouse-actions
Open

Add CloseAll and CloseAllOthers as bindable mouse actions#34
nynjapirate wants to merge 1 commit into
klangman:mainfrom
nynjapirate:feature/close-all-mouse-actions

Conversation

@nynjapirate
Copy link
Copy Markdown

@nynjapirate nynjapirate commented May 12, 2026

What

Adds two new entries to the MouseAction enum and _performMouseAction dispatcher:

  • CloseAll (41) — close every window of the application this button represents.
  • CloseAllOthers (42) — close every window of the application except the one the action was invoked on.

Both are then surfaced in all seven MouseAction dropdowns in settings-schema.json (left/middle/right click on the windowlist button, three thumbnail-window mouse-button actions, and the adv-mouse-list action picker), so a user can bind e.g. Shift + Middle on a windowlist button to "Close all others."

Why

These two actions already exist as right-click menu items but aren't bindable. Power users who set up custom mouse/keyboard combos in the Advanced tab have asked for them.

How

The dispatcher cases are direct ports of the existing right-click menu callbacks (the Close others / Close all items in _populateContextMenu). Same window-iteration logic for the three button shapes:

  • Grouped button (this.getNumberOfWindow() > 1) — iterate this._windows.
  • Ungrouped, sibling buttons exist (btns.length > 1) — iterate btns[i]._currentWindow.
  • Single window — degenerate; CloseAll closes the one window, CloseAllOthers is a silent no-op.

Existing _performMouseAction call sites all pass a meaningful window argument (either this._metaWindow from thumbnail menus or this._currentWindow from windowlist buttons), so CloseAllOthers correctly spares the window the user invoked the action on — whether that's via a thumbnail or the button itself.

File-level notes

  • 6.0/applet.js is a symlink to ../5.4/applet.js, so the patch only edits 4.0/applet.js and 5.4/applet.js.
  • settings-schema.json is a real file in each of 4.0/, 5.4/, 6.0/ — all three updated.
  • po/CassiaWindowList@klangman.pot regenerated via ./makepot. The diff is larger than the rest of the patch because the previous .pot was missing several schema-derived strings (Tile left, Untile window, etc); makepot swept them in along with the two new feature msgids (Close all, Close all others). Happy to drop the .pot from the commit if you'd prefer to regenerate yourself at merge time.

Test plan

  • Tested locally on Cinnamon 6.0 by binding Shift + Middle → Close all and Ctrl + Middle → Close all others via the Advanced tab; verified both fire correctly with two terminal windows open in grouped and ungrouped modes.
  • Verified the existing right-click Close all / Close others menu items still work unchanged.
  • Verified node --check is clean on the patched applet.js files and the three settings-schema.json files parse as valid JSON.

Thank you for creating Cassia — you have been super awesome and responsive and your applet is something I stare at every day... so when I got the opportunity to have a little time with a coding ai (I'm no coder myself..,. yet) I thought I'd throw this your way as a small thank you. Cheers!

P.S. If it is trash and I totally missed something about why this was unhelpful, not needed or anything else I am all ears.

Both close actions were previously only reachable via the right-click
context menu. This adds them to the MouseAction enum (values 41 and 42)
and to _performMouseAction, so they can be bound anywhere a MouseAction
is selectable - left/middle/right click on the windowlist button, the
three thumbnail-window mouse-button actions, and the Advanced tab's
Ctrl/Shift + mouse-button list.

The dispatcher logic mirrors the existing right-click menu callbacks
verbatim: handles grouped buttons (multiple windows on one button),
ungrouped sibling buttons (one window per button, multiple buttons for
the same app), and the degenerate single-window case.

Settings-schema gets the two new options added to all seven MouseAction
dropdowns. 6.0/applet.js is a symlink to 5.4/applet.js so only one
applet.js edit per file pair was needed.

.pot regenerated via ./makepot - the large diff reflects a backlog of
schema-derived strings the previous .pot was missing, in addition to
the two new feature msgids.
@klangman
Copy link
Copy Markdown
Owner

Thanks for the code.. I'll take a look at it over the next week or so. My main dev machine is currently down after an OS upgrade gone wrong so I have to get that back up and running before I can do much else.

Regarding the pot files. I have not been updating them here on my repo since the pots get updated by a script when I move the changes to the Linux Mint Cinnamon Spices repo anyhow.

Over all I think this is a good idea, but it is a bit dangerous that you can close a large set of applications with a mistaken key+click. But this window-list is meant for power users and users would have to select this behavior (i.e it is not the default) so I guess its fine.

Thanks again!

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.

2 participants