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` diff --git a/gnome/src/extension.js b/gnome/src/extension.js index 257c139..22dbe2f 100644 --- a/gnome/src/extension.js +++ b/gnome/src/extension.js @@ -174,11 +174,13 @@ class BreezyDesktopExtension { 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(); @@ -214,9 +216,7 @@ class BreezyDesktopExtension { 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}`); @@ -461,13 +461,13 @@ class BreezyDesktopExtension { } _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 5478d2a..3aa97d9 100644 --- a/gnome/src/time.js +++ b/gnome/src/time.js @@ -6,6 +6,6 @@ function toSec(milliseconds) { return Math.floor(milliseconds / 1000); } -function isValidKeepAlive(dateSec, strictCheck = false) { - return Math.abs(toSec(Date.now()) - dateSec) <= (strictCheck ? 1 : 5); +function isValidKeepAlive(dateSec) { + return Math.abs(toSec(Date.now()) - dateSec) <= 1; } \ No newline at end of file