gnome/extensions/dash-to-dock@micxgx.gmail.com/appIcons.js
// acting on windows (closing) are performed while the menu is shown.
acting on windows (closing) are performed while the menu is shown.
acting on windows ( closing ) are performed while the menu is shown .
update() {
      let windows = this._source.getInterestingWindows();
      if ( windows.length > 0) {
          let quitFromDashMenuText = "";
          if (windows.length == 1)
              this._quitfromDashMenuItem.label.set_text(_('Quit'));
          else
              this._quitfromDashMenuItem.label.set_text(__('Quit %d Windows').format(windows.length));
          this._quitfromDashMenuItem.actor.show();
      } else {
          this._quitfromDashMenuItem.actor.hide();
      }
      if(Docking.DockManager.settings.get_boolean('show-windows-preview')){
          let old_windows = this._allWindowsMenuItem.menu._getMenuItems().map(function(item){
              return item._window;
          });
          let new_windows = windows.filter(function(w) {return old_windows.indexOf(w) < 0;});
          if (new_windows.length > 0) {
              this._populateAllWindowMenu(windows);
              this._allWindowsMenuItem.width =  this._allWindowsMenuItem.menu.actor.width + 15;
          }
          if (windows.length > 0){
              this._allWindowsMenuItem.show();
              this._allWindowsMenuItem.setSensitive(true);
          }
      }
      this._getMenuItems().forEach(item => {
          if ('label' in item) {
              this._updateSeparatorVisibility(item);
          }
      });
    }
update ( ) { let windows = this . _source . getInterestingWindows ( ) ; if ( windows . length > 0 ) { let quitFromDashMenuText = "" ; if ( windows . length == 1 ) this . _quitfromDashMenuItem . label . set_text ( _ ( 'Quit' ) ) ; else this . _quitfromDashMenuItem . label . set_text ( __ ( 'Quit %d Windows' ) . format ( windows . length ) ) ; this . _quitfromDashMenuItem . actor . show ( ) ; } else { this . _quitfromDashMenuItem . actor . hide ( ) ; } if ( Docking . DockManager . settings . get_boolean ( 'show-windows-preview' ) ) { let old_windows = this . _allWindowsMenuItem . menu . _getMenuItems ( ) . map ( function ( item ) { return item . _window ; } ) ; let new_windows = windows . filter ( function ( w ) { return old_windows . indexOf ( w ) < 0 ; } ) ; if ( new_windows . length > 0 ) { this . _populateAllWindowMenu ( windows ) ; this . _allWindowsMenuItem . width = this . _allWindowsMenuItem . menu . actor . width + 15 ; } if ( windows . length > 0 ) { this . _allWindowsMenuItem . show ( ) ; this . _allWindowsMenuItem . setSensitive ( true ) ; } } this . _getMenuItems ( ) . forEach ( item => { if ( 'label' in item ) { this . _updateSeparatorVisibility ( item ) ; } } ) ; }
acting on windows (closing) are performed while the menu is shown.
acting on windows ( closing ) are performed while the menu is shown .
// update, show or hide the quit menu // update, show, or hide the allWindows menu // Check if there are new windows not already displayed. In such case, repopulate the allWindows // menu. Windows removal is already handled by each preview being connected to the destroy signal // Try to set the width to that of the submenu. // TODO: can't get the actual size, getting a bit less. // Temporary workaround: add 15px to compensate // The menu is created hidden and never hidded after being shown. Instead, a singlal // connected to its items destroy will set is insensitive if no more windows preview are shown. // Update separators