Skip to content

Commit 89d1da1

Browse files
3v1n0mtwebster
authored andcommitted
overrides/Gio: Enable platform-specific wrappers only on newer GLib
1 parent 4aebee4 commit 89d1da1

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

modules/core/overrides/Gio.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -484,16 +484,19 @@ function _init() {
484484

485485
Gio.Application.prototype.runAsync = GLib.MainLoop.prototype.runAsync;
486486

487-
// Redefine Gio functions with platform-specific implementations to be
488-
// backward compatible with gi-repository 1.0, however when possible we
489-
// notify a deprecation warning, to ensure that the surrounding code is
490-
// updated.
491-
try {
492-
GioPlatform = imports.gi.GioUnix;
493-
} catch {
487+
if (GLib.MAJOR_VERSION > 2 ||
488+
(GLib.MAJOR_VERSION === 2 && GLib.MINOR_VERSION >= 86)) {
489+
// Redefine Gio functions with platform-specific implementations to be
490+
// backward compatible with gi-repository 1.0, however when possible we
491+
// notify a deprecation warning, to ensure that the surrounding code is
492+
// updated.
494493
try {
495-
GioPlatform = imports.gi.GioWin32;
496-
} catch {}
494+
GioPlatform = imports.gi.GioUnix;
495+
} catch {
496+
try {
497+
GioPlatform = imports.gi.GioWin32;
498+
} catch {}
499+
}
497500
}
498501

499502
const platformName = `${GioPlatform?.__name__?.slice(3 /* 'Gio'.length */)}`;

0 commit comments

Comments
 (0)