Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rnbdsh@negateWindow : fills .xsession-errors with 100+ MB of warnings per day #445

Open
stephan-dev opened this issue Jan 7, 2023 · 9 comments

Comments

@stephan-dev
Copy link

stephan-dev commented Jan 7, 2023

Hi @rnbwdsh, I love this extension which I'm using daily. I'm on old Mint 19.3 LTS (still supported until April 2023). After a long enquiry, I found that Negate Windows was probably the reason why I have hundreds of MB of .xsession-errors logs. 33 times per second, I get this,

Cjs-Message: JS WARNING: [resource:///org/cinnamon/cjs/modules/_legacy.js 39]: Too many arguments to method Clutter.OffscreenEffect.paint_target: expected 0, got 1

 * NegateWindow v 0.02
 * Cinnamon v 4.4.8
 * Mint v 19.3

Steps to reproduce

  • restart cinnamon
  • open a terminal, tail -f ~/.xsession-errors
  • Super+I (on the terminal itself, as easiest example)

=> on my machine, the Warning quoted above appears immediately, 33 times per second.
Apart from these warnings, I didn't notice any other problem, extension works as expected.
I don't know when the problem started, but I've had this crowded logs problem for months.

Before finding the reason why I had these warnings, I found this : https://developer-old.gnome.org/clutter/stable/ClutterOffscreenEffect.html#clutter-offscreen-effect-paint-target. (might be useful for someone who understands this, which I don't)
I don't know why the warning says "expected 0 arguments", but this documentation says clutter_offscreen_effect_paint_target () takes 1 argument : effect.

@ghost
Copy link

ghost commented Jan 8, 2023

Just tested. Doesn't happen in Mint 19.2 (Cinnamon 4.2.4). Could be a bug or an intentional change in later Cinnamon.

@stephan-dev
Copy link
Author

Interesting, thanks for testing.

@rnbwdsh
Copy link
Contributor

rnbwdsh commented Jan 8, 2023

Hi. Thanks for reporting!

The update from 0.01 to 0.02 was done, because clutter (the underlying window composer framework, the cinnamon-version of gnomes mutter) added a parameter to a paint function - this sounds very related to your problem.

I guess this wasn't fully LTS-backwards-compatible and I also don't think cinnamon-spices are designed to provide different extensions for different versions (no expert here, I just ported over the gnome extension).

A possible solution could be:

  • Try the old 0.01 version from before the change - your local spices should be at ~/.local/share/cinnamon/extensions/ -> just copy paste the old extension.js over your existing one - this should already fix it for you

I'd just wrap it in a if(version.major <= 4 and version.minor <=...) to fix it permanently. But it seems, as older versions are fine again? Or it's a clutter version issue.

@Drugwash2 @stephan-dev what's your clutter versions?

@ghost
Copy link

ghost commented Jan 8, 2023

Not sure which clutter library exactly might be at stake here so here's what I found in Synaptic that relates to that name:

  • gir1.2-clutter-1.0 v1.26.2+dfsg-4
  • gir1.2-gtkclutter-1.0 v1.8.4-3
  • libclutter-1.0-0 v1.26.2+dfsg-4
  • libclutter-gtk-1.0-0 v1.8.4-3

There are also a couple of GStreamer-related clutter libraries but I suspect those are not important to the issue at hand.

As far as I can see the versions in 19.2 (Cinnamon 4.2.4) are identical to a 19.3 Mint (Cinnamon 4.4.8) that I am now running in Virtual Box and which exhibits the same behavior reported by the OP.

By the way, I'm running the same v0.02 of this extension on both Mint 19.2 and 19.3.
The problem is most likely in Cinnamon's compiled code as per the warning message ( /org/cinnamon/cjs/modules/_legacy.js ).

Spices can use different code for different Cinnamon versions, just put each extension.js in separate folders named after the Cinnamon version targeted by them, i.e. a folder named 2.8 for Cinnamon 2.8 to 4.2 and a folder named 4.4 for Cinnamon 4.4 and later. EDIT: and add "multiversion": true to metadata.json.

However, what I suspect happening here is that Cinnamon lower than 4.4 is silently discarding the function parameter while 4.4 and later - until the version that actually requires it - throw a warning, so the best approach is to use the old v0.01 code for Cinnamon 2.8 to 4.4 (or whatever is the latest that doesn't require a function parameter) and the v0.02 code for all later Cinnamon versions.
Whether Cinnamon and Clutter versions are in sync or not regarding this extra parameter requirement - this is a different matter.

@stephan-dev
Copy link
Author

Not sure if I have more to add. How do I get my clutter version ? I did an apt policy inspired by Drugwash2's indications. I have the same versions 1.8.4-3.
Thanks rnbwdsh for looking into this. I have tried to roll back to 0.01, following your indications, and it fixes that warnings flood ! That was it.
That's cool, I was back to black everywhere. I especially like how I can choose one instance of a GUI program and make it bright, that's a quick visual hint.

@JosephMcc
Copy link
Contributor

Just a heads up, Cinnamon/muffin has it's own inbuilt version of Clutter/Cogl nowadays. It's no longer even maintained upstream as a separate thing. I think that change happened around Cinnamon 4.0 and probably more changes came when the rebase on upstream Mutter happened.

@ghost
Copy link

ghost commented Jan 8, 2023

@JosephMcc : Any pointers on where exactly to find proper documentation pertaining to such implementations in each specific Cinnamon version? Other than manually combing through the Cinnamon code, of course.

@JosephMcc
Copy link
Contributor

For Cinnamon you can install the cinnamon-doc package that can be used with devhelp. It helps some but for Muffin there is no longer a doc package. It was lost in the rebase on Mutter. There is still a bit older version of muffin-doc available in the repos but I believe it will be a bit out of date at this point. For things like Clutter the best way is really just looking at the header files in Muffins source. At least as far as I know.

@ghost
Copy link

ghost commented Jan 8, 2023

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants