Adding 45/vertical-workspaces version 37+20240412 [9b05a79].
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
155878f41e
commit
9a6f4265d9
37 changed files with 3192 additions and 3142 deletions
|
@ -3,7 +3,7 @@
|
|||
* util.js
|
||||
*
|
||||
* @author GdH <G-dH@github.com>
|
||||
* @copyright 2022 - 2023
|
||||
* @copyright 2022 - 2024
|
||||
* @license GPL-3.0
|
||||
*
|
||||
*/
|
||||
|
@ -285,9 +285,9 @@ export function isMoreRelevant(stringA, stringB, pattern) {
|
|||
|
||||
export function getEnabledExtensions(pattern = '') {
|
||||
let result = [];
|
||||
// extensionManager is unreliable at startup (if not all extensions were loaded)
|
||||
// but gsettings key can contain removed extensions...
|
||||
// therefore we have to look into filesystem, what's really installed
|
||||
// extensionManager is unreliable at startup because it is uncertain whether all extensions have been loaded
|
||||
// also gsettings key can contain already removed extensions (user deleted them without disabling them first)
|
||||
// therefore we have to check what's really installed in the filesystem
|
||||
if (!_installedExtensions) {
|
||||
const extensionFiles = [...collectFromDatadirs('extensions', true)];
|
||||
_installedExtensions = extensionFiles.map(({ info }) => {
|
||||
|
@ -298,8 +298,19 @@ export function getEnabledExtensions(pattern = '') {
|
|||
return uuid;
|
||||
});
|
||||
}
|
||||
// _enabledExtensions contains content of the enabled-extensions key from gsettings, not actual state
|
||||
const enabled = Main.extensionManager._enabledExtensions;
|
||||
result = _installedExtensions.filter(ext => enabled.includes(ext));
|
||||
// _extensions contains already loaded extensions, so we can try to filter out broken or incompatible extensions
|
||||
const active = Main.extensionManager._extensions;
|
||||
result = result.filter(ext => {
|
||||
const extension = active.get(ext);
|
||||
if (extension)
|
||||
return ![3, 4].includes(extension.state); // 3 - ERROR, 4 - OUT_OF_TIME (not supported by shell-version in metadata)
|
||||
// extension can be enabled but not yet loaded, we just cannot see its state at this moment, so let it pass as enabled
|
||||
return true;
|
||||
});
|
||||
// return only extensions matching the search pattern
|
||||
return result.filter(uuid => uuid !== null && uuid.includes(pattern));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue