Update modern.js

fixes error "Fails on GNOME Shell 48.3 with TypeError get_session not a function" on modern.,js
This commit is contained in:
2025-09-29 08:56:34 +02:00
committed by GitHub
parent 5020250699
commit fe41ea8312
+9 -1
View File
@@ -14,7 +14,6 @@ import GLib from 'gi://GLib';
import Clutter from 'gi://Clutter';
// ── CONST ────────────────────────────────────────────
const SHELL_MAJOR = parseInt(Shell.get_session().get_shell_version().split('.')[0]);
const WM_SCHEMA = 'org.gnome.desktop.wm.keybindings';
const TILING_DELAY_MS = 20; // Change Tiling Window Delay
@@ -32,6 +31,15 @@ const KEYBINDINGS = {
'focus-down': (self) => self._focusInDirection('down'),
};
// ── VERSION CHECK ────────────────────────────────────────────
let shellVersion;
if (Shell.get_session) {
shellVersion = Shell.get_session().get_shell_version();
} else {
shellVersion = global.shell_version;
}
const SHELL_MAJOR = parseInt(shellVersion.split('.')[0]);
// ── HELPERFUNCTION ────────────────────────────────────────
function getPointerXY() {
if (global.get_pointer) {