-
-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathgnome-44-max.patch
482 lines (439 loc) · 17.5 KB
/
gnome-44-max.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
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 [email protected] GNOME extension"
-gnome-extensions install --force [email protected]
+EXTENSION_UUID="[email protected]"
+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 52d1341..86d8a76 100644
--- a/gnome-44-max/src/cursormanager.js
+++ b/gnome-44-max/src/cursormanager.js
@@ -1,12 +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(overlay, refreshRate) {
this._overlay = overlay;
this._refreshRate = refreshRate;
diff --git a/gnome-44-max/src/extension.js b/gnome-44-max/src/extension.js
index d8adda3..a24370f 100644
--- a/gnome-44-max/src/extension.js
+++ b/gnome-44-max/src/extension.js
@@ -1,19 +1,21 @@
-import Clutter from 'gi://Clutter'
-import Gio from 'gi://Gio';
-import GLib from 'gi://GLib';
-import Meta from 'gi://Meta';
-import Shell from 'gi://Shell';
-
-import { CursorManager } from './cursormanager.js';
-import Globals from './globals.js';
-import { Logger } from './logger.js';
-import { MonitorManager } from './monitormanager.js';
-import { Overlay } from './overlay.js';
-import { isValidKeepAlive } from './time.js';
-import { IPC_FILE_PATH, XREffect } from './xrEffect.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 Main = imports.ui.main;
+
+const ExtensionUtils = imports.misc.extensionUtils;
+const Me = ExtensionUtils.getCurrentExtension();
+
+const Globals = Me.imports.globals;
+const { CursorManager } = Me.imports.cursormanager;
+const { Logger } = Me.imports.logger;
+const { MonitorManager } = Me.imports.monitormanager;
+const { Overlay } = Me.imports.overlay;
+const { isValidKeepAlive } = Me.imports.time;
+const { IPC_FILE_PATH, XREffect } = Me.imports.xrEffect;
const NESTED_MONITOR_PRODUCT = 'MetaMonitor';
const SUPPORTED_MONITOR_PRODUCTS = [
@@ -33,11 +35,11 @@ const BIN_HOME = GLib.getenv('XDG_BIN_HOME') || GLib.build_filenamev([GLib.get_h
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 +647,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 124d2e1..79a3a87 100644
--- a/gnome-44-max/src/globals.js
+++ b/gnome-44-max/src/globals.js
@@ -2,5 +2,4 @@ const Globals = {
logger: null,
ipc_file: null, // Gio.File instance, file exists if set
extension_dir: null // string path
-}
-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 50450c1..8b307fc 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 497274e..6c98cdb 100644
--- a/gnome-44-max/src/math.js
+++ b/gnome-44-max/src/math.js
@@ -1,3 +1,3 @@
-export function degreeToRadian(degree) {
+function degreeToRadian(degree) {
return degree * Math.PI / 180;
}
\ No newline at end of file
diff --git a/gnome-44-max/src/metadata.json b/gnome-44-max/src/metadata.json
index 125954e..c888f94 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", "unlock-dialog"],
"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 6cf5532..580925c 100644
--- a/gnome-44-max/src/monitormanager.js
+++ b/gnome-44-max/src/monitormanager.js
@@ -16,12 +16,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 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();
+
+const Globals = Me.imports.globals;
let cachedDisplayConfigProxy = null;
@@ -43,7 +46,7 @@ function getDisplayConfigProxy(extPath) {
return cachedDisplayConfigProxy;
}
-export function newDisplayConfig(extPath, callback) {
+function newDisplayConfig(extPath, callback) {
const DisplayConfigProxy = getDisplayConfigProxy(extPath);
new DisplayConfigProxy(
Gio.DBus.session,
@@ -243,7 +246,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/overlay.js b/gnome-44-max/src/overlay.js
index c42af7c..1c917dc 100644
--- a/gnome-44-max/src/overlay.js
+++ b/gnome-44-max/src/overlay.js
@@ -1,11 +1,14 @@
-import Clutter from 'gi://Clutter'
-import Shell from 'gi://Shell';
-import St from 'gi://St';
+const Clutter = imports.gi.Clutter;
+const Shell = imports.gi.Shell;
+const St = imports.gi.St;
-import { SystemBackground } from './systembackground.js';
-import * as Main from 'resource:///org/gnome/shell/ui/main.js';
+const Main = imports.ui.main;
-export class Overlay {
+const ExtensionUtils = imports.misc.extensionUtils;
+const Me = ExtensionUtils.getCurrentExtension();
+const { SystemBackground } = Me.imports.systembackground;
+
+var Overlay = class {
constructor(targetMonitor) {
this._overlayContent = new Clutter.Actor({clip_to_allocation: true});
this._overlay = new St.Bin({
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/systembackground.js b/gnome-44-max/src/systembackground.js
index cf7a3bb..cbf0a75 100644
--- a/gnome-44-max/src/systembackground.js
+++ b/gnome-44-max/src/systembackground.js
@@ -1,14 +1,14 @@
-import Clutter from 'gi://Clutter';
-import Cogl from 'gi://Cogl';
-import GLib from 'gi://GLib';
-import GObject from 'gi://GObject';
-import Meta from 'gi://Meta';
+const Clutter = imports.gi.Clutter;
+const Cogl = imports.gi.Cogl;
+const GLib = imports.gi.GLib;
+const GObject = imports.gi.GObject;
+const Meta = imports.gi.Meta;
const DEFAULT_BACKGROUND_COLOR = Clutter.Color?.from_pixel(0x2e3436ff) || new Cogl.Color({red: 40, green: 40, blue: 40, alpha: 255});
let _systemBackground;
-export const SystemBackground = GObject.registerClass({
+var SystemBackground = GObject.registerClass({
Signals: {'loaded': {}},
}, class SystemBackground extends Meta.BackgroundActor {
_init() {
diff --git a/gnome-44-max/src/time.js b/gnome-44-max/src/time.js
index 017994a..3aa97d9 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(toSec(Date.now()) - dateSec) <= 1;
}
\ No newline at end of file
diff --git a/gnome-44-max/src/xrEffect.js b/gnome-44-max/src/xrEffect.js
index 8590e0f..4394f43 100644
--- a/gnome-44-max/src/xrEffect.js
+++ b/gnome-44-max/src/xrEffect.js
@@ -1,13 +1,15 @@
-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 Shell from 'gi://Shell';
-
-import Globals from './globals.js';
-
-import {
+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 ExtensionUtils = imports.misc.extensionUtils;
+const Me = ExtensionUtils.getCurrentExtension();
+
+const Globals = Me.imports.globals;
+const {
dataViewEnd,
dataViewUint8,
dataViewBigUint,
@@ -21,12 +23,12 @@ import {
FLOAT_SIZE,
UINT_SIZE,
UINT8_SIZE
-} from "./ipc.js";
-import { degreeToRadian } from "./math.js";
-import { getShaderSource } from "./shader.js";
-import { isValidKeepAlive, toSec } from "./time.js";
+} = Me.imports.ipc;
+const { degreeToRadian } = Me.imports.math;
+const { getShaderSource } = Me.imports.shader;
+const { isValidKeepAlive, toSec } = Me.imports.time;
-export const IPC_FILE_PATH = "/dev/shm/breezy_desktop_imu";
+var IPC_FILE_PATH = "/dev/shm/breezy_desktop_imu";
// the driver should be using the same data layout version
const DATA_LAYOUT_VERSION = 3;
@@ -232,7 +234,7 @@ function checkParityByte(dataView) {
return parityByte === parity;
}
-export const XREffect = GObject.registerClass({
+var XREffect = GObject.registerClass({
Properties: {
'supported-device-detected': GObject.ParamSpec.boolean(
'supported-device-detected',
@@ -380,8 +382,13 @@ export const XREffect = GObject.registerClass({
if (!this._initialized) {
this.set_uniform_float(this.get_uniform_location('screenTexture'), 1, [0]);
- this.get_pipeline().set_layer_texture(1, calibratingImage.get_texture());
- this.get_pipeline().set_layer_texture(2, customBannerImage.get_texture());
+ try {
+ // this can break in GNOME 42
+ this.get_pipeline().set_layer_texture(1, calibratingImage.get_texture());
+ this.get_pipeline().set_layer_texture(2, customBannerImage.get_texture());
+ } catch (e) {
+ Globals.logger.log(`ERROR: xrEffect.js vfunc_paint_target ${e.message}\n${e.stack}`);
+ }
this.get_pipeline().set_uniform_1i(this.get_uniform_location('calibratingTexture'), 1);
this.get_pipeline().set_uniform_1i(this.get_uniform_location('customBannerTexture'), 2);
diff --git a/modules/XRLinuxDriver b/modules/XRLinuxDriver
index 53002af..91a5d65 160000
--- a/modules/XRLinuxDriver
+++ b/modules/XRLinuxDriver
@@ -1 +1 @@
-Subproject commit 53002afde8406eef7fe309206268ad6dc39e2da6
+Subproject commit 91a5d65c57a63a8003ef4f8a2c36bc519104d54c
diff --git a/modules/sombrero b/modules/sombrero
index 76cb6bb..0ddc237 160000
--- a/modules/sombrero
+++ b/modules/sombrero
@@ -1 +1 @@
-Subproject commit 76cb6bb65e90dfe2abf5bd2db8e280ae6e03d5c6
+Subproject commit 0ddc237b5b47208eb9f3f520177920f7ea157dfd
diff --git a/ui/modules/PyXRLinuxDriverIPC b/ui/modules/PyXRLinuxDriverIPC
index c3b0dda..e6ec3e3 160000
--- a/ui/modules/PyXRLinuxDriverIPC
+++ b/ui/modules/PyXRLinuxDriverIPC
@@ -1 +1 @@
-Subproject commit c3b0ddab302e11e517b57b621ff334faf03173de
+Subproject commit e6ec3e309e63608552becff694e5f3c9d1e5bcc3