From d9855310e1da649c28ee6708a0466f69efdb47f1 Mon Sep 17 00:00:00 2001 From: wheaney <42350981+wheaney@users.noreply.github.com> Date: Fri, 18 Oct 2024 12:27:56 -0700 Subject: [PATCH 1/4] Fix gnome-44-max patch for the latest cursor/overlay changes --- gnome-44-max.patch | 53 +++++++++++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 15 deletions(-) diff --git a/gnome-44-max.patch b/gnome-44-max.patch index cae2d6c..78dd1ff 100644 --- a/gnome-44-max.patch +++ b/gnome-44-max.patch @@ -35,10 +35,10 @@ index 36ad7ee..41102a0 100644 }, class MouseSpriteContent extends GObject.Object { _init() { diff --git a/gnome-44-max/src/cursormanager.js b/gnome-44-max/src/cursormanager.js -index 018b942..870d86e 100644 +index 52d1341..86d8a76 100644 --- a/gnome-44-max/src/cursormanager.js +++ b/gnome-44-max/src/cursormanager.js -@@ -1,11 +1,15 @@ +@@ -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'; @@ -47,7 +47,7 @@ index 018b942..870d86e 100644 +const Clutter = imports.gi.Clutter; +const Meta = imports.gi.Meta; +const PointerWatcher = imports.ui.pointerWatcher; -+ + +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); + @@ -57,26 +57,25 @@ index 018b942..870d86e 100644 // Taken from https://github.com/jkitching/soft-brightness-plus -export class CursorManager { +var CursorManager = class CursorManager { - constructor(mainActor, refreshRate) { - this._mainActor = mainActor; + 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 29a38f1..0a7e9ae 100644 +index 7074ceb..257c139 100644 --- a/gnome-44-max/src/extension.js +++ b/gnome-44-max/src/extension.js -@@ -1,20 +1,22 @@ +@@ -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 St from 'gi://St'; - -import { CursorManager } from './cursormanager.js'; -import Globals from './globals.js'; -import { Logger } from './logger.js'; -import { MonitorManager } from './monitormanager.js'; --import { SystemBackground } from './systembackground.js'; +-import { Overlay } from './overlay.js'; -import { isValidKeepAlive } from './time.js'; -import { IPC_FILE_PATH, XREffect } from './xrEffect.js'; - @@ -87,7 +86,6 @@ index 29a38f1..0a7e9ae 100644 +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; + @@ -98,13 +96,13 @@ index 29a38f1..0a7e9ae 100644 +const { CursorManager } = Me.imports.cursormanager; +const { Logger } = Me.imports.logger; +const { MonitorManager } = Me.imports.monitormanager; -+const { SystemBackground } = Me.imports.systembackground; ++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 = [ -@@ -30,11 +32,10 @@ const SUPPORTED_MONITOR_PRODUCTS = [ +@@ -29,11 +31,10 @@ const SUPPORTED_MONITOR_PRODUCTS = [ NESTED_MONITOR_PRODUCT ]; @@ -120,7 +118,7 @@ index 29a38f1..0a7e9ae 100644 // Set/destroyed by enable/disable this._cursor_manager = null; -@@ -621,6 +622,6 @@ export default class BreezyDesktopExtension extends Extension { +@@ -635,6 +636,6 @@ export default class BreezyDesktopExtension extends Extension { } } @@ -304,6 +302,31 @@ index 6cf5532..580925c 100644 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..5139e40 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; ++ ++class Overlay { + 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 @@ -318,10 +341,10 @@ index f70c96d..352be40 100644 const data = file.load_contents(null); diff --git a/gnome-44-max/src/systembackground.js b/gnome-44-max/src/systembackground.js -index 32b501e..de43435 100644 +index cf7a3bb..cbf0a75 100644 --- a/gnome-44-max/src/systembackground.js +++ b/gnome-44-max/src/systembackground.js -@@ -1,13 +1,13 @@ +@@ -1,14 +1,14 @@ -import Clutter from 'gi://Clutter'; -import Cogl from 'gi://Cogl'; -import GLib from 'gi://GLib'; From 723c6d23592245102d61f7a314022c9cf4f5d986 Mon Sep 17 00:00:00 2001 From: wheaney <42350981+wheaney@users.noreply.github.com> Date: Fri, 18 Oct 2024 22:42:35 -0700 Subject: [PATCH 2/4] Fix gnome-44-max patch again --- gnome-44-max.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnome-44-max.patch b/gnome-44-max.patch index 78dd1ff..1dc9633 100644 --- a/gnome-44-max.patch +++ b/gnome-44-max.patch @@ -303,7 +303,7 @@ index 6cf5532..580925c 100644 '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..5139e40 100644 +index c42af7c..1c917dc 100644 --- a/gnome-44-max/src/overlay.js +++ b/gnome-44-max/src/overlay.js @@ -1,11 +1,14 @@ @@ -323,7 +323,7 @@ index c42af7c..5139e40 100644 +const Me = ExtensionUtils.getCurrentExtension(); +const { SystemBackground } = Me.imports.systembackground; + -+class Overlay { ++var Overlay = class { constructor(targetMonitor) { this._overlayContent = new Clutter.Actor({clip_to_allocation: true}); this._overlay = new St.Bin({ From 1e7957ef8a0a87a0ab93ef9bcd2391096c83998a Mon Sep 17 00:00:00 2001 From: Wayne Heaney <42350981+wheaney@users.noreply.github.com> Date: Fri, 18 Oct 2024 23:05:01 -0700 Subject: [PATCH 3/4] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index be88e9c..1e4ae8c 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ There are two installations at the moment. **Note: Don't manually install either * [Breezy Vulkan](#breezy-vulkan) primarily for gaming but would work with pretty much any application that uses Vulkan rendering. ## Breezy GNOME -Breezy GNOME is a virtual workspace solution for Linux desktops that use the GNOME desktop environment (support GNOME versions 42 through 46); see [non-GNOME setup](#non-gnome-setup) if you want to try it without a GNOME desktop environment. It currently supports one widescreen virtual monitor and multiple physical monitors. See [upcoming features](#upcoming-features) for more improvements on the horizon. +Breezy GNOME is a virtual workspace solution for Linux desktops that use the GNOME desktop environment (support GNOME versions 42 through 47); see [non-GNOME setup](#non-gnome-setup) if you want to try it without a GNOME desktop environment. It currently supports one widescreen virtual monitor and multiple physical monitors. See [upcoming features](#upcoming-features) for more improvements on the horizon. ### GNOME Setup @@ -39,7 +39,7 @@ Steam Deck's desktop mode runs KDE Plasma, so, for now, Breezy Desktop can only ### Non-GNOME Setup A workable solution (with some [QoL improvements needed](#upcoming-features)) is to use your preferred desktop environment with a GNOME window open in nested mode. To do this: -1. Install `gnome-shell` using your distros package manager (e.g. apt-get, pacman, dnf, etc...). This will currently only work with GNOME Shell versions 42-46, so check that using `gnome-shell --version` +1. Install `gnome-shell` using your distros package manager (e.g. apt-get, pacman, dnf, etc...). This will currently only work with GNOME Shell versions 42-47, so check that using `gnome-shell --version` 2. Run the [GNOME setup](#gnome-setup) steps. You shouldn't need to log out and back in since GNOME will be running nested. 3. Launch the nested GNOME Shell using `MUTTER_DEBUG_DUMMY_MODE_SPECS="1920x1080@60" dbus-run-session -- gnome-shell --nested` From 05e4e36ddbf108906bd781458fdfbfe710605590 Mon Sep 17 00:00:00 2001 From: wheaney <42350981+wheaney@users.noreply.github.com> Date: Sun, 20 Oct 2024 13:21:51 -0700 Subject: [PATCH 4/4] Fix enable/disable shortcut so that widescreen gets disabled with the effect --- gnome/src/extension.js | 18 +++++++++--------- gnome/src/time.js | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gnome/src/extension.js b/gnome/src/extension.js index 7074ceb..c8b390d 100644 --- a/gnome/src/extension.js +++ b/gnome/src/extension.js @@ -173,11 +173,13 @@ export default class BreezyDesktopExtension extends Extension { return !needs_sbs_mode_switch && !this._monitor_manager.needsOptimalModeCheck(target_monitor.connector); } - _setup() { + // for_disable should be true if we're using this function to disable the + // effect without anticipating an immediate re-enable + _setup(for_disable = false) { Globals.logger.log_debug('BreezyDesktopExtension _setup'); if (this._is_effect_running) { Globals.logger.log('Reset triggered, disabling XR effect'); - this._effect_disable(true); + this._effect_disable(!for_disable); } const target_monitor = this._find_supported_monitor(); @@ -213,9 +215,7 @@ export default class BreezyDesktopExtension extends Extension { if (Globals.ipc_file.query_exists(null)) { const file_info = Globals.ipc_file.query_info(Gio.FILE_ATTRIBUTE_TIME_MODIFIED, Gio.FileQueryInfoFlags.NONE, null); const file_modified_time = file_info.get_attribute_uint64(Gio.FILE_ATTRIBUTE_TIME_MODIFIED); - - // when the driver is running, the IMU file is updated at least 60x per second, do a strict check - return isValidKeepAlive(file_modified_time, true); + return isValidKeepAlive(file_modified_time); } } catch (e) { Globals.logger.log(`ERROR: BreezyDesktopExtension _check_driver_running ${e.message}\n${e.stack}`); @@ -460,13 +460,13 @@ export default class BreezyDesktopExtension extends Extension { } _handle_supported_device_change(effect, _pspec) { - const value = effect.supported_device_detected; - Globals.logger.log_debug(`BreezyDesktopExtension _handle_supported_device_change ${value}`); + const device_connected = effect.supported_device_detected; + Globals.logger.log_debug(`BreezyDesktopExtension _handle_supported_device_change ${device_connected}`); // this will disable the effect and begin polling for a ready state again - if (!value && this._is_effect_running) { + if (!device_connected && this._is_effect_running) { Globals.logger.log('Supported device disconnected'); - this._setup(); + this._setup(true); } } diff --git a/gnome/src/time.js b/gnome/src/time.js index 7883b9b..017994a 100644 --- a/gnome/src/time.js +++ b/gnome/src/time.js @@ -6,6 +6,6 @@ export function toSec(milliseconds) { return Math.floor(milliseconds / 1000); } -export function isValidKeepAlive(dateSec, strictCheck = false) { - return Math.abs(toSec(Date.now()) - dateSec) <= (strictCheck ? 1 : 5); +export function isValidKeepAlive(dateSec) { + return Math.abs(toSec(Date.now()) - dateSec) <= 1; } \ No newline at end of file