Add intellihide option to disable panel reveal with the pointer

gh-2123
This commit is contained in:
Charles Gagnon
2025-04-09 23:37:37 -04:00
parent 7a54518746
commit f0af17687f
4 changed files with 50 additions and 7 deletions

View File

@@ -116,7 +116,8 @@ export const Intellihide = class {
)
}
this._setRevealMechanism()
if (SETTINGS.get_boolean('intellihide-use-pointer'))
this._setRevealMechanism()
let lastState = SETTINGS.get_int('intellihide-persisted-state')
@@ -238,6 +239,7 @@ export const Intellihide = class {
[
SETTINGS,
[
'changed::intellihide-use-pointer',
'changed::intellihide-use-pressure',
'changed::intellihide-hide-from-windows',
'changed::intellihide-hide-from-monitor-windows',
@@ -307,7 +309,10 @@ export const Intellihide = class {
}
_removeRevealMechanism() {
PointerWatcher.getPointerWatcher()._removeWatch(this._pointerWatch)
if (this._pointerWatch) {
PointerWatcher.getPointerWatcher()._removeWatch(this._pointerWatch)
this._pointerWatch = 0
}
if (this._pressureBarrier) {
this._pressureBarrier.destroy()

View File

@@ -1592,6 +1592,25 @@ const Preferences = class {
Gio.SettingsBindFlags.DEFAULT,
)
this._settings.bind(
'intellihide-use-pointer',
this._builder.get_object('intellihide_use_pointer_switch'),
'active',
Gio.SettingsBindFlags.DEFAULT,
)
this._settings.connect('changed::intellihide-use-pointer', () => {
if (!this._settings.get_boolean('intellihide-use-pointer'))
this._settings.set_boolean('intellihide-use-pressure', false)
})
this._settings.bind(
'intellihide-use-pointer',
this._builder.get_object('intellihide_use_pressure_options'),
'sensitive',
Gio.SettingsBindFlags.DEFAULT,
)
this._settings.bind(
'intellihide-use-pressure',
this._builder.get_object('intellihide_use_pressure_switch'),
@@ -1601,14 +1620,14 @@ const Preferences = class {
this._settings.bind(
'intellihide-use-pressure',
this._builder.get_object('intellihide_use_pressure_options'),
this._builder.get_object('intellihide_use_pressure_options2'),
'sensitive',
Gio.SettingsBindFlags.DEFAULT,
)
this._settings.bind(
'intellihide-use-pressure',
this._builder.get_object('intellihide_use_pressure_options2'),
this._builder.get_object('intellihide_use_pressure_options3'),
'sensitive',
Gio.SettingsBindFlags.DEFAULT,
)
@@ -1766,6 +1785,10 @@ const Preferences = class {
'intellihide-behaviour',
this._settings.get_default_value('intellihide-behaviour'),
)
this._settings.set_value(
'intellihide-use-pointer',
this._settings.get_default_value('intellihide-use-pointer'),
)
this._settings.set_value(
'intellihide-use-pressure',
this._settings.get_default_value('intellihide-use-pressure'),