Use fixed max value for opened preview menu timeout

This commit is contained in:
Charles Gagnon
2020-04-27 23:43:10 -04:00
parent f65d94d987
commit 7fcab98d7b
2 changed files with 7 additions and 10 deletions

View File

@@ -452,11 +452,6 @@
<summary>Icon enter display time</summary>
<description>Amount of time after entering icon to wait before displaying window preview if icon is not clicked or mouse has not left.</description>
</key>
<key type="i" name="move-window-previews-timeout">
<default>100</default>
<summary>Icon enter move time</summary>
<description>Amount of time after entering icon to wait before moving window preview if icon is not clicked or mouse has not left.</description>
</key>
<key type="b" name="peek-mode">
<default>true</default>
<summary>Enable peek mode</summary>

View File

@@ -170,12 +170,14 @@ var PreviewMenu = Utils.defineClass({
},
requestOpen: function(appIcon) {
let timeout = Me.settings.get_int('show-window-previews-timeout');
if (this.opened) {
timeout = Math.min(100, timeout);
}
this._endOpenCloseTimeouts();
this._timeoutsHandler.add([
T1,
Me.settings.get_int((this.opened ? 'move' : 'show') + '-window-previews-timeout'),
() => this.open(appIcon)
]);
this._timeoutsHandler.add([T1, timeout, () => this.open(appIcon)]);
},
requestClose: function() {