Send settings value to virtual displays actor sooner, fix framerate-cap so it defaults off
This commit is contained in:
parent
ed2b77b42c
commit
d528f7ce78
|
|
@ -261,8 +261,11 @@ export default class BreezyDesktopExtension extends Extension {
|
||||||
// const textureSourceActor = Main.layoutManager.uiGroup;
|
// const textureSourceActor = Main.layoutManager.uiGroup;
|
||||||
Globals.data_stream.refresh_data();
|
Globals.data_stream.refresh_data();
|
||||||
this._overlay_content = new VirtualMonitorsActor({
|
this._overlay_content = new VirtualMonitorsActor({
|
||||||
monitors: virtualMonitors,
|
width: targetMonitor.width,
|
||||||
|
height: targetMonitor.height,
|
||||||
|
virtual_monitors: virtualMonitors,
|
||||||
monitor_wrapping_scheme: this.settings.get_string('monitor-wrapping-scheme'),
|
monitor_wrapping_scheme: this.settings.get_string('monitor-wrapping-scheme'),
|
||||||
|
monitor_spacing: this.settings.get_double('monitor-spacing'),
|
||||||
viewport_offset_x: this.settings.get_double('viewport-offset-x'),
|
viewport_offset_x: this.settings.get_double('viewport-offset-x'),
|
||||||
viewport_offset_y: this.settings.get_double('viewport-offset-y'),
|
viewport_offset_y: this.settings.get_double('viewport-offset-y'),
|
||||||
target_monitor: targetMonitor,
|
target_monitor: targetMonitor,
|
||||||
|
|
@ -272,7 +275,8 @@ export default class BreezyDesktopExtension extends Extension {
|
||||||
framerate_cap: this.settings.get_double('framerate-cap'),
|
framerate_cap: this.settings.get_double('framerate-cap'),
|
||||||
imu_snapshots: Globals.data_stream.imu_snapshots,
|
imu_snapshots: Globals.data_stream.imu_snapshots,
|
||||||
show_banner: Globals.data_stream.show_banner,
|
show_banner: Globals.data_stream.show_banner,
|
||||||
custom_banner_enabled: Globals.data_stream.custom_banner_enabled
|
custom_banner_enabled: Globals.data_stream.custom_banner_enabled,
|
||||||
|
reactive: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
this._overlay.set_child(this._overlay_content);
|
this._overlay.set_child(this._overlay_content);
|
||||||
|
|
|
||||||
|
|
@ -275,6 +275,8 @@ function monitorsToPlacements(fovDetails, monitorDetailsList, monitorWrappingSch
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Globals.logger.log_debug(`\t\t\tMonitor placements: ${JSON.stringify(monitorPlacements)}, cached values: ${JSON.stringify(cachedMonitorRadians)}`);
|
||||||
|
|
||||||
return monitorPlacements;
|
return monitorPlacements;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -685,10 +687,16 @@ export const VirtualMonitorEffect = GObject.registerClass({
|
||||||
|
|
||||||
export const VirtualMonitorsActor = GObject.registerClass({
|
export const VirtualMonitorsActor = GObject.registerClass({
|
||||||
Properties: {
|
Properties: {
|
||||||
'monitors': GObject.ParamSpec.jsobject(
|
'target-monitor': GObject.ParamSpec.jsobject(
|
||||||
'monitors',
|
'target-monitor',
|
||||||
'Monitors',
|
'Target Monitor',
|
||||||
'Array of monitor indexes',
|
'Details about the monitor being used as a viewport',
|
||||||
|
GObject.ParamFlags.READWRITE
|
||||||
|
),
|
||||||
|
'virtual-monitors': GObject.ParamSpec.jsobject(
|
||||||
|
'virtual-monitors',
|
||||||
|
'Virtual Monitors',
|
||||||
|
'Array of monitor indexes for just the virtual monitors',
|
||||||
GObject.ParamFlags.READWRITE
|
GObject.ParamFlags.READWRITE
|
||||||
),
|
),
|
||||||
'monitor-wrapping-scheme': GObject.ParamSpec.string(
|
'monitor-wrapping-scheme': GObject.ParamSpec.string(
|
||||||
|
|
@ -705,12 +713,6 @@ export const VirtualMonitorsActor = GObject.registerClass({
|
||||||
GObject.ParamFlags.READWRITE,
|
GObject.ParamFlags.READWRITE,
|
||||||
0, 100, 0
|
0, 100, 0
|
||||||
),
|
),
|
||||||
'target-monitor': GObject.ParamSpec.jsobject(
|
|
||||||
'target-monitor',
|
|
||||||
'Target Monitor',
|
|
||||||
'Details about the monitor being used as a viewport',
|
|
||||||
GObject.ParamFlags.READWRITE
|
|
||||||
),
|
|
||||||
'viewport-offset-x': GObject.ParamSpec.double(
|
'viewport-offset-x': GObject.ParamSpec.double(
|
||||||
'viewport-offset-x',
|
'viewport-offset-x',
|
||||||
'Viewport Offset x',
|
'Viewport Offset x',
|
||||||
|
|
@ -805,7 +807,7 @@ export const VirtualMonitorsActor = GObject.registerClass({
|
||||||
'Framerate Cap',
|
'Framerate Cap',
|
||||||
'Maximum framerate to render at',
|
'Maximum framerate to render at',
|
||||||
GObject.ParamFlags.READWRITE,
|
GObject.ParamFlags.READWRITE,
|
||||||
1.0, 240.0, 60.0
|
0.0, 240.0, 0.0
|
||||||
),
|
),
|
||||||
'look-ahead-override': GObject.ParamSpec.int(
|
'look-ahead-override': GObject.ParamSpec.int(
|
||||||
'look-ahead-override',
|
'look-ahead-override',
|
||||||
|
|
@ -828,16 +830,9 @@ export const VirtualMonitorsActor = GObject.registerClass({
|
||||||
constructor(params = {}) {
|
constructor(params = {}) {
|
||||||
super(params);
|
super(params);
|
||||||
|
|
||||||
this.width = this.target_monitor.width;
|
|
||||||
this.height = this.target_monitor.height;
|
|
||||||
|
|
||||||
// add a margin to the cap time so we don't cut off frames that come in close
|
|
||||||
const frametime_margin = 0.75;
|
|
||||||
this._cap_frametime_ms = Math.floor(1000 * frametime_margin / this.framerate_cap);
|
|
||||||
|
|
||||||
this._all_monitors = [
|
this._all_monitors = [
|
||||||
this.target_monitor,
|
this.target_monitor,
|
||||||
...this.monitors
|
...this.virtual_monitors
|
||||||
]
|
]
|
||||||
|
|
||||||
const bannerTextureClippingRect = new Mtk.Rectangle({
|
const bannerTextureClippingRect = new Mtk.Rectangle({
|
||||||
|
|
@ -870,7 +865,20 @@ export const VirtualMonitorsActor = GObject.registerClass({
|
||||||
}
|
}
|
||||||
|
|
||||||
renderMonitors() {
|
renderMonitors() {
|
||||||
|
this._distance_ease_timeline = null;
|
||||||
|
this.connect('notify::toggle-display-distance-start', this._handle_display_distance_properties_change.bind(this));
|
||||||
|
this.connect('notify::toggle-display-distance-end', this._handle_display_distance_properties_change.bind(this));
|
||||||
|
this.connect('notify::display-distance', this._handle_display_distance_properties_change.bind(this));
|
||||||
|
this.connect('notify::monitor-wrapping-scheme', this._update_monitor_placements.bind(this));
|
||||||
|
this.connect('notify::monitor-spacing', this._update_monitor_placements.bind(this));
|
||||||
|
this.connect('notify::viewport-offset-x', this._update_monitor_placements.bind(this));
|
||||||
|
this.connect('notify::viewport-offset-y', this._update_monitor_placements.bind(this));
|
||||||
|
this.connect('notify::show-banner', this._handle_banner_update.bind(this));
|
||||||
|
this.connect('notify::custom-banner-enabled', this._handle_banner_update.bind(this));
|
||||||
|
this.connect('notify::frame-rate-cap', this._handle_frame_rate_cap_change.bind(this));
|
||||||
this._update_monitor_placements();
|
this._update_monitor_placements();
|
||||||
|
this._handle_display_distance_properties_change();
|
||||||
|
this._handle_frame_rate_cap_change();
|
||||||
|
|
||||||
const actorToDisplayRatios = [
|
const actorToDisplayRatios = [
|
||||||
global.stage.width / this.width,
|
global.stage.width / this.width,
|
||||||
|
|
@ -986,18 +994,6 @@ export const VirtualMonitorsActor = GObject.registerClass({
|
||||||
}).bind(this));
|
}).bind(this));
|
||||||
this._redraw_timeline.set_repeat_count(-1);
|
this._redraw_timeline.set_repeat_count(-1);
|
||||||
this._redraw_timeline.start();
|
this._redraw_timeline.start();
|
||||||
|
|
||||||
this._distance_ease_timeline = null;
|
|
||||||
this.connect('notify::toggle-display-distance-start', this._handle_display_distance_properties_change.bind(this));
|
|
||||||
this.connect('notify::toggle-display-distance-end', this._handle_display_distance_properties_change.bind(this));
|
|
||||||
this.connect('notify::display-distance', this._handle_display_distance_properties_change.bind(this));
|
|
||||||
this.connect('notify::monitor-wrapping-scheme', this._update_monitor_placements.bind(this));
|
|
||||||
this.connect('notify::monitor-spacing', this._update_monitor_placements.bind(this));
|
|
||||||
this.connect('notify::viewport-offset-x', this._update_monitor_placements.bind(this));
|
|
||||||
this.connect('notify::viewport-offset-y', this._update_monitor_placements.bind(this));
|
|
||||||
this.connect('notify::show-banner', this._handle_banner_update.bind(this));
|
|
||||||
this.connect('notify::custom-banner-enabled', this._handle_banner_update.bind(this));
|
|
||||||
this._handle_display_distance_properties_change();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_display_distance_default() {
|
_display_distance_default() {
|
||||||
|
|
@ -1076,6 +1072,12 @@ export const VirtualMonitorsActor = GObject.registerClass({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_handle_frame_rate_cap_change() {
|
||||||
|
// add a margin to the cap time so we don't cut off frames that come in close
|
||||||
|
const frametime_margin = 0.75;
|
||||||
|
this._cap_frametime_ms = this.framerate_cap === 0 ? 0.0 : Math.floor(1000 * frametime_margin / this.framerate_cap);
|
||||||
|
}
|
||||||
|
|
||||||
_change_distance() {
|
_change_distance() {
|
||||||
this.display_distance = this._is_display_distance_at_end ?
|
this.display_distance = this._is_display_distance_at_end ?
|
||||||
this.toggle_display_distance_start : this.toggle_display_distance_end;
|
this.toggle_display_distance_start : this.toggle_display_distance_end;
|
||||||
|
|
|
||||||
|
|
@ -228,7 +228,7 @@
|
||||||
</key>
|
</key>
|
||||||
<key name="framerate-cap" type="d">
|
<key name="framerate-cap" type="d">
|
||||||
<default>
|
<default>
|
||||||
60.0
|
0.0
|
||||||
</default>
|
</default>
|
||||||
<summary>Framerate cap</summary>
|
<summary>Framerate cap</summary>
|
||||||
<description>
|
<description>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue