@@ -218,13 +218,15 @@ const MouseAction = {
218
218
AlwaysOnTop : 40 // Toggle the windows "Always on top" state
219
219
}
220
220
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)
222
222
const MouseScrollAction = {
223
223
None : 0 ,
224
224
ChangeState : 1 , // Minimize/Restore/Maximize the window
225
225
ChangeWorkspace : 2 , // Next/Previous workspace
226
226
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
228
230
}
229
231
230
232
// Possible settings for the left mouse action for grouped buttons (or Launcher with running windows)
@@ -253,6 +255,7 @@ const IndicatorType = {
253
255
Auto : 7
254
256
}
255
257
258
+ // This is the possible values for the scroll wheel when the Thumbnail menu is open
256
259
const ScrollWheelAction = {
257
260
Off : 0 ,
258
261
On : 1 ,
@@ -1746,7 +1749,8 @@ class WindowListButton {
1746
1749
//this._signalManager.connect(metaWindow, "notify::progress", this._onProgressChange, this);
1747
1750
this . _signalManager . connect ( metaWindow , "workspace-changed" , this . _onWindowWorkspaceChanged , this ) ;
1748
1751
1749
- this . actor . add_style_pseudo_class ( "active" ) ;
1752
+ if ( this . _applet . _displayPinned !== DisplayPinned . Disabled )
1753
+ this . actor . add_style_pseudo_class ( "active" ) ;
1750
1754
this . _updateTooltip ( ) ;
1751
1755
if ( this . menu && this . _windows . length == 1 ) {
1752
1756
this . _workspace . menuManager . addMenu ( this . menu ) ;
@@ -2351,6 +2355,8 @@ class WindowListButton {
2351
2355
let metaWindow = this . _windows [ i ] ;
2352
2356
if ( hasFocus ( metaWindow , true ) && ! metaWindow . minimized ) {
2353
2357
this . actor . add_style_pseudo_class ( "focus" ) ;
2358
+ if ( this . _applet . _displayPinned === DisplayPinned . Disabled )
2359
+ this . actor . add_style_pseudo_class ( "active" ) ;
2354
2360
this . actor . remove_style_class_name ( STYLE_CLASS_ATTENTION_STATE ) ;
2355
2361
this . _currentWindow = metaWindow ;
2356
2362
this . _updateLabel ( ) ;
@@ -2363,6 +2369,8 @@ class WindowListButton {
2363
2369
break ;
2364
2370
} else {
2365
2371
this . actor . remove_style_pseudo_class ( "focus" ) ;
2372
+ if ( this . _applet . _displayPinned === DisplayPinned . Disabled )
2373
+ this . actor . remove_style_pseudo_class ( "active" ) ;
2366
2374
this . _updateLabel ( ) ;
2367
2375
if ( this . _workspace . iconSaturation != 100 && this . _workspace . saturationType != SaturationType . All ) {
2368
2376
this . updateIconSelection ( ) ;
@@ -2557,9 +2565,9 @@ class WindowListButton {
2557
2565
_onScrollEvent ( actor , event ) {
2558
2566
let wheelSetting = this . _settings . getValue ( "wheel-adjusts-preview-size" ) ;
2559
2567
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
2561
2569
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)*/ ) {
2563
2571
let window = this . _currentWindow ;
2564
2572
let direction = event . get_scroll_direction ( ) ;
2565
2573
if ( wheelSetting === MouseScrollAction . ChangeState ) {
@@ -2660,6 +2668,84 @@ class WindowListButton {
2660
2668
} else if ( direction === Clutter . ScrollDirection . DOWN ) {
2661
2669
reTile ( window , tilePrev ) ;
2662
2670
}
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
+ }
2663
2749
}
2664
2750
}
2665
2751
return ;
@@ -4479,6 +4565,7 @@ class Workspace {
4479
4565
Lang . bind ( this , function ( ancestor ) {
4480
4566
newFocus = this . _lookupAppButtonForWindow ( ancestor ) ;
4481
4567
if ( newFocus ) {
4568
+ window = ancestor ;
4482
4569
return ( false ) ;
4483
4570
}
4484
4571
return ( true ) ;
@@ -4488,6 +4575,8 @@ class Workspace {
4488
4575
if ( newFocus ) {
4489
4576
if ( this . _currentFocus && newFocus != this . _currentFocus ) {
4490
4577
this . _currentFocus . actor . remove_style_pseudo_class ( "focus" ) ;
4578
+ if ( this . _applet . _displayPinned === DisplayPinned . Disabled )
4579
+ this . _currentFocus . actor . remove_style_pseudo_class ( "active" ) ;
4491
4580
this . _currentFocus . _updateLabel ( ) ;
4492
4581
if ( this . iconSaturation != 100 && this . saturationType == SaturationType . Focused ) {
4493
4582
this . _currentFocus . updateIconSelection ( ) ;
@@ -4511,7 +4600,21 @@ class Workspace {
4511
4600
newFocus . appLastFocus = true ;
4512
4601
this . _currentFocus . _updateNumber ( ) ;
4513
4602
}
4603
+ let prevCurrentWindow = ( this . _currentFocus ) ?this . _currentFocus . _currentWindow :null ;
4514
4604
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
+ }
4515
4618
this . _currentFocus = newFocus ;
4516
4619
}
4517
4620
}
@@ -5420,6 +5523,26 @@ class WindowList extends Applet.Applet {
5420
5523
5421
5524
_onDisplayPinnedChanged ( ) {
5422
5525
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
+ }
5423
5546
let curWS = global . screen . get_active_workspace_index ( ) ;
5424
5547
if ( newDisplayPinned == DisplayPinned . Synchronized && this . _displayPinned == DisplayPinned . Enabled ) {
5425
5548
let pinSetting = this . _settings . getValue ( "pinned-apps" ) ;
@@ -5433,7 +5556,7 @@ class WindowList extends Applet.Applet {
5433
5556
}
5434
5557
if ( newDisplayPinned != this . _displayPinned ) {
5435
5558
this . _displayPinned = newDisplayPinned ;
5436
- this . _updatePinnedApps ( ) ;
5559
+ this . _workspaces [ curWS ] . _updatePinnedApps ( ) ;
5437
5560
}
5438
5561
}
5439
5562
0 commit comments