@@ -18,7 +18,7 @@ class WorkspaceButton {
1818 constructor ( index , applet ) {
1919 this . index = index ;
2020 this . applet = applet ;
21- this . workspace = global . screen . get_workspace_by_index ( this . index ) ;
21+ this . workspace = global . workspace_manager . get_workspace_by_index ( this . index ) ;
2222 this . workspace_name = Main . getWorkspaceName ( index ) ;
2323 this . actor = null ; // defined in subclass
2424
@@ -34,7 +34,7 @@ class WorkspaceButton {
3434 show ( ) {
3535 this . actor . connect ( 'button-release-event' , Lang . bind ( this , this . onClicked ) ) ;
3636 this . _tooltip = new Tooltips . PanelItemTooltip ( this , this . workspace_name , this . applet . orientation ) ;
37- if ( this . index === global . screen . get_active_workspace_index ( ) ) {
37+ if ( this . index === global . workspace_manager . get_active_workspace_index ( ) ) {
3838 this . activate ( true ) ;
3939 }
4040 }
@@ -306,21 +306,21 @@ class CinnamonWorkspaceSwitcher extends Applet.Applet {
306306 this . removeWorkspace ( ) ;
307307 } ) ) ;
308308 this . _applet_context_menu . addMenuItem ( this . removeWorkspaceMenuItem ) ;
309- this . removeWorkspaceMenuItem . setSensitive ( global . screen . n_workspaces > 1 ) ;
309+ this . removeWorkspaceMenuItem . setSensitive ( global . workspace_manager . n_workspaces > 1 ) ;
310310 }
311311
312- onNumberOfWorkspacesChanged ( ) {
313- this . removeWorkspaceMenuItem . setSensitive ( global . screen . n_workspaces > 1 ) ;
312+ onWorkspacesUpdated ( ) {
313+ this . removeWorkspaceMenuItem . setSensitive ( global . workspace_manager . n_workspaces > 1 ) ;
314314 this . _createButtons ( ) ;
315315 }
316316
317317 removeWorkspace ( ) {
318- if ( global . screen . n_workspaces <= 1 ) {
318+ if ( global . workspace_manager . n_workspaces <= 1 ) {
319319 return ;
320320 }
321- this . workspace_index = global . screen . get_active_workspace_index ( ) ;
321+ this . workspace_index = global . workspace_manager . get_active_workspace_index ( ) ;
322322 let removeAction = Lang . bind ( this , function ( ) {
323- Main . _removeWorkspace ( global . screen . get_active_workspace ( ) ) ;
323+ Main . _removeWorkspace ( global . workspace_manager . get_active_workspace ( ) ) ;
324324 } ) ;
325325 if ( ! Main . hasDefaultWorkspaceName ( this . workspace_index ) ) {
326326 let prompt = _ ( "Are you sure you want to remove workspace \"%s\"?\n\n" ) . format (
@@ -407,7 +407,7 @@ class CinnamonWorkspaceSwitcher extends Applet.Applet {
407407 this . actor . set_important ( true ) ;
408408
409409 this . buttons = [ ] ;
410- for ( let i = 0 ; i < global . screen . n_workspaces ; ++ i ) {
410+ for ( let i = 0 ; i < global . workspace_manager . n_workspaces ; ++ i ) {
411411 if ( this . display_type == "visual" )
412412 this . buttons [ i ] = new WorkspaceGraph ( i , this ) ;
413413 else
@@ -443,7 +443,7 @@ class CinnamonWorkspaceSwitcher extends Applet.Applet {
443443 }
444444
445445 _onPositionChanged ( ) {
446- let button = this . buttons [ global . screen . get_active_workspace_index ( ) ] ;
446+ let button = this . buttons [ global . workspace_manager . get_active_workspace_index ( ) ] ;
447447 button . update ( ) ;
448448 }
449449
0 commit comments