From c55230de98d424028ad6f92f06597ca2dd211e07 Mon Sep 17 00:00:00 2001 From: Charles Gagnon Date: Thu, 26 Sep 2019 12:44:56 -0400 Subject: [PATCH] Close preview when entering fullscreen --- windowPreview.js | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/windowPreview.js b/windowPreview.js index 9baa4b5..00b9241 100644 --- a/windowPreview.js +++ b/windowPreview.js @@ -133,6 +133,15 @@ var PreviewMenu = Utils.defineClass({ 'style-changed', () => this._updateClip() ], + [ + global.display, + 'in-fullscreen-changed', + () => { + if (global.display.focus_window && global.display.focus_window.is_fullscreen()) { + this.close(true); + } + } + ], [ Me.settings, [ @@ -269,6 +278,10 @@ var PreviewMenu = Utils.defineClass({ } }, + getCurrentAppIcon: function() { + return this.currentAppIcon; + }, + _setReactive: function(reactive) {  this._box.get_children().forEach(c => c.reactive = reactive); this.menu.reactive = reactive; @@ -279,6 +292,14 @@ var PreviewMenu = Utils.defineClass({ this.emit('open-state-changed'); }, + _resetHiddenState: function() { + this.menu.hide(); + this._setOpenedState(false); + this.menu.opacity = 0; + this.menu[this._translationProp] = this._translationOffset; + this._box.get_children().forEach(c => c.destroy()); + }, + _removeFocus: function() { if (this._focusedPreview) { this._focusedPreview.setFocus(false); @@ -336,10 +357,6 @@ var PreviewMenu = Utils.defineClass({ preview.assignWindow(window, this.opened); }, - getCurrentAppIcon: function() { - return this.currentAppIcon; - }, - _addCloseTimeout: function() { this._timeoutsHandler.add([T2, Me.settings.get_int('leave-timeout'), () => this.close()]); }, @@ -406,14 +423,6 @@ var PreviewMenu = Utils.defineClass({ } }, - _resetHiddenState: function() { - this.menu.hide(); - this._setOpenedState(false); - this.menu.opacity = 0; - this.menu[this._translationProp] = this._translationOffset; - this._box.get_children().forEach(c => c.destroy()); - }, - _updateClip: function() { let x, y, w, h; let geom = this.panel.getGeometry();