A few small improvements

This commit is contained in:
wheaney 2024-06-15 09:36:14 -07:00
parent bfcf0b497f
commit c6a35e2a94
3 changed files with 10 additions and 11 deletions

View File

@ -129,9 +129,7 @@ export default class BreezyDesktopExtension extends Extension {
// if target_monitor isn't set, do nothing and wait for MonitorManager to call this again
if (target_monitor && this._running_poller_id === undefined) {
this._target_monitor = target_monitor.monitor;
// have everything target a slightly higher refresh rate to avoid stuttering
this._refresh_rate = target_monitor.refreshRate * 1.05;
this._refresh_rate = target_monitor.refreshRate;
if (this._check_driver_running()) {
Globals.logger.log('Ready, enabling XR effect');
@ -159,7 +157,7 @@ export default class BreezyDesktopExtension extends Extension {
this._is_effect_running = true;
try {
this._cursor_manager = new CursorManager(Main.layoutManager.uiGroup, this._refresh_rate);
this._cursor_manager = new CursorManager(Main.layoutManager.uiGroup, this._refresh_rate * 1.05);
this._cursor_manager.enable();
this._overlay = new St.Bin({ style: 'background-color: rgba(0, 0, 0, 1);'});
@ -189,10 +187,11 @@ export default class BreezyDesktopExtension extends Extension {
toggle_display_distance_start: this.settings.get_double('toggle-display-distance-start'),
toggle_display_distance_end: this.settings.get_double('toggle-display-distance-end'),
});
this._widescreen_mode_effect_state_connection = this._xr_effect.connect('notify::widescreen-mode-state', this._update_widescreen_mode_from_state.bind(this));
this._update_widescreen_mode_from_state(this._xr_effect, this._xr_effect.widescreen_mode_state);
this._update_follow_threshold(this.settings);
this._update_widescreen_mode_from_settings(this.settings);
this._widescreen_mode_effect_state_connection = this._xr_effect.connect('notify::widescreen-mode-state', this._update_widescreen_mode_from_state.bind(this));
this._distance_binding = this.settings.bind('display-distance', this._xr_effect, 'display-distance', Gio.SettingsBindFlags.DEFAULT)
this._distance_connection = this.settings.connect('changed::display-distance', this._update_display_distance.bind(this))
@ -283,7 +282,7 @@ export default class BreezyDesktopExtension extends Extension {
if (value !== this.settings.get_boolean('widescreen-mode'))
this.settings.set_boolean('widescreen-mode', value);
else
Globals.logger.log_debug('widescreen-mode setting already matched state');
Globals.logger.log_debug('settings.widescreen-mode already matched state');
}
_recenter_display() {

View File

@ -251,8 +251,8 @@ export const XREffect = GObject.registerClass({
constructor(params = {}) {
super(params);
// target a slightly higher framerate than the monitor's refresh rate to prevent stuttering
const frameTimeFramerate = this.target_framerate;
// target a slightly lower framerate than the monitor's refresh rate to prevent repainting too frequently
const frameTimeFramerate = this.target_framerate * 0.9;
this._frametime = Math.floor(1000 / frameTimeFramerate);
this._is_display_distance_at_end = false;
@ -338,7 +338,7 @@ export const XREffect = GObject.registerClass({
setSingleFloat(this, 'display_north_offset', this.display_distance);
setSingleFloat(this, 'look_ahead_ms', lookAheadMS(this._dataView));
setUniformMatrix(this, 'imu_quat_data', 4, this._dataView, IMU_QUAT_DATA);
setSingleFloat(this, 'display_size', this.widescreen_display_size);
setSingleFloat(this, 'display_size', this.widescreen_mode_state ? this.widescreen_display_size : 1.0);
success = true;
}
} else if (this._dataView.byteLength !== 0) {

@ -1 +1 @@
Subproject commit 29d73864d1dc531143ffb7211592b1f803980758
Subproject commit 6925472075303853db6fa08bad364768861f42b6