Add CloseAll and CloseAllOthers as bindable mouse actions#34
Open
nynjapirate wants to merge 1 commit into
Open
Add CloseAll and CloseAllOthers as bindable mouse actions#34nynjapirate wants to merge 1 commit into
nynjapirate wants to merge 1 commit into
Conversation
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.
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! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds two new entries to the
MouseActionenum and_performMouseActiondispatcher: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 theadv-mouse-listaction picker), so a user can bind e.g.Shift + Middleon 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 allitems in_populateContextMenu). Same window-iteration logic for the three button shapes:this.getNumberOfWindow() > 1) — iteratethis._windows.btns.length > 1) — iteratebtns[i]._currentWindow.CloseAllcloses the one window,CloseAllOthersis a silent no-op.Existing
_performMouseActioncall sites all pass a meaningfulwindowargument (eitherthis._metaWindowfrom thumbnail menus orthis._currentWindowfrom windowlist buttons), soCloseAllOtherscorrectly 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.jsis a symlink to../5.4/applet.js, so the patch only edits4.0/applet.jsand5.4/applet.js.settings-schema.jsonis a real file in each of4.0/,5.4/,6.0/— all three updated.po/CassiaWindowList@klangman.potregenerated via./makepot. The diff is larger than the rest of the patch because the previous.potwas missing several schema-derived strings (Tile left,Untile window, etc);makepotswept them in along with the two new feature msgids (Close all,Close all others). Happy to drop the.potfrom the commit if you'd prefer to regenerate yourself at merge time.Test plan
Shift + Middle → Close allandCtrl + Middle → Close all othersvia the Advanced tab; verified both fire correctly with two terminal windows open in grouped and ungrouped modes.Close all/Close othersmenu items still work unchanged.node --checkis 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.