@@ -5,18 +5,10 @@ import GLib from 'gi://GLib';
55import Meta from 'gi://Meta' ;
66import Shell from 'gi://Shell' ;
77import WorkspaceSwitcherPopup from "./workspaceSwitcherPopup.js" ;
8- // import {SCROLL_TIMEOUT_TIME} from 'resource:///org/gnome/shell/ui/windowManager.js';
9- // import {WorkspaceAnimationController} from "./workspaceAnimation.js";
10- import { GNOMEversionCompare } from 'resource:///org/gnome/shell/misc/util.js' ;
8+ import { SCROLL_TIMEOUT_TIME } from 'resource:///org/gnome/shell/ui/windowManager.js' ;
9+ import { WorkspaceAnimationController } from "./workspaceAnimation.js" ;
1110import { PACKAGE_VERSION } from 'resource:///org/gnome/shell/misc/config.js' ;
1211
13- let SCROLL_TIMEOUT_TIME = 150 ;
14- if ( GNOMEversionCompare ( PACKAGE_VERSION , '45.1' ) >= 0 ) {
15- import ( 'resource:///org/gnome/shell/ui/windowManager.js' ) . then ( ( mod ) => {
16- SCROLL_TIMEOUT_TIME = mod . SCROLL_TIMEOUT_TIME ;
17- } ) ;
18- }
19-
2012const WraparoundMode = {
2113 NONE : 0 ,
2214 NEXT_PREV : 1 ,
@@ -36,11 +28,15 @@ export default class WorkspaceManagerOverride {
3628 this . _keybindings = keybindings ;
3729 this . _overviewKeybindingActions = { } ;
3830 this . monitors = [ ] ;
39- }
4031
41- async enable ( ) {
42- await this . _initOverrides ( )
32+ this . _workspaceAnimation = new WorkspaceAnimationController ( ) ;
33+ this . overrideProperties = [
34+ '_workspaceAnimation' ,
35+ 'handleWorkspaceScroll' ,
36+ ] ;
37+ }
4338
39+ enable ( ) {
4440 this . _overrideDynamicWorkspaces ( ) ;
4541 this . _overrideKeybindingHandlers ( ) ;
4642 this . _overrideOriginalProperties ( ) ;
@@ -53,23 +49,6 @@ export default class WorkspaceManagerOverride {
5349 this . _connectLayoutManager ( ) ;
5450 }
5551
56- // This can be moved to the constructor again if there is no need for the conditional
57- // import any more.
58- async _initOverrides ( ) {
59- // this._workspaceAnimation = new WorkspaceAnimationController();
60- this . overrideProperties = [
61- // '_workspaceAnimation',
62- 'handleWorkspaceScroll' ,
63- ] ;
64-
65- // This only works starting in GNOME Shell 45.1 and up.
66- if ( GNOMEversionCompare ( PACKAGE_VERSION , '45.1' ) >= 0 ) {
67- const { WorkspaceAnimationController} = await import ( "./workspaceAnimation.js" ) ;
68- this . _workspaceAnimation = new WorkspaceAnimationController ( ) ;
69- this . overrideProperties . push ( '_workspaceAnimation' ) ;
70- }
71- }
72-
7352 disable ( ) {
7453 this . _destroyWorkspaceSwitcherPopup ( ) ;
7554 this . _restoreLayout ( ) ;
0 commit comments