Close preview when entering fullscreen

This commit is contained in:
Charles Gagnon
2019-09-26 12:44:56 -04:00
parent 87261304ef
commit c55230de98

View File

@@ -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();