Skip to content

Commit 3982736

Browse files
authored
[CassiaWindowList@klangman] Version 2.3.7: New scroll-wheel options and fixes (#6543)
* Added scroll-wheel options, cycle all window-list windows and cycle group/pool windows * The "active" class (window-list button underline in MintY theme) is now used as an active window highlight when pinning is disabled * Fixed bug preventing pinned buttons from being removed after disabling the pinned buttons support ("Pinning of window list buttons" -> "Disabled") * The window-list mouse scroll-wheel action will apply when the Thumbnail menu is open and the Thumbnail menu scroll-wheel setting is "Disabled" * If the active window changes when the Thumbnail menu is open, the outlined Thumbnail menu item will change if the new active window is one of the menu items
1 parent 2bc8799 commit 3982736

File tree

15 files changed

+664
-422
lines changed

15 files changed

+664
-422
lines changed

CassiaWindowList@klangman/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 2.3.7
4+
5+
* Added scroll-wheel options, cycle all window-list windows and cycle group/pool windows
6+
* The "active" class (window-list button underline in MintY theme) is now used as an active window highlight when pinning is disabled
7+
* Fixed bug preventing pinned buttons from being removed after disabling the pinned buttons support ("Pinning of window list buttons" -> "Disabled")
8+
* The window-list mouse scroll-wheel action will apply when the Thumbnail menu is open and the Thumbnail menu scroll-wheel setting is "Disabled"
9+
* If the active window changes when the Thumbnail menu is open, the outlined Thumbnail menu item will change if the new active window is one of the menu items
10+
311
## 2.3.6
412

513
* Added context menu options to close all/other windows for the buttons application (when button is not grouped)

CassiaWindowList@klangman/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ This is a Cinnamon window list and panel launcher applet based on CobiWindowList
22

33
Recent new features (Aug 2023 - Oct 2024):
44

5+
* Added scroll-wheel options, cycle all window-list windows and cycle group/pool windows
56
* Added context menu options to close all/other windows for the buttons application
67
* Saves new default thumbnail window sizes (adjusted using the mouse scroll-wheel) across cinnamon restarts
78
* Now uses application specific thumbnail windows sizes across all workspaces

CassiaWindowList@klangman/files/CassiaWindowList@klangman/4.0/applet.js

Lines changed: 129 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,13 +218,15 @@ const MouseAction = {
218218
AlwaysOnTop: 40 // Toggle the windows "Always on top" state
219219
}
220220

221-
// Possible value for the Mouse scroll wheel action setting
221+
// Possible value for the Mouse scroll wheel action setting (used when the Thumbnail menu is closed, or the Thumbnail scroll action is disabled)
222222
const MouseScrollAction = {
223223
None: 0,
224224
ChangeState: 1, // Minimize/Restore/Maximize the window
225225
ChangeWorkspace: 2, // Next/Previous workspace
226226
ChangeMonitor: 3, // Next/Previous monitor
227-
ChangeTiling: 4 // Change tiling in a counter/clockwise direction
227+
ChangeTiling: 4, // Change tiling in a counter/clockwise direction
228+
CycleButtons: 5, // Cycle through the windows for the window-list buttons
229+
CycleApp: 6 // Cycle through the windows for a group/pool
228230
}
229231

230232
// Possible settings for the left mouse action for grouped buttons (or Launcher with running windows)
@@ -253,6 +255,7 @@ const IndicatorType = {
253255
Auto: 7
254256
}
255257

258+
// This is the possible values for the scroll wheel when the Thumbnail menu is open
256259
const ScrollWheelAction = {
257260
Off: 0,
258261
On: 1,
@@ -1746,7 +1749,8 @@ class WindowListButton {
17461749
//this._signalManager.connect(metaWindow, "notify::progress", this._onProgressChange, this);
17471750
this._signalManager.connect(metaWindow, "workspace-changed", this._onWindowWorkspaceChanged, this);
17481751

1749-
this.actor.add_style_pseudo_class("active");
1752+
if (this._applet._displayPinned !== DisplayPinned.Disabled)
1753+
this.actor.add_style_pseudo_class("active");
17501754
this._updateTooltip();
17511755
if (this.menu && this._windows.length == 1) {
17521756
this._workspace.menuManager.addMenu(this.menu);
@@ -2351,6 +2355,8 @@ class WindowListButton {
23512355
let metaWindow = this._windows[i];
23522356
if (hasFocus(metaWindow, true) && !metaWindow.minimized) {
23532357
this.actor.add_style_pseudo_class("focus");
2358+
if (this._applet._displayPinned === DisplayPinned.Disabled)
2359+
this.actor.add_style_pseudo_class("active");
23542360
this.actor.remove_style_class_name(STYLE_CLASS_ATTENTION_STATE);
23552361
this._currentWindow = metaWindow;
23562362
this._updateLabel();
@@ -2363,6 +2369,8 @@ class WindowListButton {
23632369
break;
23642370
} else {
23652371
this.actor.remove_style_pseudo_class("focus");
2372+
if (this._applet._displayPinned === DisplayPinned.Disabled)
2373+
this.actor.remove_style_pseudo_class("active");
23662374
this._updateLabel();
23672375
if (this._workspace.iconSaturation!=100 && this._workspace.saturationType != SaturationType.All) {
23682376
this.updateIconSelection();
@@ -2557,9 +2565,9 @@ class WindowListButton {
25572565
_onScrollEvent(actor, event) {
25582566
let wheelSetting = this._settings.getValue("wheel-adjusts-preview-size");
25592567
if (wheelSetting===ScrollWheelAction.Off || !this.menu || !this.menu.isOpen) {
2560-
// The Thumbnail menu is closed, so do the defined scroll wheel action
2568+
// The Thumbnail menu is closed or the Thumbnail scroll action is disabled, so do the defined scroll wheel action
25612569
wheelSetting = this._settings.getValue("mouse-action-scroll");
2562-
if (wheelSetting !== MouseScrollAction.None && this._currentWindow && (!this.menu || !this.menu.isOpen)) {
2570+
if (wheelSetting !== MouseScrollAction.None && this._currentWindow /*&& (!this.menu || !this.menu.isOpen)*/) {
25632571
let window = this._currentWindow;
25642572
let direction = event.get_scroll_direction();
25652573
if (wheelSetting === MouseScrollAction.ChangeState) {
@@ -2660,6 +2668,84 @@ class WindowListButton {
26602668
} else if (direction === Clutter.ScrollDirection.DOWN) {
26612669
reTile(window, tilePrev);
26622670
}
2671+
} else if (wheelSetting === MouseScrollAction.CycleButtons) {
2672+
if (direction === Clutter.ScrollDirection.UP || direction === Clutter.ScrollDirection.DOWN) {
2673+
let childern = this._workspace.actor.get_children();
2674+
let window = global.display.get_focus_window();
2675+
if (window) {
2676+
let focus = this._workspace._lookupAppButtonForWindow(window);
2677+
let idx = childern.indexOf(focus.actor);
2678+
if (idx>=0) {
2679+
do {
2680+
if (direction === Clutter.ScrollDirection.DOWN) {
2681+
if (idx === childern.length-1) {
2682+
idx = 0;
2683+
} else {
2684+
idx += 1;
2685+
}
2686+
} else if (direction === Clutter.ScrollDirection.UP) {
2687+
if (idx === 0) {
2688+
idx = childern.length-1;
2689+
} else {
2690+
idx -= 1;
2691+
}
2692+
}
2693+
} while ( !childern[idx]._delegate._currentWindow ); // ignore pinned app buttons with no active windows
2694+
Main.activateWindow(childern[idx]._delegate._currentWindow);
2695+
}
2696+
}
2697+
}
2698+
} else if (wheelSetting === MouseScrollAction.CycleApp) {
2699+
if (direction === Clutter.ScrollDirection.UP || direction === Clutter.ScrollDirection.DOWN) {
2700+
if (this._windows.length === 1) {
2701+
let groupingType = this._settings.getValue("group-windows");
2702+
if ((groupingType == GroupType.Pooled || groupingType == GroupType.Auto) && this._grouped != GroupingType.ForcedOn) {
2703+
let window = global.display.get_focus_window();
2704+
let focus = this._workspace._lookupAppButtonForWindow(window);
2705+
if (focus._app != this._app) {
2706+
Main.activateWindow(this._currentWindow);
2707+
} else {
2708+
let btns = this._workspace._lookupAllAppButtonsForApp(this._app);
2709+
let idx = btns.indexOf(focus);
2710+
if (direction === Clutter.ScrollDirection.DOWN) {
2711+
if (idx === btns.length-1)
2712+
Main.activateWindow(btns[0]._currentWindow);
2713+
else
2714+
Main.activateWindow(btns[idx+1]._currentWindow);
2715+
} else {
2716+
if (idx === 0)
2717+
Main.activateWindow(btns[btns.length-1]._currentWindow);
2718+
else
2719+
Main.activateWindow(btns[idx-1]._currentWindow);
2720+
}
2721+
}
2722+
} else {
2723+
Main.activateWindow(this._currentWindow);
2724+
}
2725+
} else if (this._windows.length > 1) {
2726+
if (direction === Clutter.ScrollDirection.DOWN) {
2727+
if (hasFocus(this._currentWindow)) {
2728+
let idx = this._windows.indexOf(this._currentWindow);
2729+
if (idx === this._windows.length-1 )
2730+
Main.activateWindow(this._windows[0]);
2731+
else
2732+
Main.activateWindow(this._windows[idx+1]);
2733+
} else {
2734+
Main.activateWindow(this._currentWindow);
2735+
}
2736+
}else if (direction === Clutter.ScrollDirection.UP) {
2737+
if (hasFocus(this._currentWindow)) {
2738+
let idx = this._windows.indexOf(this._currentWindow);
2739+
if (idx === 0 )
2740+
Main.activateWindow(this._windows[this._windows.length-1]);
2741+
else
2742+
Main.activateWindow(this._windows[idx-1]);
2743+
} else {
2744+
Main.activateWindow(this._currentWindow);
2745+
}
2746+
}
2747+
}
2748+
}
26632749
}
26642750
}
26652751
return;
@@ -4479,6 +4565,7 @@ class Workspace {
44794565
Lang.bind(this, function(ancestor) {
44804566
newFocus = this._lookupAppButtonForWindow(ancestor);
44814567
if (newFocus) {
4568+
window = ancestor;
44824569
return(false);
44834570
}
44844571
return(true);
@@ -4488,6 +4575,8 @@ class Workspace {
44884575
if (newFocus) {
44894576
if (this._currentFocus && newFocus != this._currentFocus) {
44904577
this._currentFocus.actor.remove_style_pseudo_class("focus");
4578+
if (this._applet._displayPinned === DisplayPinned.Disabled)
4579+
this._currentFocus.actor.remove_style_pseudo_class("active");
44914580
this._currentFocus._updateLabel();
44924581
if (this.iconSaturation!=100 && this.saturationType == SaturationType.Focused) {
44934582
this._currentFocus.updateIconSelection();
@@ -4511,7 +4600,21 @@ class Workspace {
45114600
newFocus.appLastFocus = true;
45124601
this._currentFocus._updateNumber();
45134602
}
4603+
let prevCurrentWindow = (this._currentFocus)?this._currentFocus._currentWindow:null;
45144604
newFocus._updateFocus();
4605+
// If there is an open Thumbnail menu, update the outline highlighting
4606+
if (this.currentMenu && this.currentMenu.isOpen) {
4607+
let menuItem = this.currentMenu._findMenuItemForWindow(window);
4608+
if (menuItem) {
4609+
menuItem._box.add_style_pseudo_class('outlined');
4610+
}
4611+
if (prevCurrentWindow) {
4612+
let menuItem = this.currentMenu._findMenuItemForWindow(prevCurrentWindow);
4613+
if (menuItem) {
4614+
menuItem._box.remove_style_pseudo_class('outlined');
4615+
}
4616+
}
4617+
}
45154618
this._currentFocus = newFocus;
45164619
}
45174620
}
@@ -5420,6 +5523,26 @@ class WindowList extends Applet.Applet {
54205523

54215524
_onDisplayPinnedChanged(){
54225525
let newDisplayPinned = this._settings.getValue("display-pinned");
5526+
if (newDisplayPinned != this._displayPinned && (newDisplayPinned === DisplayPinned.Disabled || this._displayPinned === DisplayPinned.Disabled)) {
5527+
// Need to reset the buttons so that the "active" pseudo class style is set correctly for all buttons
5528+
for (let i = 0; i < this._workspaces.length; i++) {
5529+
let ws = this._workspaces[i];
5530+
if (newDisplayPinned === DisplayPinned.Disabled) {
5531+
ws._appButtons.forEach( (btn) => { btn.actor.remove_style_pseudo_class("active");} );
5532+
// Now we need to add the "active" style back to the focused window
5533+
let window = global.display.get_focus_window();
5534+
if (window) {
5535+
let curWS = global.screen.get_active_workspace_index();
5536+
let focus = this._workspaces[curWS]._lookupAppButtonForWindow(window);
5537+
if (focus) {
5538+
focus.actor.add_style_pseudo_class("active");
5539+
}
5540+
}
5541+
} else {
5542+
ws._appButtons.forEach( (btn) => { btn.actor.add_style_pseudo_class("active");} );
5543+
}
5544+
}
5545+
}
54235546
let curWS = global.screen.get_active_workspace_index();
54245547
if (newDisplayPinned == DisplayPinned.Synchronized && this._displayPinned == DisplayPinned.Enabled) {
54255548
let pinSetting = this._settings.getValue("pinned-apps");
@@ -5433,7 +5556,7 @@ class WindowList extends Applet.Applet {
54335556
}
54345557
if (newDisplayPinned != this._displayPinned) {
54355558
this._displayPinned = newDisplayPinned;
5436-
this._updatePinnedApps();
5559+
this._workspaces[curWS]._updatePinnedApps();
54375560
}
54385561
}
54395562

CassiaWindowList@klangman/files/CassiaWindowList@klangman/4.0/settings-schema.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,8 @@
709709
"Change windows workspace": 2,
710710
"Change windows monitor": 3,
711711
"Change window tiling": 4,
712+
"Cycle all window-list button windows": 5,
713+
"Cycle grouped/pooled button windows": 6,
712714
"Do nothing": 0
713715
},
714716
"description": "Scroll wheel action",

CassiaWindowList@klangman/files/CassiaWindowList@klangman/6.0/settings-schema.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,8 @@
709709
"Change windows workspace": 2,
710710
"Change windows monitor": 3,
711711
"Change window tiling": 4,
712+
"Cycle all window-list button windows": 5,
713+
"Cycle grouped/pooled button windows": 6,
712714
"Do nothing": 0
713715
},
714716
"description": "Scroll wheel action",

CassiaWindowList@klangman/files/CassiaWindowList@klangman/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"max-instances": -1,
66
"multiversion": true,
77
"role": "panellauncher",
8-
"version": "2.3.6",
8+
"version": "2.3.7",
99
"author": "klangman"
1010
}

0 commit comments

Comments
 (0)