Extension: Add setting to disable transition when an app is fullscreen
This commit is contained in:
@@ -73,6 +73,9 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
|||||||
<key name="nightthemeswitcher-ondemand-keybinding" type="as">
|
<key name="nightthemeswitcher-ondemand-keybinding" type="as">
|
||||||
<default><![CDATA[['<Shift><Super>t']]]></default>
|
<default><![CDATA[['<Shift><Super>t']]]></default>
|
||||||
</key>
|
</key>
|
||||||
|
<key name="fullscreen-transition" type="b">
|
||||||
|
<default>true</default>
|
||||||
|
</key>
|
||||||
<key name="manual-schedule" type="b">
|
<key name="manual-schedule" type="b">
|
||||||
<default>false</default>
|
<default>false</default>
|
||||||
</key>
|
</key>
|
||||||
|
|||||||
@@ -48,6 +48,15 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
|||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="AdwPreferencesGroup">
|
||||||
|
<child>
|
||||||
|
<object class="AdwSwitchRow" id="fullscreen_transition_switch">
|
||||||
|
<property name="title" translatable="yes">Run the transition when an app is fullscreen</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="AdwPreferencesGroup">
|
<object class="AdwPreferencesGroup">
|
||||||
<child>
|
<child>
|
||||||
|
|||||||
@@ -123,7 +123,9 @@ export class Timer extends GObject.Object {
|
|||||||
|
|
||||||
debug.message(manual ? `Time manually set to ${time}.` : `Time changed to ${time}.`);
|
debug.message(manual ? `Time manually set to ${time}.` : `Time changed to ${time}.`);
|
||||||
|
|
||||||
layoutManager.screenTransition.run();
|
const isMonitorFullscreen = layoutManager.monitors.some(monitor => monitor.inFullscreen);
|
||||||
|
if (this.#settings.get_boolean('fullscreen-transition') || !isMonitorFullscreen)
|
||||||
|
layoutManager.screenTransition.run();
|
||||||
|
|
||||||
this.notify('time');
|
this.notify('time');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export class SchedulePage extends Adw.PreferencesPage {
|
|||||||
'keyboard_shortcut_button',
|
'keyboard_shortcut_button',
|
||||||
'schedule_sunrise_time_chooser',
|
'schedule_sunrise_time_chooser',
|
||||||
'schedule_sunset_time_chooser',
|
'schedule_sunset_time_chooser',
|
||||||
|
'fullscreen_transition_switch',
|
||||||
],
|
],
|
||||||
}, this);
|
}, this);
|
||||||
}
|
}
|
||||||
@@ -28,6 +29,8 @@ export class SchedulePage extends Adw.PreferencesPage {
|
|||||||
settings.bind('sunrise', this._schedule_sunrise_time_chooser, 'time', Gio.SettingsBindFlags.DEFAULT);
|
settings.bind('sunrise', this._schedule_sunrise_time_chooser, 'time', Gio.SettingsBindFlags.DEFAULT);
|
||||||
settings.bind('sunset', this._schedule_sunset_time_chooser, 'time', Gio.SettingsBindFlags.DEFAULT);
|
settings.bind('sunset', this._schedule_sunset_time_chooser, 'time', Gio.SettingsBindFlags.DEFAULT);
|
||||||
|
|
||||||
|
settings.bind('fullscreen-transition', this._fullscreen_transition_switch, 'active', Gio.SettingsBindFlags.DEFAULT);
|
||||||
|
|
||||||
settings.connect('changed::nightthemeswitcher-ondemand-keybinding', () => {
|
settings.connect('changed::nightthemeswitcher-ondemand-keybinding', () => {
|
||||||
this._keyboard_shortcut_button.keybinding = settings.get_strv('nightthemeswitcher-ondemand-keybinding')[0];
|
this._keyboard_shortcut_button.keybinding = settings.get_strv('nightthemeswitcher-ondemand-keybinding')[0];
|
||||||
});
|
});
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@ export default class NightThemeSwitcherPreferences extends ExtensionPreferences
|
|||||||
|
|
||||||
// Set window properties
|
// Set window properties
|
||||||
window.search_enabled = true;
|
window.search_enabled = true;
|
||||||
window.set_default_size(640, 600);
|
window.set_default_size(640, 680);
|
||||||
|
|
||||||
// Add a dummy page until the dynamics imports are done
|
// Add a dummy page until the dynamics imports are done
|
||||||
const dummyPage = new Adw.PreferencesPage();
|
const dummyPage = new Adw.PreferencesPage();
|
||||||
|
|||||||
Reference in New Issue
Block a user