Skip to content

Commit

Permalink
[[email protected]] Fix graphical artifacts using Mint20.1+ (#…
Browse files Browse the repository at this point in the history
…728)

I think will fix the graphical artifacts that this extension leaves behind when running on Mint 20.1+. I tested on Mint21 and I don't see any issues. Also fixed some exceptions I spotted in the xsession_errors file.
  • Loading branch information
klangman authored Sep 7, 2024
1 parent b12af45 commit dfb8a5c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions [email protected]/files/[email protected]/extension.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const Lang = imports.lang;
const Clutter = imports.gi.Clutter;
const Settings = imports.ui.settings;
const Meta = imports.gi.Meta;

const GRID_WIDTH = 4;
const GRID_HEIGHT = 4;
Expand Down Expand Up @@ -296,6 +297,7 @@ const WobblyWindowEffect = new Lang.Class({
let actor = this.get_actor();
if(actor)
actor.remove_effect(this);
Meta.remove_clutter_debug_flags( 0, 1 << 6, 0 ); // CLUTTER_DEBUG_CONTINUOUS_REDRAW
},

_newFrame: function() {
Expand Down Expand Up @@ -386,14 +388,18 @@ let _beginGrabOpId;
let _endGrabOpId;

function onBeginGrabOp(display, screen, window, op) {
let actor = window.get_compositor_private();
let actor = (window) ? window.get_compositor_private() : null;
if (actor) {
let effect;
effect = actor.get_effect('wobbly');
if (!effect) {
effect =
new WobblyWindowEffect({
x_tiles: settings.gridRes, y_tiles: settings.gridRes });
// This is a workaround for issue of leaving window artifacts when animating,
// we enable it only during the animation sequence so users don't need to set
// it using export CLUTTER_PAINT...
Meta.add_clutter_debug_flags( 0, 1 << 6, 0 ); // CLUTTER_DEBUG_CONTINUOUS_REDRAW
actor.add_effect_with_name('wobbly', effect);
}

Expand All @@ -403,7 +409,7 @@ function onBeginGrabOp(display, screen, window, op) {
}

function onEndGrabOp(display, screen, window, op) {
let actor = window.get_compositor_private();
let actor = (window) ? window.get_compositor_private() : null;
if(actor) {
let effect = actor.get_effect('wobbly');
if (effect)
Expand Down

0 comments on commit dfb8a5c

Please sign in to comment.