Updating 46/vertical-workspaces to version 46.2+20240828 [5b87af5].
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
6c3def31e8
commit
f2db668ec8
27 changed files with 6003 additions and 4248 deletions
|
@ -10,14 +10,11 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import St from 'gi://St';
|
||||
|
||||
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
||||
import * as ModalDialog from 'resource:///org/gnome/shell/ui/modalDialog.js';
|
||||
|
||||
import * as Config from 'resource:///org/gnome/shell/misc/config.js';
|
||||
|
||||
|
@ -75,8 +72,11 @@ export default class VShell extends Extension.Extension {
|
|||
Me.ESP_PREFIX = 'eq//';
|
||||
|
||||
Me.opt = new Me.Settings.Options(Me);
|
||||
opt = Me.opt;
|
||||
|
||||
Me.Util.init(Me);
|
||||
|
||||
Me.updateMessageDialog = new Me.Util.RestartMessage();
|
||||
}
|
||||
|
||||
_cleanGlobals() {
|
||||
|
@ -87,14 +87,28 @@ export default class VShell extends Extension.Extension {
|
|||
|
||||
enable() {
|
||||
this._init();
|
||||
// flag for Util.getEnabledExtensions()
|
||||
Me.extensionsLoadIncomplete = Main.layoutManager._startingUp;
|
||||
opt = Me.opt;
|
||||
|
||||
this._initModules();
|
||||
this.activateVShell();
|
||||
|
||||
Me.extensionsLoadIncomplete = false;
|
||||
// prevent conflicts during startup
|
||||
let skipStartup = Me.gSettings.get_boolean('delay-startup') ||
|
||||
Me.Util.getEnabledExtensions('ubuntu-dock').length ||
|
||||
Me.Util.getEnabledExtensions('dash-to-dock').length ||
|
||||
Me.Util.getEnabledExtensions('dash2dock').length ||
|
||||
Me.Util.getEnabledExtensions('dash-to-panel').length;
|
||||
if (skipStartup && Main.layoutManager._startingUp) {
|
||||
this._startupConId = Main.layoutManager.connect('startup-complete', () => {
|
||||
this._delayedStartup = true;
|
||||
this._activateVShell();
|
||||
// Since VShell has been activated with a delay, move it in extensionOrder
|
||||
let extensionOrder = Main.extensionManager._extensionOrder;
|
||||
const idx = extensionOrder.indexOf(this.metadata.uuid);
|
||||
extensionOrder.push(extensionOrder.splice(idx, 1)[0]);
|
||||
Main.layoutManager.disconnect(this._startupConId);
|
||||
this._startupConId = 0;
|
||||
});
|
||||
} else {
|
||||
this._activateVShell();
|
||||
}
|
||||
|
||||
console.debug(`${Me.metadata.name}: enabled`);
|
||||
}
|
||||
|
@ -102,10 +116,14 @@ export default class VShell extends Extension.Extension {
|
|||
// Reason for using "unlock-dialog" session mode:
|
||||
// Updating the "appDisplay" content every time the screen is locked/unlocked takes quite a lot of time and affects the user experience.
|
||||
disable() {
|
||||
if (this._startupConId)
|
||||
Main.layoutManager.disconnect(this._startupConId);
|
||||
this.removeVShell();
|
||||
this._disposeModules();
|
||||
|
||||
console.debug(`${Me.metadata.name}: disabled`);
|
||||
Me.updateMessageDialog.destroy();
|
||||
Me.updateMessageDialog = null;
|
||||
this._cleanGlobals();
|
||||
}
|
||||
|
||||
|
@ -152,15 +170,24 @@ export default class VShell extends Extension.Extension {
|
|||
Me.Modules = null;
|
||||
}
|
||||
|
||||
activateVShell() {
|
||||
_activateVShell() {
|
||||
this._enabled = true;
|
||||
|
||||
if (!this._delayedStartup && !Main.sessionMode.isLocked) {
|
||||
Me.updateMessageDialog.showMessage();
|
||||
this._delayedStartup = false;
|
||||
}
|
||||
|
||||
this._originalGetNeighbor = Meta.Workspace.prototype.get_neighbor;
|
||||
|
||||
this._removeTimeouts();
|
||||
this._timeouts = {};
|
||||
|
||||
this._ensureOverviewIsHidden();
|
||||
if (!Main.layoutManager._startingUp)
|
||||
this._ensureOverviewIsHidden();
|
||||
|
||||
// store dash _workId so we will be able to detect replacement when entering overview
|
||||
this._storeDashId();
|
||||
|
||||
// load VShell configuration
|
||||
this._updateSettings();
|
||||
|
@ -184,9 +211,6 @@ export default class VShell extends Extension.Extension {
|
|||
|
||||
this._updateSettingsConnection();
|
||||
|
||||
// store dash _workId so we will be able to detect replacement when entering overview
|
||||
this._storeDashId();
|
||||
|
||||
// workaround for upstream bug - overview always shows workspace 1 instead of the active one after restart
|
||||
this._setInitialWsIndex();
|
||||
|
||||
|
@ -213,8 +237,6 @@ export default class VShell extends Extension.Extension {
|
|||
// switch PageUp/PageDown workspace switcher shortcuts
|
||||
this._switchPageShortcuts();
|
||||
|
||||
// hide status message if shown
|
||||
this._showStatusMessage(false);
|
||||
this._prevDash = null;
|
||||
|
||||
// restore default animation speed
|
||||
|
@ -226,7 +248,6 @@ export default class VShell extends Extension.Extension {
|
|||
_ensureOverviewIsHidden() {
|
||||
if (Main.overview._shown) {
|
||||
Main.overview._shown = false;
|
||||
// Main.overview._animationInProgress = true;
|
||||
Main.overview._visibleTarget = false;
|
||||
Main.overview._overview.prepareToLeaveOverview();
|
||||
Main.overview._changeShownState('HIDING');
|
||||
|
@ -237,11 +258,13 @@ export default class VShell extends Extension.Extension {
|
|||
|
||||
_resetShellProperties() {
|
||||
const controls = Main.overview._overview.controls;
|
||||
// remove any position offsets from dash and ws thumbnails
|
||||
if (!Me.Util.dashNotDefault()) {
|
||||
controls.dash.translation_x = 0;
|
||||
controls.dash.translation_y = 0;
|
||||
}
|
||||
// layoutManager._dash retains reference to the default dash even when DtD is enabled
|
||||
const dash = controls.layoutManager._dash;
|
||||
// Restore default dash background style
|
||||
dash._background.set_style('');
|
||||
|
||||
dash.translation_x = 0;
|
||||
dash.translation_y = 0;
|
||||
controls._thumbnailsBox.translation_x = 0;
|
||||
controls._thumbnailsBox.translation_y = 0;
|
||||
controls._searchEntryBin.translation_y = 0;
|
||||
|
@ -255,9 +278,6 @@ export default class VShell extends Extension.Extension {
|
|||
controls._thumbnailsBox.opacity = 255;
|
||||
|
||||
controls._searchController._searchResults.opacity = 255;
|
||||
|
||||
// restore default dash background style
|
||||
controls.dash._background.set_style('');
|
||||
}
|
||||
|
||||
_removeTimeouts() {
|
||||
|
@ -297,8 +317,7 @@ export default class VShell extends Extension.Extension {
|
|||
|
||||
_updateConnections() {
|
||||
if (!this._monitorsChangedConId)
|
||||
this._monitorsChangedConId = Main.layoutManager.connect('monitors-changed', () => this._updateVShell(2000));
|
||||
|
||||
this._monitorsChangedConId = Main.layoutManager.connect('monitors-changed', () => this._adaptToSystemChange());
|
||||
|
||||
if (!this._showingOverviewConId)
|
||||
this._showingOverviewConId = Main.overview.connect('showing', this._onShowingOverview.bind(this));
|
||||
|
@ -317,7 +336,9 @@ export default class VShell extends Extension.Extension {
|
|||
}
|
||||
);
|
||||
} else if (session.currentMode === 'unlock-dialog') {
|
||||
Me.Modules.panelModule.update(true);
|
||||
Me.Modules.panelModule.update();
|
||||
Main.layoutManager.panelBox.translation_y = 0;
|
||||
Main.panel.opacity = 255;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -341,14 +362,14 @@ export default class VShell extends Extension.Extension {
|
|||
// UNINSTALLED: 99,
|
||||
// };
|
||||
// no need to restart on disable/remove
|
||||
// - if DtD was enabled before VShell, VShell will be rebased by extensionSystem
|
||||
// - if DtD was enabled after VShell, the first _showingOverview detect replacement of the dash and repair VShell
|
||||
// - if DtD was enabled before VShell, VShell will be rebased by the extensionSystem
|
||||
// - If DtD was enabled after VShell, the first _showingOverview detects the replacement of the dash and repairs VShell
|
||||
const reset = [1, 2].includes(extension.state);
|
||||
const dashReplacement = uuid.includes('dash-to-dock') || uuid.includes('ubuntu-dock') || uuid.includes('dash-to-panel');
|
||||
if (dashReplacement && reset)
|
||||
this._watchDashToDock = true;
|
||||
if (!Main.layoutManager._startingUp && reset && dashReplacement)
|
||||
this._updateVShell(1999);
|
||||
this._adaptToSystemChange(2000);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -427,50 +448,14 @@ export default class VShell extends Extension.Extension {
|
|||
|
||||
Me.Modules.layoutModule.update(reset);
|
||||
Me.Modules.dashModule.update(reset);
|
||||
// avoid enabling panel module when session is locked
|
||||
if (reset || (!reset && !Main.sessionMode.isLocked))
|
||||
Me.Modules.panelModule.update(reset);
|
||||
// the panel must be visible when screen is locked
|
||||
// at startup time, panel will be updated from the startupAnimation after allocation
|
||||
if (!reset && Main.sessionMode.isLocked && !Main.layoutManager._startingUp)
|
||||
Me.Modules.panelModule._showPanel(true);
|
||||
// PanelModule._showPanel(true);
|
||||
// hide panel so it appears directly on the final place
|
||||
/* else if (Main.layoutManager._startingUp && !Meta.is_restart())
|
||||
Main.panel.opacity = 0;*/
|
||||
Me.Modules.panelModule.update(reset);
|
||||
|
||||
Me.Modules.workspaceAnimationModule.update(reset);
|
||||
Me.Modules.workspaceSwitcherPopupModule.update(reset);
|
||||
|
||||
Me.Modules.swipeTrackerModule.update(reset);
|
||||
|
||||
Me.Modules.searchModule.update(reset);
|
||||
|
||||
// don't rebuild app grid on any screen lock
|
||||
// even if the extension includes unlock-screen session mode
|
||||
// disable/enable is called at least once even on GS44
|
||||
// when screen lock is activated for the first time
|
||||
// because every first disable of each extension rebases
|
||||
// the entire extensions stack that was enabled later
|
||||
if (Main.sessionMode.isLocked)
|
||||
this._sessionLockActive = true;
|
||||
|
||||
// This covers unnecessary enable/disable cycles during first screen lock when extensions are rebased, but is not allowed by the EGO rules
|
||||
if (!this._sessionLockActive || !Main.extensionManager._getEnabledExtensions().includes(Me.metadata.uuid)) {
|
||||
// iconGridModule will be updated from appDisplayModule
|
||||
Me.Modules.appDisplayModule.update(reset);
|
||||
}
|
||||
|
||||
if (!this._sessionLockActive && !Main.layoutManager._startingUp && opt.APP_GRID_PERFORMANCE) {
|
||||
// Avoid showing status at startup, can cause freeze
|
||||
this._showStatusMessage();
|
||||
}
|
||||
|
||||
if (!Main.sessionMode.isLocked)
|
||||
this._sessionLockActive = false;
|
||||
|
||||
// iconGridModule will be updated from appDisplayModule
|
||||
// Me.Modules.appDisplayModule.update(reset);
|
||||
Me.Modules.appDisplayModule.update(reset);
|
||||
|
||||
Me.Modules.windowAttentionHandlerModule.update(reset);
|
||||
Me.Modules.appFavoritesModule.update(reset);
|
||||
|
@ -479,32 +464,34 @@ export default class VShell extends Extension.Extension {
|
|||
Me.Modules.overlayKeyModule.update(reset);
|
||||
Me.Modules.searchControllerModule.update(reset);
|
||||
|
||||
if (Main.sessionMode.isLocked)
|
||||
this._sessionLockActive = true;
|
||||
|
||||
if (!Main.sessionMode.isLocked)
|
||||
this._sessionLockActive = false;
|
||||
|
||||
if (!reset && !Main.layoutManager._startingUp)
|
||||
Main.overview._overview.controls.setInitialTranslations();
|
||||
if (this._sessionLockActive) {
|
||||
Main.layoutManager.panelBox.translation_y = 0;
|
||||
Main.panel.opacity = 255;
|
||||
}
|
||||
}
|
||||
|
||||
_onShowingOverview() {
|
||||
if (Main.layoutManager._startingUp)
|
||||
return;
|
||||
|
||||
Main.overview._overview.controls.opacity = 255;
|
||||
|
||||
// store pointer X coordinate for OVERVIEW_MODE 1 window spread - if mouse pointer is steady, don't spread
|
||||
opt.showingPointerX = global.get_pointer()[0];
|
||||
|
||||
if (!Main.overview._overview.controls._bgManagers && (opt.SHOW_BG_IN_OVERVIEW || opt.SHOW_WS_PREVIEW_BG) && !Me.Util.getEnabledExtensions('blur-my-shell').length)
|
||||
Main.overview._overview.controls._setBackground();
|
||||
|
||||
if (this._watchDashToDock) {
|
||||
// workaround for Dash to Dock (Ubuntu Dock) breaking overview allocations after enabled and changed position
|
||||
// DtD replaces dock and its _workId on every position change
|
||||
// Workaround for Dash to Dock (Ubuntu Dock) breaking overview allocations after enabling and changing its position
|
||||
// DtD replaces its _workId on every position change
|
||||
const dash = Main.overview.dash;
|
||||
if (this._prevDash !== dash._workId)
|
||||
this._updateVShell(0);
|
||||
this._adaptToSystemChange(0);
|
||||
}
|
||||
}
|
||||
|
||||
_updateVShell(timeout = 200) {
|
||||
_adaptToSystemChange(timeout = 200, full = false) {
|
||||
if (!this._enabled || Main.layoutManager._startingUp)
|
||||
return;
|
||||
|
||||
|
@ -518,18 +505,17 @@ export default class VShell extends Extension.Extension {
|
|||
return GLib.SOURCE_REMOVE;
|
||||
|
||||
const dash = Main.overview.dash;
|
||||
if (timeout < 2000) { // timeout < 2000 for partial update
|
||||
if (!full) {
|
||||
console.warn(`[${Me.metadata.name}] Warning: Updating overrides ...`);
|
||||
this._prevDash = dash._workId;
|
||||
console.warn(`[${Me.metadata.name}]: Dash has been replaced, updating extension ...`);
|
||||
Me._resetInProgress = true;
|
||||
// update only necessary modules if dash has been replaced
|
||||
// Only update modules that might be affected by the dock extension
|
||||
this._repairOverrides();
|
||||
Me._resetInProgress = false;
|
||||
} else {
|
||||
console.warn(`[${Me.metadata.name}]: Updating extension ...`);
|
||||
// for case the monitor configuration has been changed, update all
|
||||
console.warn(`[${Me.metadata.name}] Warning: Rebuilding V-Shell ...`);
|
||||
Me._resetInProgress = true;
|
||||
this.activateVShell();
|
||||
this._activateVShell();
|
||||
Me._resetInProgress = false;
|
||||
}
|
||||
this._timeouts.reset = 0;
|
||||
|
@ -538,7 +524,7 @@ export default class VShell extends Extension.Extension {
|
|||
);
|
||||
}
|
||||
|
||||
// the key modules that can be affected by the supported incompatible extensions
|
||||
// Modules possibly affected by supported but incompatible extensions
|
||||
_repairOverrides() {
|
||||
Me.Modules.overviewModule.update();
|
||||
Me.Modules.overviewControlsModule.update();
|
||||
|
@ -548,6 +534,7 @@ export default class VShell extends Extension.Extension {
|
|||
Me.Modules.panelModule.update();
|
||||
Me.Modules.dashModule.update();
|
||||
this._updateSettings();
|
||||
Main.overview._overview.controls._setBackground();
|
||||
}
|
||||
|
||||
_updateSettings(settings, key) {
|
||||
|
@ -557,16 +544,17 @@ export default class VShell extends Extension.Extension {
|
|||
// avoid overload while loading profile - update only once
|
||||
// delayed gsettings writes are processed alphabetically
|
||||
if (key === 'aaa-loading-profile') {
|
||||
this._showStatusMessage();
|
||||
if (this._timeouts.loadingProfile)
|
||||
GLib.source_remove(this._timeouts.loadingProfile);
|
||||
this._timeouts.loadingProfile = GLib.timeout_add(
|
||||
GLib.PRIORITY_DEFAULT,
|
||||
100, () => {
|
||||
this.activateVShell();
|
||||
this._activateVShell();
|
||||
this._timeouts.loadingProfile = 0;
|
||||
return GLib.SOURCE_REMOVE;
|
||||
});
|
||||
}
|
||||
);
|
||||
Me.updateMessageDialog.showMessage();
|
||||
}
|
||||
if (this._timeouts.loadingProfile)
|
||||
return;
|
||||
|
@ -590,16 +578,6 @@ export default class VShell extends Extension.Extension {
|
|||
|
||||
opt.DASH_VISIBLE = opt.DASH_VISIBLE && !Me.Util.getEnabledExtensions('dash-to-panel@jderose9.github.com').length;
|
||||
|
||||
const monitorWidth = global.display.get_monitor_geometry(global.display.get_primary_monitor()).width;
|
||||
if (monitorWidth < 1600) {
|
||||
opt.APP_GRID_ICON_SIZE_DEFAULT = opt.APP_GRID_ACTIVE_PREVIEW && !opt.APP_GRID_USAGE ? 128 : 64;
|
||||
opt.APP_GRID_FOLDER_ICON_SIZE_DEFAULT = 64;
|
||||
}
|
||||
|
||||
/* if (!Me.Util.dashIsDashToDock()) { // DtD has its own opacity control
|
||||
Me.Modules.dashModule.updateStyle(dash);
|
||||
}*/
|
||||
|
||||
// adjust search entry style for OM2
|
||||
if (opt.OVERVIEW_MODE2)
|
||||
Main.overview.searchEntry.add_style_class_name('search-entry-om2');
|
||||
|
@ -615,12 +593,6 @@ export default class VShell extends Extension.Extension {
|
|||
Main.overview.searchEntry.opacity = 255;
|
||||
St.Settings.get().slow_down_factor = opt.ANIMATION_TIME_FACTOR;
|
||||
|
||||
opt.START_Y_OFFSET = (opt.get('panelModule') && opt.PANEL_OVERVIEW_ONLY && opt.PANEL_POSITION_TOP) ||
|
||||
// better to add unnecessary space than to have a panel overlapping other objects
|
||||
Me.Util.getEnabledExtensions('hidetopbar').length
|
||||
? Main.panel.height
|
||||
: 0;
|
||||
|
||||
// Options for workspace switcher, apply custom function only if needed
|
||||
if (opt.WS_WRAPAROUND || opt.WS_IGNORE_LAST)
|
||||
Meta.Workspace.prototype.get_neighbor = this._getNeighbor;
|
||||
|
@ -641,15 +613,12 @@ export default class VShell extends Extension.Extension {
|
|||
if (key?.endsWith('-module')) {
|
||||
for (let module of this._getModuleList()) {
|
||||
if (opt.options[module] && key === opt.options[module][1]) {
|
||||
if (key === 'app-display-module')
|
||||
this._showStatusMessage();
|
||||
Me.Modules[module].update();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Main.overview._overview.controls._setBackground();
|
||||
this._switchPageShortcuts();
|
||||
|
||||
if (key?.includes('panel'))
|
||||
|
@ -698,6 +667,8 @@ export default class VShell extends Extension.Extension {
|
|||
case 'new-window-monitor-fix':
|
||||
this._updateNewWindowConnection();
|
||||
break;
|
||||
case 'click-empty-close':
|
||||
Me.Modules.overviewControlsModule.update();
|
||||
}
|
||||
|
||||
if (key?.includes('app-grid') ||
|
||||
|
@ -705,10 +676,8 @@ export default class VShell extends Extension.Extension {
|
|||
key?.includes('dot-style') ||
|
||||
key === 'show-search-entry' ||
|
||||
key === 'ws-thumbnail-scale' ||
|
||||
key === 'ws-thumbnail-scale-appgrid') {
|
||||
this._showStatusMessage();
|
||||
key === 'ws-thumbnail-scale-appgrid')
|
||||
Me.Modules.appDisplayModule.update();
|
||||
}
|
||||
}
|
||||
|
||||
_switchPageShortcuts() {
|
||||
|
@ -794,50 +763,6 @@ export default class VShell extends Extension.Extension {
|
|||
settings.set_strv(keyMoveDown, moveDown);
|
||||
}
|
||||
|
||||
// Status dialog that appears during updating V-Shell configuration and blocks inputs
|
||||
_showStatusMessage(show = true) {
|
||||
if ((show && Me._resetInProgress) || Main.layoutManager._startingUp || !Main.overview._overview.controls._appDisplay._sortOrderedItemsAlphabetically)
|
||||
return;
|
||||
|
||||
if (Me._vShellMessageTimeoutId) {
|
||||
GLib.source_remove(Me._vShellMessageTimeoutId);
|
||||
Me._vShellMessageTimeoutId = 0;
|
||||
}
|
||||
|
||||
if (Me._vShellStatusMessage && !show) {
|
||||
Me._vShellStatusMessage.close();
|
||||
Me._vShellStatusMessage.destroy();
|
||||
Me._vShellStatusMessage = null;
|
||||
}
|
||||
|
||||
if (!show)
|
||||
return;
|
||||
|
||||
if (!Me._vShellStatusMessage) {
|
||||
const sm = new /* Main.*/RestartMessage(_('Updating V-Shell...'));
|
||||
sm.set_style('background-color: rgba(0,0,0,0.3);');
|
||||
sm.open();
|
||||
Me._vShellStatusMessage = sm;
|
||||
}
|
||||
|
||||
// just for case the message wasn't removed from appDisplay after App Grid realization
|
||||
Me._vShellMessageTimeoutId = GLib.timeout_add_seconds(
|
||||
GLib.PRIORITY_DEFAULT,
|
||||
5,
|
||||
() => {
|
||||
if (Me._vShellStatusMessage) {
|
||||
Me._vShellStatusMessage.close();
|
||||
Me._vShellStatusMessage.destroy();
|
||||
Me._vShellStatusMessage = null;
|
||||
Me._resetInProgress = false;
|
||||
}
|
||||
|
||||
Me._vShellMessageTimeoutId = 0;
|
||||
return GLib.SOURCE_REMOVE;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
_getNeighbor(direction) {
|
||||
// workspace matrix is supported
|
||||
const activeIndex = this.index();
|
||||
|
@ -885,24 +810,3 @@ export default class VShell extends Extension.Extension {
|
|||
return global.workspace_manager.get_workspace_by_index(neighborExists || wraparound ? index : activeIndex);
|
||||
}
|
||||
}
|
||||
|
||||
const RestartMessage = GObject.registerClass(
|
||||
class RestartMessage extends ModalDialog.ModalDialog {
|
||||
_init(message) {
|
||||
super._init({
|
||||
shellReactive: true,
|
||||
styleClass: 'restart-message headline',
|
||||
shouldFadeIn: false,
|
||||
destroyOnClose: true,
|
||||
});
|
||||
|
||||
let label = new St.Label({
|
||||
text: message,
|
||||
x_align: Clutter.ActorAlign.CENTER,
|
||||
y_align: Clutter.ActorAlign.CENTER,
|
||||
});
|
||||
|
||||
this.contentLayout.add_child(label);
|
||||
this.buttonLayout.hide();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue