[gnome] Update gnome extensions
This commit is contained in:
@ -78,8 +78,10 @@ export default class ScreenAutoRotateExtension extends Extension {
|
||||
this._timeoutId = setTimeout(() => {
|
||||
this._set_hide_lock_rotate(this._settings.get_boolean('hide-lock-rotate'));
|
||||
|
||||
// Rotate once on start up to the orientation detected by the claimed accelerometer
|
||||
this.rotate_to(this._sensor_proxy.get_accelerometer_orientation());
|
||||
if (!this._settings.get_boolean('skip-initial-rotation')) {
|
||||
// Rotate once on start up to the orientation detected by the claimed accelerometer
|
||||
this.rotate_to(this._sensor_proxy.get_accelerometer_orientation());
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
|
||||
@ -15,9 +15,10 @@
|
||||
"45",
|
||||
"46",
|
||||
"47",
|
||||
"48"
|
||||
"48",
|
||||
"49"
|
||||
],
|
||||
"url": "https://github.com/shyzus/gnome-shell-extension-screen-autorotate",
|
||||
"uuid": "screen-rotate@shyzus.github.io",
|
||||
"version": 25
|
||||
"version": 27
|
||||
}
|
||||
@ -77,6 +77,15 @@ export default class MyExtensionPreferences extends ExtensionPreferences {
|
||||
|
||||
orientationGroup.add(setOffsetRow);
|
||||
|
||||
const skipInitRotationRow = new Adw.ActionRow({
|
||||
title: 'Skip initial rotation',
|
||||
subtitle: 'Skip initial rotation on extension startup ensures the' +
|
||||
' last known orientation is loaded on startup and the' +
|
||||
' overview screen is not skipped.'
|
||||
});
|
||||
|
||||
orientationGroup.add(skipInitRotationRow);
|
||||
|
||||
const enableManualFlipRow = new Adw.ActionRow({
|
||||
title: 'Enable manual flip',
|
||||
subtitle: 'Enable a toggle in the GNOME Shell System Menu to manually flip between landscape and portrait.'
|
||||
@ -132,6 +141,11 @@ export default class MyExtensionPreferences extends ExtensionPreferences {
|
||||
const setOffsetSpinButton = Gtk.SpinButton.new_with_range(0, 3, 1);
|
||||
setOffsetSpinButton.value = window._settings.get_int('orientation-offset');
|
||||
|
||||
const skipInitRotationButton = new Gtk.Switch({
|
||||
active: window._settings.get_boolean('skip-initial-rotation'),
|
||||
valign: Gtk.Align.CENTER
|
||||
});
|
||||
|
||||
const manualFlipSwitch = new Gtk.Switch({
|
||||
active: window._settings.get_boolean('manual-flip'),
|
||||
valign: Gtk.Align.CENTER,
|
||||
@ -278,6 +292,9 @@ export default class MyExtensionPreferences extends ExtensionPreferences {
|
||||
window._settings.bind('orientation-offset',
|
||||
setOffsetSpinButton, 'value', Gio.SettingsBindFlags.DEFAULT);
|
||||
|
||||
window._settings.bind('skip-initial-rotation',
|
||||
skipInitRotationButton, 'active', Gio.SettingsBindFlags.DEFAULT);
|
||||
|
||||
window._settings.bind('manual-flip',
|
||||
manualFlipSwitch, 'active', Gio.SettingsBindFlags.DEFAULT);
|
||||
|
||||
@ -311,6 +328,9 @@ export default class MyExtensionPreferences extends ExtensionPreferences {
|
||||
setOffsetRow.add_suffix(setOffsetSpinButton);
|
||||
setOffsetRow.activatable_widget = setOffsetSpinButton;
|
||||
|
||||
skipInitRotationRow.add_suffix(skipInitRotationButton);
|
||||
skipInitRotationRow.activatable_widget = skipInitRotationButton;
|
||||
|
||||
enableManualFlipRow.add_suffix(manualFlipSwitch);
|
||||
enableManualFlipRow.activatable_widget = manualFlipSwitch;
|
||||
|
||||
|
||||
Binary file not shown.
@ -75,6 +75,10 @@
|
||||
<default>false</default>
|
||||
<description>Toggle disabling the touchpad when the orientation is portrait right.</description>
|
||||
</key>
|
||||
<key type="b" name="skip-initial-rotation">
|
||||
<default>false</default>
|
||||
<description>Toggle skipping the initial rotation on extension startup. Will preserve last set orientation</description>
|
||||
</key>
|
||||
<key type="b" name="debug-logging">
|
||||
<default>false</default>
|
||||
<description>Toggle debug logging.</description>
|
||||
|
||||
@ -40,13 +40,13 @@ export class SensorProxy {
|
||||
enable() {
|
||||
this._enabled = true;
|
||||
if (this._proxy === null) return;
|
||||
this._proxy.call_sync('ClaimAccelerometer', null, Gio.DBusCallFlags.NONE, -1, null);
|
||||
this._proxy.call('ClaimAccelerometer', null, Gio.DBusCallFlags.NONE, 100, null, null);
|
||||
}
|
||||
|
||||
disable() {
|
||||
this._enabled = false;
|
||||
if (this._proxy === null) return;
|
||||
this._proxy.call_sync('ReleaseAccelerometer', null, Gio.DBusCallFlags.NONE, -1, null);
|
||||
this._proxy.call('ReleaseAccelerometer', null, Gio.DBusCallFlags.NONE, 100, null, null);
|
||||
}
|
||||
|
||||
appeared(_connection, _name, _name_owner) {
|
||||
@ -56,7 +56,7 @@ export class SensorProxy {
|
||||
null);
|
||||
this._proxy.connect('g-properties-changed', this.properties_changed.bind(this));
|
||||
if (this._enabled) {
|
||||
this._proxy.call_sync('ClaimAccelerometer', null, Gio.DBusCallFlags.NONE, -1, null);
|
||||
this._proxy.call('ClaimAccelerometer', null, Gio.DBusCallFlags.NONE, 100, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user