|
|
|
|
@ -1,477 +0,0 @@
|
|
|
|
|
diff --git a/gnome-44-max/bin/setup b/gnome-44-max/bin/setup
|
|
|
|
|
index bd4c8b5..2cf0a03 100755
|
|
|
|
|
--- a/gnome-44-max/bin/setup
|
|
|
|
|
+++ b/gnome-44-max/bin/setup
|
|
|
|
|
@@ -84,8 +84,10 @@ echo "Copying the manifest file to ${BREEZY_GNOME_DATA_DIR}"
|
|
|
|
|
mkdir -p $BREEZY_GNOME_DATA_DIR
|
|
|
|
|
cp manifest $BREEZY_GNOME_DATA_DIR
|
|
|
|
|
|
|
|
|
|
-echo "Installing the breezydesktop@xronlinux.com GNOME extension"
|
|
|
|
|
-gnome-extensions install --force breezydesktop@xronlinux.com.shell-extension.zip
|
|
|
|
|
+EXTENSION_UUID="breezydesktop@xronlinux.com"
|
|
|
|
|
+echo "Installing the $EXTENSION_UUID GNOME extension"
|
|
|
|
|
+gnome-extensions install --force "$EXTENSION_UUID.shell-extension.zip"
|
|
|
|
|
+glib-compile-schemas "$GNOME_SHELL_DATA_DIR/extensions/$EXTENSION_UUID/schemas"
|
|
|
|
|
|
|
|
|
|
echo "Installing the Breezy Desktop UI application"
|
|
|
|
|
cp -r breezy_ui/data/* $XDG_DATA_HOME
|
|
|
|
|
diff --git a/gnome-44-max/src/cursor.js b/gnome-44-max/src/cursor.js
|
|
|
|
|
index 36ad7ee..41102a0 100644
|
|
|
|
|
--- a/gnome-44-max/src/cursor.js
|
|
|
|
|
+++ b/gnome-44-max/src/cursor.js
|
|
|
|
|
@@ -15,11 +15,11 @@
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
-import Clutter from 'gi://Clutter';
|
|
|
|
|
-import GObject from 'gi://GObject';
|
|
|
|
|
+const Clutter = imports.gi.Clutter;
|
|
|
|
|
+const GObject = imports.gi.GObject;
|
|
|
|
|
|
|
|
|
|
// Copied almost verbatim from ui/magnifier.js.
|
|
|
|
|
-export const MouseSpriteContent = GObject.registerClass({
|
|
|
|
|
+var MouseSpriteContent = GObject.registerClass({
|
|
|
|
|
Implements: [Clutter.Content],
|
|
|
|
|
}, class MouseSpriteContent extends GObject.Object {
|
|
|
|
|
_init() {
|
|
|
|
|
diff --git a/gnome-44-max/src/cursormanager.js b/gnome-44-max/src/cursormanager.js
|
|
|
|
|
index dd4a77d..bbb8872 100644
|
|
|
|
|
--- a/gnome-44-max/src/cursormanager.js
|
|
|
|
|
+++ b/gnome-44-max/src/cursormanager.js
|
|
|
|
|
@@ -1,11 +1,15 @@
|
|
|
|
|
-import Clutter from 'gi://Clutter';
|
|
|
|
|
-import Meta from 'gi://Meta';
|
|
|
|
|
-import * as PointerWatcher from 'resource:///org/gnome/shell/ui/pointerWatcher.js';
|
|
|
|
|
-import { MouseSpriteContent } from './cursor.js';
|
|
|
|
|
-import Globals from './globals.js';
|
|
|
|
|
+const Clutter = imports.gi.Clutter;
|
|
|
|
|
+const Meta = imports.gi.Meta;
|
|
|
|
|
+const PointerWatcher = imports.ui.pointerWatcher;
|
|
|
|
|
+
|
|
|
|
|
+const ExtensionUtils = imports.misc.extensionUtils;
|
|
|
|
|
+const Me = ExtensionUtils.getCurrentExtension();
|
|
|
|
|
+
|
|
|
|
|
+const Globals = Me.imports.globals;
|
|
|
|
|
+const { MouseSpriteContent } = Me.imports.cursor;
|
|
|
|
|
|
|
|
|
|
// Taken from https://github.com/jkitching/soft-brightness-plus
|
|
|
|
|
-export class CursorManager {
|
|
|
|
|
+var CursorManager = class CursorManager {
|
|
|
|
|
constructor(targetMonitors, refreshRate) {
|
|
|
|
|
this._targetMonitors = targetMonitors;
|
|
|
|
|
this._refreshRate = refreshRate;
|
|
|
|
|
diff --git a/gnome-44-max/src/devicedatastream.js b/gnome-44-max/src/devicedatastream.js
|
|
|
|
|
index e396403..f047067 100644
|
|
|
|
|
--- a/gnome-44-max/src/devicedatastream.js
|
|
|
|
|
+++ b/gnome-44-max/src/devicedatastream.js
|
|
|
|
|
@@ -1,8 +1,12 @@
|
|
|
|
|
-import Gio from 'gi://Gio';
|
|
|
|
|
-import GObject from 'gi://GObject';
|
|
|
|
|
+const Gio = imports.gi.Gio;
|
|
|
|
|
+const GObject = imports.gi.GObject;
|
|
|
|
|
|
|
|
|
|
-import Globals from './globals.js';
|
|
|
|
|
-import {
|
|
|
|
|
+const ExtensionUtils = imports.misc.extensionUtils;
|
|
|
|
|
+const Me = ExtensionUtils.getCurrentExtension();
|
|
|
|
|
+
|
|
|
|
|
+const Globals = Me.imports.globals;
|
|
|
|
|
+const { isValidKeepAlive, getEpochSec, toSec } = Me.imports.time;
|
|
|
|
|
+const {
|
|
|
|
|
dataViewEnd,
|
|
|
|
|
dataViewUint8,
|
|
|
|
|
dataViewBigUint,
|
|
|
|
|
@@ -14,8 +18,7 @@ import {
|
|
|
|
|
FLOAT_SIZE,
|
|
|
|
|
UINT_SIZE,
|
|
|
|
|
UINT8_SIZE
|
|
|
|
|
-} from "./ipc.js";
|
|
|
|
|
-import { isValidKeepAlive, getEpochSec, toSec } from "./time.js";
|
|
|
|
|
+} = Me.imports.ipc;
|
|
|
|
|
|
|
|
|
|
const IPC_FILE_PATH = "/dev/shm/breezy_desktop_imu";
|
|
|
|
|
const KEEPALIVE_REFRESH_INTERVAL_SEC = 1;
|
|
|
|
|
@@ -75,7 +78,7 @@ function nextDebugIMUQuaternion(counter) {
|
|
|
|
|
return [x, y, z, w];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-export const DeviceDataStream = GObject.registerClass({
|
|
|
|
|
+var DeviceDataStream = GObject.registerClass({
|
|
|
|
|
Properties: {
|
|
|
|
|
'breezy-desktop-running': GObject.ParamSpec.boolean(
|
|
|
|
|
'breezy-desktop-running',
|
|
|
|
|
diff --git a/gnome-44-max/src/extension.js b/gnome-44-max/src/extension.js
|
|
|
|
|
index b3363d5..d5be026 100644
|
|
|
|
|
--- a/gnome-44-max/src/extension.js
|
|
|
|
|
+++ b/gnome-44-max/src/extension.js
|
|
|
|
|
@@ -1,28 +1,32 @@
|
|
|
|
|
-import Gio from 'gi://Gio';
|
|
|
|
|
-import GLib from 'gi://GLib';
|
|
|
|
|
-import Meta from 'gi://Meta';
|
|
|
|
|
-import Shell from 'gi://Shell';
|
|
|
|
|
-import St from 'gi://St';
|
|
|
|
|
-
|
|
|
|
|
-import { CursorManager } from './cursormanager.js';
|
|
|
|
|
-import { DeviceDataStream } from './devicedatastream.js';
|
|
|
|
|
-import Globals from './globals.js';
|
|
|
|
|
-import { Logger } from './logger.js';
|
|
|
|
|
-import { MonitorManager, NESTED_MONITOR_PRODUCT, SUPPORTED_MONITOR_PRODUCTS, VIRTUAL_MONITOR_PRODUCT } from './monitormanager.js';
|
|
|
|
|
-import { VirtualDisplaysActor } from './virtualdisplaysactor.js';
|
|
|
|
|
-
|
|
|
|
|
-import {Extension} from 'resource:///org/gnome/shell/extensions/extension.js';
|
|
|
|
|
-import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
|
|
|
|
+const Clutter = imports.gi.Clutter;
|
|
|
|
|
+const Gio = imports.gi.Gio;
|
|
|
|
|
+const GLib = imports.gi.GLib;
|
|
|
|
|
+const Meta = imports.gi.Meta;
|
|
|
|
|
+const Shell = imports.gi.Shell;
|
|
|
|
|
+const St = imports.gi.St;
|
|
|
|
|
+
|
|
|
|
|
+const Main = imports.ui.main;
|
|
|
|
|
+
|
|
|
|
|
+const ExtensionUtils = imports.misc.extensionUtils;
|
|
|
|
|
+const Me = ExtensionUtils.getCurrentExtension();
|
|
|
|
|
+
|
|
|
|
|
+const Globals = Me.imports.globals;
|
|
|
|
|
+const { CursorManager } = Me.imports.cursormanager;
|
|
|
|
|
+const { DeviceDataStream } = Me.imports.devicedatastream;
|
|
|
|
|
+const { Logger } = Me.imports.logger;
|
|
|
|
|
+const { MonitorManager, NESTED_MONITOR_PRODUCT, SUPPORTED_MONITOR_PRODUCTS, VIRTUAL_MONITOR_PRODUCT } = Me.imports.monitormanager;
|
|
|
|
|
+const { VirtualDisplaysActor } = Me.imports.virtualdisplaysactor;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
const BIN_HOME = GLib.getenv('XDG_BIN_HOME') || GLib.build_filenamev([GLib.get_home_dir(), '.local', 'bin']);
|
|
|
|
|
const XDG_CLI_PATH = GLib.build_filenamev([BIN_HOME, 'xr_driver_cli']);
|
|
|
|
|
const ALT_CLI_PATH = '/usr/bin/xr_driver_cli';
|
|
|
|
|
|
|
|
|
|
-export default class BreezyDesktopExtension extends Extension {
|
|
|
|
|
- constructor(metadata, uuid) {
|
|
|
|
|
- super(metadata, uuid);
|
|
|
|
|
-
|
|
|
|
|
- this.settings = this.getSettings();
|
|
|
|
|
+class BreezyDesktopExtension {
|
|
|
|
|
+ constructor(extensionPath) {
|
|
|
|
|
+ this.path = extensionPath;
|
|
|
|
|
+
|
|
|
|
|
+ this.settings = ExtensionUtils.getSettings();
|
|
|
|
|
|
|
|
|
|
// Set/destroyed by enable/disable
|
|
|
|
|
this._cursor_manager = null;
|
|
|
|
|
@@ -645,6 +649,6 @@ export default class BreezyDesktopExtension extends Extension {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-function init() {
|
|
|
|
|
- return new Extension();
|
|
|
|
|
+function init(meta) {
|
|
|
|
|
+ return new BreezyDesktopExtension(meta.path);
|
|
|
|
|
}
|
|
|
|
|
diff --git a/gnome-44-max/src/globals.js b/gnome-44-max/src/globals.js
|
|
|
|
|
index f11451c..4b5c65b 100644
|
|
|
|
|
--- a/gnome-44-max/src/globals.js
|
|
|
|
|
+++ b/gnome-44-max/src/globals.js
|
|
|
|
|
@@ -1,7 +1,6 @@
|
|
|
|
|
-const Globals = {
|
|
|
|
|
+var Globals = {
|
|
|
|
|
logger: null,
|
|
|
|
|
ipc_file: null, // Gio.File instance, file exists if set
|
|
|
|
|
extension_dir: null, // string path
|
|
|
|
|
data_stream: null, // DeviceDataStream instance
|
|
|
|
|
-}
|
|
|
|
|
-export default Globals;
|
|
|
|
|
\ No newline at end of file
|
|
|
|
|
+}
|
|
|
|
|
\ No newline at end of file
|
|
|
|
|
diff --git a/gnome-44-max/src/ipc.js b/gnome-44-max/src/ipc.js
|
|
|
|
|
index a729368..d5f7ab0 100644
|
|
|
|
|
--- a/gnome-44-max/src/ipc.js
|
|
|
|
|
+++ b/gnome-44-max/src/ipc.js
|
|
|
|
|
@@ -1,30 +1,30 @@
|
|
|
|
|
-export const UINT8_SIZE = 1;
|
|
|
|
|
-export const BOOL_SIZE = UINT8_SIZE;
|
|
|
|
|
-export const UINT_SIZE = 4;
|
|
|
|
|
-export const FLOAT_SIZE = 4;
|
|
|
|
|
+var UINT8_SIZE = 1;
|
|
|
|
|
+var BOOL_SIZE = UINT8_SIZE;
|
|
|
|
|
+var UINT_SIZE = 4;
|
|
|
|
|
+var FLOAT_SIZE = 4;
|
|
|
|
|
|
|
|
|
|
-export const DATA_VIEW_INFO_OFFSET_INDEX = 0;
|
|
|
|
|
-export const DATA_VIEW_INFO_SIZE_INDEX = 1;
|
|
|
|
|
-export const DATA_VIEW_INFO_COUNT_INDEX = 2;
|
|
|
|
|
+var DATA_VIEW_INFO_OFFSET_INDEX = 0;
|
|
|
|
|
+var DATA_VIEW_INFO_SIZE_INDEX = 1;
|
|
|
|
|
+var DATA_VIEW_INFO_COUNT_INDEX = 2;
|
|
|
|
|
|
|
|
|
|
// computes the end offset, exclusive
|
|
|
|
|
-export function dataViewEnd(dataViewInfo) {
|
|
|
|
|
+function dataViewEnd(dataViewInfo) {
|
|
|
|
|
return dataViewInfo[DATA_VIEW_INFO_OFFSET_INDEX] + dataViewInfo[DATA_VIEW_INFO_SIZE_INDEX] * dataViewInfo[DATA_VIEW_INFO_COUNT_INDEX];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-export function dataViewUint8(dataView, dataViewInfo) {
|
|
|
|
|
+function dataViewUint8(dataView, dataViewInfo) {
|
|
|
|
|
return dataView.getUint8(dataViewInfo[DATA_VIEW_INFO_OFFSET_INDEX]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-export function dataViewUint(dataView, dataViewInfo) {
|
|
|
|
|
+function dataViewUint(dataView, dataViewInfo) {
|
|
|
|
|
return dataView.getUint32(dataViewInfo[DATA_VIEW_INFO_OFFSET_INDEX], true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-export function dataViewBigUint(dataView, dataViewInfo) {
|
|
|
|
|
+function dataViewBigUint(dataView, dataViewInfo) {
|
|
|
|
|
return Number(dataView.getBigUint64(dataViewInfo[DATA_VIEW_INFO_OFFSET_INDEX], true));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-export function dataViewUint32Array(dataView, dataViewInfo) {
|
|
|
|
|
+function dataViewUint32Array(dataView, dataViewInfo) {
|
|
|
|
|
const uintArray = []
|
|
|
|
|
let offset = dataViewInfo[DATA_VIEW_INFO_OFFSET_INDEX];
|
|
|
|
|
for (let i = 0; i < dataViewInfo[DATA_VIEW_INFO_COUNT_INDEX]; i++) {
|
|
|
|
|
@@ -34,7 +34,7 @@ export function dataViewUint32Array(dataView, dataViewInfo) {
|
|
|
|
|
return uintArray;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-export function dataViewUint8Array(dataView, dataViewInfo) {
|
|
|
|
|
+function dataViewUint8Array(dataView, dataViewInfo) {
|
|
|
|
|
const uintArray = []
|
|
|
|
|
let offset = dataViewInfo[DATA_VIEW_INFO_OFFSET_INDEX];
|
|
|
|
|
for (let i = 0; i < dataViewInfo[DATA_VIEW_INFO_SIZE_INDEX] * dataViewInfo[DATA_VIEW_INFO_COUNT_INDEX]; i++) {
|
|
|
|
|
@@ -44,11 +44,11 @@ export function dataViewUint8Array(dataView, dataViewInfo) {
|
|
|
|
|
return uintArray;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-export function dataViewFloat(dataView, dataViewInfo) {
|
|
|
|
|
+function dataViewFloat(dataView, dataViewInfo) {
|
|
|
|
|
return dataView.getFloat32(dataViewInfo[DATA_VIEW_INFO_OFFSET_INDEX], true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-export function dataViewFloatArray(dataView, dataViewInfo) {
|
|
|
|
|
+function dataViewFloatArray(dataView, dataViewInfo) {
|
|
|
|
|
const floatArray = []
|
|
|
|
|
let offset = dataViewInfo[DATA_VIEW_INFO_OFFSET_INDEX];
|
|
|
|
|
for (let i = 0; i < dataViewInfo[DATA_VIEW_INFO_COUNT_INDEX]; i++) {
|
|
|
|
|
diff --git a/gnome-44-max/src/logger.js b/gnome-44-max/src/logger.js
|
|
|
|
|
index 5bdf115..138a98a 100644
|
|
|
|
|
--- a/gnome-44-max/src/logger.js
|
|
|
|
|
+++ b/gnome-44-max/src/logger.js
|
|
|
|
|
@@ -14,15 +14,15 @@
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
-import * as Config from 'resource:///org/gnome/shell/misc/config.js';
|
|
|
|
|
-import Gio from 'gi://Gio';
|
|
|
|
|
-import GLib from 'gi://GLib';
|
|
|
|
|
-import GObject from 'gi://GObject';
|
|
|
|
|
-import System from 'system';
|
|
|
|
|
+const Config = imports.misc.config;
|
|
|
|
|
+const Gio = imports.gi.Gio;
|
|
|
|
|
+const GLib = imports.gi.GLib;
|
|
|
|
|
+const GObject = imports.gi.GObject;
|
|
|
|
|
+const System = imports.system;
|
|
|
|
|
|
|
|
|
|
const LOG_DIR_NAME = 'breezy_gnome/logs/gjs';
|
|
|
|
|
|
|
|
|
|
-export const Logger = GObject.registerClass({
|
|
|
|
|
+var Logger = GObject.registerClass({
|
|
|
|
|
GTypeName: 'Logger',
|
|
|
|
|
Properties: {
|
|
|
|
|
'title': GObject.ParamSpec.string(
|
|
|
|
|
diff --git a/gnome-44-max/src/math.js b/gnome-44-max/src/math.js
|
|
|
|
|
index f1c9983..9a98c7b 100644
|
|
|
|
|
--- a/gnome-44-max/src/math.js
|
|
|
|
|
+++ b/gnome-44-max/src/math.js
|
|
|
|
|
@@ -1,9 +1,9 @@
|
|
|
|
|
-export function degreeToRadian(degree) {
|
|
|
|
|
+function degreeToRadian(degree) {
|
|
|
|
|
return degree * Math.PI / 180;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// FOV in radians is spherical, so doesn't follow Pythagoras' theorem
|
|
|
|
|
-export function diagonalToCrossFOVs(diagonalFOVRadians, aspectRatio) {
|
|
|
|
|
+function diagonalToCrossFOVs(diagonalFOVRadians, aspectRatio) {
|
|
|
|
|
// first convert from a spherical FOV to a diagonal FOV on a flat plane at a generic distance of 1.0
|
|
|
|
|
const flatDiagonalFOV = 2 * Math.tan(diagonalFOVRadians / 2);
|
|
|
|
|
|
|
|
|
|
diff --git a/gnome-44-max/src/metadata.json b/gnome-44-max/src/metadata.json
|
|
|
|
|
index 0f8073b..bc26f97 100644
|
|
|
|
|
--- a/gnome-44-max/src/metadata.json
|
|
|
|
|
+++ b/gnome-44-max/src/metadata.json
|
|
|
|
|
@@ -5,7 +5,7 @@
|
|
|
|
|
"settings-schema": "com.xronlinux.BreezyDesktop",
|
|
|
|
|
"session-modes": ["user"],
|
|
|
|
|
"shell-version": [
|
|
|
|
|
- "45", "46", "47"
|
|
|
|
|
+ "42", "43", "44"
|
|
|
|
|
],
|
|
|
|
|
"url": "https://github.com/wheaney/breezy-desktop"
|
|
|
|
|
}
|
|
|
|
|
\ No newline at end of file
|
|
|
|
|
diff --git a/gnome-44-max/src/monitormanager.js b/gnome-44-max/src/monitormanager.js
|
|
|
|
|
index 4c57171..080924d 100644
|
|
|
|
|
--- a/gnome-44-max/src/monitormanager.js
|
|
|
|
|
+++ b/gnome-44-max/src/monitormanager.js
|
|
|
|
|
@@ -16,16 +16,19 @@
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
-import Gio from 'gi://Gio';
|
|
|
|
|
-import GObject from 'gi://GObject';
|
|
|
|
|
+const Gio = imports.gi.Gio;
|
|
|
|
|
+const GObject = imports.gi.GObject;
|
|
|
|
|
|
|
|
|
|
-import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
|
|
|
|
+const Main = imports.ui.main;
|
|
|
|
|
|
|
|
|
|
-import Globals from './globals.js';
|
|
|
|
|
+const ExtensionUtils = imports.misc.extensionUtils;
|
|
|
|
|
+const Me = ExtensionUtils.getCurrentExtension();
|
|
|
|
|
|
|
|
|
|
-export const NESTED_MONITOR_PRODUCT = 'MetaMonitor';
|
|
|
|
|
-export const VIRTUAL_MONITOR_PRODUCT = 'Virtual remote monitor';
|
|
|
|
|
-export const SUPPORTED_MONITOR_PRODUCTS = [
|
|
|
|
|
+const Globals = Me.imports.globals;
|
|
|
|
|
+
|
|
|
|
|
+var NESTED_MONITOR_PRODUCT = 'MetaMonitor';
|
|
|
|
|
+var VIRTUAL_MONITOR_PRODUCT = 'Virtual remote monitor';
|
|
|
|
|
+var SUPPORTED_MONITOR_PRODUCTS = [
|
|
|
|
|
'VITURE',
|
|
|
|
|
'nreal air',
|
|
|
|
|
'Air',
|
|
|
|
|
@@ -58,7 +61,7 @@ function getDisplayConfigProxy(extPath) {
|
|
|
|
|
return cachedDisplayConfigProxy;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-export function newDisplayConfig(extPath, callback) {
|
|
|
|
|
+function newDisplayConfig(extPath, callback) {
|
|
|
|
|
const DisplayConfigProxy = getDisplayConfigProxy(extPath);
|
|
|
|
|
new DisplayConfigProxy(
|
|
|
|
|
Gio.DBus.session,
|
|
|
|
|
@@ -366,7 +369,7 @@ function performOptimalModeCheck(displayConfigProxy, connectorName, headsetAsPri
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Monitor change handling
|
|
|
|
|
-export const MonitorManager = GObject.registerClass({
|
|
|
|
|
+var MonitorManager = GObject.registerClass({
|
|
|
|
|
Properties: {
|
|
|
|
|
'use-optimal-monitor-config': GObject.ParamSpec.boolean(
|
|
|
|
|
'use-optimal-monitor-config',
|
|
|
|
|
diff --git a/gnome-44-max/src/shader.js b/gnome-44-max/src/shader.js
|
|
|
|
|
index f70c96d..352be40 100644
|
|
|
|
|
--- a/gnome-44-max/src/shader.js
|
|
|
|
|
+++ b/gnome-44-max/src/shader.js
|
|
|
|
|
@@ -1,6 +1,6 @@
|
|
|
|
|
-import Gio from 'gi://Gio';
|
|
|
|
|
+const Gio = imports.gi.Gio;
|
|
|
|
|
|
|
|
|
|
-export function getShaderSource(path) {
|
|
|
|
|
+function getShaderSource(path) {
|
|
|
|
|
const file = Gio.file_new_for_path(path);
|
|
|
|
|
const data = file.load_contents(null);
|
|
|
|
|
|
|
|
|
|
diff --git a/gnome-44-max/src/time.js b/gnome-44-max/src/time.js
|
|
|
|
|
index 8c17207..fdfdac1 100644
|
|
|
|
|
--- a/gnome-44-max/src/time.js
|
|
|
|
|
+++ b/gnome-44-max/src/time.js
|
|
|
|
|
@@ -1,11 +1,11 @@
|
|
|
|
|
-export function getEpochSec() {
|
|
|
|
|
+function getEpochSec() {
|
|
|
|
|
return toSec(Date.now());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-export function toSec(milliseconds) {
|
|
|
|
|
+function toSec(milliseconds) {
|
|
|
|
|
return Math.floor(milliseconds / 1000);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-export function isValidKeepAlive(dateSec) {
|
|
|
|
|
+function isValidKeepAlive(dateSec) {
|
|
|
|
|
return Math.abs(getEpochSec() - dateSec) <= 1;
|
|
|
|
|
}
|
|
|
|
|
\ No newline at end of file
|
|
|
|
|
diff --git a/gnome-44-max/src/virtualdisplayeffect.js b/gnome-44-max/src/virtualdisplayeffect.js
|
|
|
|
|
index 26be71e..42da807 100644
|
|
|
|
|
--- a/gnome-44-max/src/virtualdisplayeffect.js
|
|
|
|
|
+++ b/gnome-44-max/src/virtualdisplayeffect.js
|
|
|
|
|
@@ -1,16 +1,18 @@
|
|
|
|
|
-import Clutter from 'gi://Clutter'
|
|
|
|
|
-import Cogl from 'gi://Cogl';
|
|
|
|
|
-import GLib from 'gi://GLib';
|
|
|
|
|
-import GObject from 'gi://GObject';
|
|
|
|
|
-import Shell from 'gi://Shell';
|
|
|
|
|
+const Clutter = imports.gi.Clutter;
|
|
|
|
|
+const Cogl = imports.gi.Cogl;
|
|
|
|
|
+const GLib = imports.gi.GLib;
|
|
|
|
|
+const GObject = imports.gi.GObject;
|
|
|
|
|
+const Shell = imports.gi.Shell;
|
|
|
|
|
|
|
|
|
|
-import Globals from './globals.js';
|
|
|
|
|
-import { degreeToRadian, diagonalToCrossFOVs } from './math.js';
|
|
|
|
|
+const ExtensionUtils = imports.misc.extensionUtils;
|
|
|
|
|
+const Me = ExtensionUtils.getCurrentExtension();
|
|
|
|
|
|
|
|
|
|
+const Globals = Me.imports.globals;
|
|
|
|
|
+const { degreeToRadian, diagonalToCrossFOVs } = Me.imports.math;
|
|
|
|
|
|
|
|
|
|
// these need to mirror the values in XRLinuxDriver
|
|
|
|
|
// https://github.com/wheaney/XRLinuxDriver/blob/main/src/plugins/smooth_follow.c#L31
|
|
|
|
|
-export const SMOOTH_FOLLOW_SLERP_TIMELINE_MS = 1000;
|
|
|
|
|
+var SMOOTH_FOLLOW_SLERP_TIMELINE_MS = 1000;
|
|
|
|
|
const SMOOTH_FOLLOW_SLERP_FACTOR = Math.pow(1-0.999, 1/SMOOTH_FOLLOW_SLERP_TIMELINE_MS);
|
|
|
|
|
|
|
|
|
|
// this mirror's how the driver's slerp function progresses so our effect will match it
|
|
|
|
|
@@ -26,7 +28,7 @@ function lookAheadMS(imuDateMs, lookAheadCfg, override) {
|
|
|
|
|
return (override === -1 ? lookAheadCfg[0] : override) + dataAge;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-export const VirtualDisplayEffect = GObject.registerClass({
|
|
|
|
|
+var VirtualDisplayEffect = GObject.registerClass({
|
|
|
|
|
Properties: {
|
|
|
|
|
'monitor-index': GObject.ParamSpec.int(
|
|
|
|
|
'monitor-index',
|
|
|
|
|
diff --git a/gnome-44-max/src/virtualdisplaysactor.js b/gnome-44-max/src/virtualdisplaysactor.js
|
|
|
|
|
index 538fa8c..fa134f1 100644
|
|
|
|
|
--- a/gnome-44-max/src/virtualdisplaysactor.js
|
|
|
|
|
+++ b/gnome-44-max/src/virtualdisplaysactor.js
|
|
|
|
|
@@ -1,18 +1,19 @@
|
|
|
|
|
-import Clutter from 'gi://Clutter'
|
|
|
|
|
-import Cogl from 'gi://Cogl';
|
|
|
|
|
-import GdkPixbuf from 'gi://GdkPixbuf';
|
|
|
|
|
-import GLib from 'gi://GLib';
|
|
|
|
|
-import GObject from 'gi://GObject';
|
|
|
|
|
-import Mtk from 'gi://Mtk';
|
|
|
|
|
-import Shell from 'gi://Shell';
|
|
|
|
|
-import St from 'gi://St';
|
|
|
|
|
+const Clutter = imports.gi.Clutter;
|
|
|
|
|
+const Cogl = imports.gi.Cogl;
|
|
|
|
|
+const GdkPixbuf = imports.gi.GdkPixbuf;
|
|
|
|
|
+const GLib = imports.gi.GLib;
|
|
|
|
|
+const GObject = imports.gi.GObject;
|
|
|
|
|
+const Shell = imports.gi.Shell;
|
|
|
|
|
+const St = imports.gi.St;
|
|
|
|
|
|
|
|
|
|
-import { VirtualDisplayEffect, SMOOTH_FOLLOW_SLERP_TIMELINE_MS } from './virtualdisplayeffect.js';
|
|
|
|
|
-import { degreeToRadian, diagonalToCrossFOVs } from './math.js';
|
|
|
|
|
+const Main = imports.ui.main;
|
|
|
|
|
|
|
|
|
|
-import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
|
|
|
|
+const ExtensionUtils = imports.misc.extensionUtils;
|
|
|
|
|
+const Me = ExtensionUtils.getCurrentExtension();
|
|
|
|
|
|
|
|
|
|
-import Globals from './globals.js';
|
|
|
|
|
+const { VirtualDisplayEffect, SMOOTH_FOLLOW_SLERP_TIMELINE_MS } = Me.imports.virtualdisplayeffect;
|
|
|
|
|
+const Globals = Me.imports.globals;
|
|
|
|
|
+const { degreeToRadian, diagonalToCrossFOVs } = Me.imports.math;
|
|
|
|
|
|
|
|
|
|
function applyQuaternionToVector(vector, quaternion) {
|
|
|
|
|
const t = [
|
|
|
|
|
@@ -394,7 +395,7 @@ function verticalMonitorSort(monitors) {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-export const VirtualDisplaysActor = GObject.registerClass({
|
|
|
|
|
+var VirtualDisplaysActor = GObject.registerClass({
|
|
|
|
|
Properties: {
|
|
|
|
|
'target-monitor': GObject.ParamSpec.jsobject(
|
|
|
|
|
'target-monitor',
|