Add 3.34 previews input region workaround

This commit is contained in:
Charles Gagnon
2019-10-10 08:19:51 -04:00
parent 7e7c5eb3fd
commit e726ec3299
2 changed files with 15 additions and 14 deletions

View File

@@ -567,16 +567,14 @@ function newUpdatePanelBarrier(panel) {
}
let barriers = {
_rightPanelBarrier: [panel],
_leftPanelBarrier: [panel]
_rightPanelBarrier: [],
_leftPanelBarrier: []
};
Object.keys(barriers).forEach(k => {
let obj = barriers[k][0];
if (obj[k]) {
obj[k].destroy();
obj[k] = null;
if (panel[k]) {
panel[k].destroy();
panel[k] = null;
}
});
@@ -626,14 +624,14 @@ function newUpdatePanelBarrier(panel) {
Object.keys(barriers).forEach(k => {
let barrierOptions = {
display: global.display,
directions: barriers[k][2]
directions: barriers[k][1]
};
barrierOptions[Panel.varCoord.c1] = barrierOptions[Panel.varCoord.c2] = barriers[k][1];
barrierOptions[Panel.varCoord.c1] = barrierOptions[Panel.varCoord.c2] = barriers[k][0];
barrierOptions[Panel.fixedCoord.c1] = fixed1;
barrierOptions[Panel.fixedCoord.c2] = fixed2;
barriers[k][0][k] = new Meta.Barrier(barrierOptions);
panel[k] = new Meta.Barrier(barrierOptions);
});
}

View File

@@ -54,6 +54,7 @@ const FADE_SIZE = 36;
const PEEK_INDEX_PROP = '_dtpPeekInitialIndex';
let headerHeight = 0;
let clipHeight = 0;
let alphaBg = 0;
let isLeftButtons = false;
let isTopHeader = true;
@@ -186,6 +187,7 @@ var PreviewMenu = Utils.defineClass({
if (!this.opened) {
this._refreshGlobals();
this.set_height(clipHeight);
this.menu.show();
setStyle(this.menu, 'background: ' + Utils.getrgbaColor(this.panel.dynamicTransparency.backgroundColorRgb, alphaBg));
@@ -296,6 +298,7 @@ var PreviewMenu = Utils.defineClass({
_resetHiddenState: function() {
this.menu.hide();
this.set_height(0);
this._setOpenedState(false);
this.menu.opacity = 0;
this.menu[this._translationProp] = this._translationOffset;
@@ -427,7 +430,7 @@ var PreviewMenu = Utils.defineClass({
},
_updateClip: function() {
let x, y, w, h;
let x, y, w;
let geom = this.panel.getGeometry();
let panelBoxTheme = this.panel.panelBox.get_theme_node();
let previewSize = (Me.settings.get_int('window-preview-size') +
@@ -435,11 +438,11 @@ var PreviewMenu = Utils.defineClass({
if (this.isVertical) {
w = previewSize;
h = this.panel.monitor.height;
clipHeight = this.panel.monitor.height;
y = this.panel.monitor.y;
} else {
w = this.panel.monitor.width;
h = (previewSize + headerHeight);
clipHeight = (previewSize + headerHeight);
x = this.panel.monitor.x;
}
@@ -453,7 +456,7 @@ var PreviewMenu = Utils.defineClass({
y = this.panel.monitor.y + this.panel.monitor.height - (Panel.size + panelBoxTheme.get_padding(St.Side.BOTTOM) + previewSize + headerHeight);
}
Utils.setClip(this, x, y, w, h);
Utils.setClip(this, x, y, w, clipHeight);
},
_updatePosition: function() {