@@ -328,7 +328,8 @@ class GroupedWindowListApplet extends Applet.Applet {
328328 { key : 'show-recent' , value : 'showRecent' , cb : null } ,
329329 { key : 'autostart-menu-item' , value : 'autoStart' , cb : null } ,
330330 { key : 'monitor-move-all-windows' , value : 'monitorMoveAllWindows' , cb : null } ,
331- { key : 'show-all-workspaces' , value : 'showAllWorkspaces' , cb : this . refreshAllAppLists }
331+ { key : 'show-all-workspaces' , value : 'showAllWorkspaces' , cb : this . refreshAllAppLists } ,
332+ { key : 'window-display-settings' , value : 'windowDisplaySettings' , cb : this . reloadAllAppsMonitor }
332333 ] ;
333334
334335 for ( let i = 0 , len = settingsProps . length ; i < len ; i ++ ) {
@@ -503,39 +504,51 @@ class GroupedWindowListApplet extends Applet.Applet {
503504
504505 }
505506
507+ reloadAllAppsMonitor ( ) {
508+ this . refreshAllAppLists ( ) ;
509+ this . updateMonitorWatchlist ( ) ;
510+ }
511+
506512 updateMonitorWatchlist ( ) {
507513 if ( ! this . numberOfMonitors ) {
508514 this . numberOfMonitors = global . display . get_n_monitors ( ) ;
509515 }
510516 const onPrimary = this . panel . monitorIndex === Main . layoutManager . primaryIndex ;
511517 const instances = Main . AppletManager . getRunningInstancesForUuid ( this . state . uuid ) ;
512518 let { monitorWatchList} = this . state ;
513- /* Simple cases */
514- if ( this . numberOfMonitors === 1 ) {
515- monitorWatchList = [ Main . layoutManager . primaryIndex ] ;
516- } else if ( instances . length > 1 && ! onPrimary ) {
517- monitorWatchList = [ this . panel . monitorIndex ] ;
519+
520+ // Show all applications from all monitors
521+ if ( this . state . settings . windowDisplaySettings === 2 ) {
522+ monitorWatchList = Array . from ( { length : this . numberOfMonitors } , ( _ , i ) => i ) ;
523+
518524 } else {
519- /* This is an instance on the primary monitor - it will be
520- * responsible for any monitors not covered individually. First
521- * convert the instances list into a list of the monitor indices,
522- * and then add the monitors not present to the monitor watch list
523- * */
524- monitorWatchList = [ this . panel . monitorIndex ] ;
525- for ( let i = 0 ; i < instances . length ; i ++ ) {
526- if ( ! instances [ i ] ) {
527- continue ;
525+ // Original logic
526+ if ( this . numberOfMonitors === 1 ) {
527+ monitorWatchList = [ Main . layoutManager . primaryIndex ] ;
528+ } else if ( instances . length > 1 && ! onPrimary ) {
529+ monitorWatchList = [ this . panel . monitorIndex ] ;
530+ } else {
531+ /* This is an instance on the primary monitor - it will be
532+ * responsible for any monitors not covered individually. First
533+ * convert the instances list into a list of the monitor indices,
534+ * and then add the monitors not present to the monitor watch list
535+ * */
536+ monitorWatchList = [ this . panel . monitorIndex ] ;
537+ for ( let i = 0 ; i < instances . length ; i ++ ) {
538+ if ( ! instances [ i ] ) {
539+ continue ;
540+ }
541+ instances [ i ] = instances [ i ] . panel . monitorIndex ;
528542 }
529- instances [ i ] = instances [ i ] . panel . monitorIndex ;
530- }
531-
532- for ( let i = 0 ; i < this . numberOfMonitors ; i ++ ) {
533- if ( instances . indexOf ( i ) === - 1 ) {
534- monitorWatchList . push ( i ) ;
543+ for ( let i = 0 ; i < this . numberOfMonitors ; i ++ ) {
544+ if ( instances . indexOf ( i ) === - 1 ) {
545+ monitorWatchList . push ( i ) ;
546+ }
535547 }
536548 }
537549 }
538- this . state . set ( { monitorWatchList} ) ;
550+ this . state . set ( { monitorWatchList } ) ;
551+ global . log ( "Monitor Watch List updated: " + JSON . stringify ( monitorWatchList ) ) ;
539552 }
540553
541554 refreshCurrentAppList ( ) {
0 commit comments