Fix new window handling in gnome shell version 3.28 to 3.32

The opacity hack does not work in 3.32 and less. In fact setting opacity on
`queue-redraw` can kill a windows visibility entirely for some reason. The
windowactor property are fine, but the actor still doesn't show up.

So lets just kludge this for compatibility :P

fixes #184
This commit is contained in:
Tor Hedin Brønner
2019-10-14 16:55:29 +02:00
parent 4b1c8264c0
commit 076cbb655e
2 changed files with 19 additions and 12 deletions
+18 -11
View File
@@ -1758,18 +1758,22 @@ class Spaces extends Map {
debug('window-created', metaWindow.title);
let actor = metaWindow.get_compositor_private();
/* HACK 3.34: Hidden actors aren't allocated if hidden, use opacity instead to fix
new window animations.
if (utils.version[1] < 34) {
animateWindow(metaWindow);
} else {
/* HACK 3.34: Hidden actors aren't allocated if hidden, use opacity
instead to fix new window animations.
The first draw will reset the opacity it seems (but not visible). So
even if we set it again in `first-frame` that is too late since that
happens _after_ mutter have drawn the frame.
The first draw will reset the opacity it seems (but not visible).
So even if we set it again in `first-frame` that is too late
since that happens _after_ mutter have drawn the frame.
So we kill visibily on the first the `queue-redraw`.
*/
signals.connectOneShot(actor, 'queue-redraw', () => {
actor.opacity = 0;
});
So we kill visibily on the first the `queue-redraw`.
*/
signals.connectOneShot(actor, 'queue-redraw', () => {
actor.opacity = 0;
});
}
/*
We need reliable `window_type`, `wm_class` et. all to handle window insertion correctly.
@@ -2450,7 +2454,10 @@ function showHandler(actor) {
// HACK: use opacity instead of hidden on new windows
if (metaWindow.unmapped) {
actor.opacity = 0;
if (utils.version[1] < 34)
animateWindow(metaWindow);
else
actor.opacity = 0;
return;
}
+1 -1
View File
@@ -14,8 +14,8 @@ var display = global.display;
var GObject = imports.gi.GObject;
var registerClass;
var version = imports.misc.config.PACKAGE_VERSION.split('.').map(Number);
{
let version = imports.misc.config.PACKAGE_VERSION.split('.');
if (version[0] >= 3 && version[1] > 30) {
registerClass = GObject.registerClass;
} else {