Optimize monitor focus checking, fix toggle XR effect not working when disabled, v2.0.16
This commit is contained in:
parent
29218cd4f2
commit
36646977fc
|
|
@ -94,6 +94,8 @@ export default class BreezyDesktopExtension extends Extension {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._add_settings_keybinding('toggle-xr-effect-shortcut', this._toggle_xr_effect.bind(this));
|
||||||
|
|
||||||
this._setup();
|
this._setup();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Globals.logger.log(`[ERROR] BreezyDesktopExtension enable ${e.message}\n${e.stack}`);
|
Globals.logger.log(`[ERROR] BreezyDesktopExtension enable ${e.message}\n${e.stack}`);
|
||||||
|
|
@ -304,7 +306,6 @@ export default class BreezyDesktopExtension extends Extension {
|
||||||
Meta.disable_unredirect_for_display(global.display);
|
Meta.disable_unredirect_for_display(global.display);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._add_settings_keybinding('toggle-xr-effect-shortcut', this._toggle_xr_effect.bind(this));
|
|
||||||
this._add_settings_keybinding('recenter-display-shortcut', this._recenter_display.bind(this));
|
this._add_settings_keybinding('recenter-display-shortcut', this._recenter_display.bind(this));
|
||||||
this._add_settings_keybinding('toggle-display-distance-shortcut', this._virtual_displays_actor._change_distance.bind(this._virtual_displays_actor));
|
this._add_settings_keybinding('toggle-display-distance-shortcut', this._virtual_displays_actor._change_distance.bind(this._virtual_displays_actor));
|
||||||
this._add_settings_keybinding('toggle-follow-shortcut', this._toggle_follow_mode.bind(this));
|
this._add_settings_keybinding('toggle-follow-shortcut', this._toggle_follow_mode.bind(this));
|
||||||
|
|
@ -556,7 +557,6 @@ export default class BreezyDesktopExtension extends Extension {
|
||||||
|
|
||||||
if (Globals.data_stream.smooth_follow_enabled) this._toggle_follow_mode();
|
if (Globals.data_stream.smooth_follow_enabled) this._toggle_follow_mode();
|
||||||
|
|
||||||
Main.wm.removeKeybinding('toggle-xr-effect-shortcut');
|
|
||||||
Main.wm.removeKeybinding('recenter-display-shortcut');
|
Main.wm.removeKeybinding('recenter-display-shortcut');
|
||||||
Main.wm.removeKeybinding('toggle-display-distance-shortcut');
|
Main.wm.removeKeybinding('toggle-display-distance-shortcut');
|
||||||
Main.wm.removeKeybinding('toggle-follow-shortcut');
|
Main.wm.removeKeybinding('toggle-follow-shortcut');
|
||||||
|
|
@ -642,6 +642,7 @@ export default class BreezyDesktopExtension extends Extension {
|
||||||
Globals.data_stream.disconnect(this._breezy_desktop_running_connection);
|
Globals.data_stream.disconnect(this._breezy_desktop_running_connection);
|
||||||
this._breezy_desktop_running_connection = null;
|
this._breezy_desktop_running_connection = null;
|
||||||
}
|
}
|
||||||
|
Main.wm.removeKeybinding('toggle-xr-effect-shortcut');
|
||||||
Gio.Settings.unbind(this.settings, 'debug');
|
Gio.Settings.unbind(this.settings, 'debug');
|
||||||
Gio.Settings.unbind(this.settings, 'use-optimal-monitor-config');
|
Gio.Settings.unbind(this.settings, 'use-optimal-monitor-config');
|
||||||
Gio.Settings.unbind(this.settings, 'headset-as-primary');
|
Gio.Settings.unbind(this.settings, 'headset-as-primary');
|
||||||
|
|
|
||||||
|
|
@ -247,8 +247,9 @@ export const VirtualDisplayEffect = GObject.registerClass({
|
||||||
|
|
||||||
if (this._follow_ease_timeline?.is_playing()) this._follow_ease_timeline.stop();
|
if (this._follow_ease_timeline?.is_playing()) this._follow_ease_timeline.stop();
|
||||||
|
|
||||||
|
const ease_to_focus = this.smooth_follow_enabled && this._is_focused();
|
||||||
const from = this._current_follow_ease_progress;
|
const from = this._current_follow_ease_progress;
|
||||||
const to = this.smooth_follow_enabled && this._is_focused() ? 1.0 : 0.0;
|
const to = ease_to_focus ? 1.0 : 0.0;
|
||||||
const toggleTime = this.smooth_follow_toggle_epoch_ms === 0 ? Date.now() : this.smooth_follow_toggle_epoch_ms;
|
const toggleTime = this.smooth_follow_toggle_epoch_ms === 0 ? Date.now() : this.smooth_follow_toggle_epoch_ms;
|
||||||
|
|
||||||
// would have been a slight delay between request and slerp actually starting
|
// would have been a slight delay between request and slerp actually starting
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import Cogl from 'gi://Cogl';
|
||||||
import GdkPixbuf from 'gi://GdkPixbuf';
|
import GdkPixbuf from 'gi://GdkPixbuf';
|
||||||
import GLib from 'gi://GLib';
|
import GLib from 'gi://GLib';
|
||||||
import GObject from 'gi://GObject';
|
import GObject from 'gi://GObject';
|
||||||
import Mtk from 'gi://Mtk';
|
|
||||||
import Shell from 'gi://Shell';
|
import Shell from 'gi://Shell';
|
||||||
import St from 'gi://St';
|
import St from 'gi://St';
|
||||||
|
|
||||||
|
|
@ -776,7 +775,9 @@ export const VirtualDisplaysActor = GObject.registerClass({
|
||||||
if (this.show_banner) {
|
if (this.show_banner) {
|
||||||
this.focused_monitor_index = -1;
|
this.focused_monitor_index = -1;
|
||||||
this.focused_monitor_details = null;
|
this.focused_monitor_details = null;
|
||||||
} else if (this.imu_snapshots && (!this._smooth_follow_slerping || this.focused_monitor_index === -1)) {
|
} else if (this.imu_snapshots &&
|
||||||
|
(!this.smooth_follow_enabled || this.focused_monitor_index === -1) &&
|
||||||
|
(!this._smooth_follow_slerping || this.focused_monitor_index === -1)) {
|
||||||
// if smooth follow is enabled, use the origin IMU data to inform the initial focused monitor
|
// if smooth follow is enabled, use the origin IMU data to inform the initial focused monitor
|
||||||
// since it reflects where the user is looking in relation to the original monitor positions
|
// since it reflects where the user is looking in relation to the original monitor positions
|
||||||
const currentPoseQuat = this.smooth_follow_enabled ?
|
const currentPoseQuat = this.smooth_follow_enabled ?
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue