Skip to content

Commit

Permalink
feat: Gnome Shell 43 support
Browse files Browse the repository at this point in the history
- unregister timeouts left on disable
- fix some problem in build scripts
  • Loading branch information
Eduard Minasyan committed Oct 1, 2022
1 parent 8aa427a commit abbb9c2
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 13 deletions.
15 changes: 11 additions & 4 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import archiver from 'archiver';
import cmdArgs from 'command-line-args';
import cmdUsage from 'command-line-usage';
import { existsSync, promises as fs } from 'fs';
import { createWriteStream, existsSync, promises as fs } from 'fs';
import * as path from 'path';
import * as glib from './nodejs/glib.mjs';
import * as ui from './nodejs/ui.mjs';
Expand Down Expand Up @@ -153,7 +153,7 @@ if (args['built']) {
switch (args['lint']) {
case 'default':
if (!existsSync(`locales/${localeName}.po`)) {
console.log(`Missed or deleted locale file restored from build files during linting: 'locales/${localeName}.po'. To prevent this, see build option --lint or --clean.`);
console.log(`🚧 Missed or deleted locale file restored from build files during linting: 'locales/${localeName}.po'. To prevent this, see build option --lint or --clean.`);
}

await copyFile(`${localeBasePath}.po`, `locales/${localeName}.po`);
Expand All @@ -177,6 +177,13 @@ if (args['built']) {
}
} finally {
await fs.rm(potPatchFilePath, { force: true });
if (!args['with-sources']) {
for (const localeName of await fs.readdir(`${args['build-dir']}/locales`)) {
await fs.rm(`${args['build-dir']}/locales/${localeName}/LC_MESSAGES/${metadata['uuid']}.po`, {
force: true,
});
}
}
}

copyBuildFiles(args['build-dir'], '.', 'sources');
Expand Down Expand Up @@ -220,8 +227,8 @@ if (args['zip']) {
}

const zip = archiver('zip');
zip.pipe(fs.createWriteStream(`${args['build-dir']}/${metadata['uuid']}.zip`));
zip.glob(`${args['build-dir']}/**/*`, { ignore: [ '**/!(*.zip)' ] });
zip.pipe(createWriteStream(`${args['build-dir']}/${metadata['uuid']}.zip`));
zip.glob(`**`, { cwd: args['build-dir'], ignore: `${metadata['uuid']}.zip` });
zip.finalize();
}

Expand Down
4 changes: 2 additions & 2 deletions scripts/nodejs/git.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { exec } from "./utils.mjs";

export async function getTag() {
return (await git('tag', '--points-at')).stdout.trim();
return (await git(['tag', '--points-at'])).trim();
}

export async function hasChanges() {
const stdout = await git(['status', '--porcelain', '--untracked-files=no']);
return stdout.length !== 0;
return stdout.trim().length !== 0;
}

export async function hash(workingDir) {
Expand Down
8 changes: 3 additions & 5 deletions scripts/podman.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,9 @@ if (args['help']) {
header: 'Fedora known versions list (check for even fresher ones at https://hub.docker.com/_/fedora)',
content: [
{ desc: 'Fedora 37', example: 'GNOME Shell 43' },
{ desc: 'Fedora 36', example: 'GNOME Shell 42.rc' },
{ desc: 'Fedora 35', example: 'GNOME Shell 41.4' },
{ desc: 'Fedora 34', example: 'GNOME Shell 40.8' },
{ desc: 'Fedora 33', example: 'GNOME Shell 3.38.5' },
{ desc: 'Fedora 32', example: 'GNOME Shell 3.36.9' },
{ desc: 'Fedora 36', example: 'GNOME Shell 42' },
{ desc: 'Fedora 35', example: 'GNOME Shell 41' },
{ desc: 'Fedora 34', example: 'GNOME Shell 40' },
],
},
{
Expand Down
10 changes: 10 additions & 0 deletions sources/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,16 @@ class ExtensionModule {
this._signalDisconnectors = [];
this._windowsSwitcherHandler.handleActor(null);
this._workspacesSwitcherHandler.handleActor(null);

// clean timeouts according to https://gjs.guide/extensions/review-guidelines/review-guidelines.html#remove-main-loop-sources
if (this._workspaceSwitchTimeoutHandle !== null) {
GLib.Source.remove(this._workspaceSwitchTimeoutHandle);
this._workspaceSwitchTimeoutHandle = null;
}
if (this._windowSwitchTimeoutHandle !== null) {
GLib.Source.remove(this._windowSwitchTimeoutHandle);
this._windowSwitchTimeoutHandle = null;
}
}

_updateHandler(handler, switcher) {
Expand Down
4 changes: 2 additions & 2 deletions sources/metadata.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"shell-version": ["40", "41", "42.rc", "42", "43"],
"shell-version": ["40", "41", "42", "43"],
"uuid": "io.github.mreditor.gnome-shell-extensions.scroll-panel",
"name": "Scroll Panel",
"gettext-domain": "io.github.mreditor.gnome-shell-extensions.scroll-panel",
"settings-schema": "io.github.mreditor.gnome-shell-extensions.scroll-panel",
"description": "This extension allows switching between windows or workspaces by scrolling Gnome Shell topbar with mouse (both in overview and workspace modes).",
"url": "https://github.com/mrEDitor/gnome-shell-extension-scroll-panel",
"semantic-version": "4.1.6"
"semantic-version": "4.1.7"
}

0 comments on commit abbb9c2

Please sign in to comment.