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

Smart-panel DesktopCube Flipper: work together #776

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

claudiux
Copy link
Member

@claudiux claudiux commented Nov 23, 2024

MAINTAINERS:

TODO:

  • Do the same for Cinnamon version < 5.4.

  • Fix this type of error using Flipper (even without smart-panel):

(cinnamon:3019): GLib-GObject-CRITICAL **: 00:39:17.053: value "256" of type 'guint' is invalid or out of range for property 'opacity' of type 'guint'

@claudiux claudiux marked this pull request as draft November 23, 2024 00:05
@claudiux
Copy link
Member Author

Hi @klangman

The error value "256" of type 'guint' is invalid or out of range for property 'opacity' of type 'guint' doesn't appear when fade is set to 0.

Do you know of a solution?

@claudiux
Copy link
Member Author

@klangman I've fixed these errors but the method is a bit brutal.

@klangman
Copy link
Contributor

I had noticed the error, but I hadn't put much time into figuring out the cause of it. On the surface it seemed impossible to me since the math didn't seem to allow for a number above 255. My plan was to spend some time on Flipper sometime soon in order to apply enhancement similar to what I just applied to DesktopCube a few days back.

I guess the issue was some floating-point rounding?

@claudiux
Copy link
Member Author

If 0.0 <= x <= 1.0 then:
0.0 <= 1 - x <= 1.0,
0.0 <= (1 - x) * 255 <= 255.0,
0 <= parseInt((1 - x) * 255) <= 255.

Hmm, maybe write 1.0 and 255.0 instead of 1 and 255, in parenthesis.
I'll test that.

@claudiux
Copy link
Member Author

claudiux commented Nov 24, 2024

@klangman Test performed. It still does not work, even replacing parseInt with Math.floor.

@klangman
Copy link
Contributor

I added some logging and the messages are not occurring during tweening where flipper is setting the opacity value. Now I will put some debuging logs after other tweening to see which one is causing the messages.

@claudiux
Copy link
Member Author

claudiux commented Nov 26, 2024

I've only encountered these errors when using CUBE.

@klangman
Copy link
Contributor

I've only encountered these errors when using CUBE.

That's odd, I only see these messages when using Flipper, not with Desktop Cube.

@klangman
Copy link
Contributor

Unless you are saying that you only see the messages when using the Cube effect option in Flipper?

@claudiux
Copy link
Member Author

YES: There are error messages.
---: Not tested at this moment. (I'll do all that soon.)

Transition Easing Cube Deck Flip Pop Rolodex Slide Stack
Back YES YES YES YES YES YES YES
Bounce NO --- --- --- --- --- ---
Circ NO --- --- --- --- --- ---
Cubic NO --- --- --- --- --- ---
Cubic-Back YES --- --- --- --- --- ---
Cubic-Bounce NO --- --- --- --- --- ---
Cubic-Elastic YES --- --- --- --- --- ---
Elastic YES --- --- --- --- --- ---
Expo NO --- --- --- --- --- ---
Sine NO --- --- --- --- --- ---
Quad NO --- --- --- --- --- ---
Quart NO --- --- --- --- --- ---
Quint NO --- --- --- --- --- ---

@klangman
Copy link
Contributor

I think the problem is caused by the easing going beyond the limit set by the tweening target value. When using "Back" or "Elastic" the easing is going to be beyond the target value then come back to the target value to produce the easing effect. When tweening the opacity it doesn't make sense to use "Back" or "Elastic" because you can't be more than 100% opaque or less than 0% opaque. I think the solution might be to use a separate tweener for the opacity that uses a transition of "easeNone".

@klangman
Copy link
Contributor

Yep. Tested it. That solved it.

@claudiux
Copy link
Member Author

claudiux commented Nov 27, 2024

@klangman Great! How do you go about it? Do you create your own PR or do you make one on this code?
I can also remove anything to do with Flipper from this PR.

@klangman
Copy link
Contributor

I guess the easiest for everyone would be for me to create my own PR?

@rcalixte
Copy link
Member

I guess the easiest for everyone would be for me to create my own PR?

At this point, it's probably the cleanest route. Feel free to open when you're ready!

@rcalixte rcalixte closed this Nov 27, 2024
@klangman
Copy link
Contributor

I think there is still code here for smart-panel that should be merged? Should it have been closed?

@rcalixte rcalixte reopened this Nov 27, 2024
@rcalixte
Copy link
Member

I think there is still code here for smart-panel that should be merged? Should it have been closed?

I thought two clean PRs would be the path forward here so that it would be easier to keep track of things.

@klangman
Copy link
Contributor

I thought two clean PRs would be the path forward here so that it would be easier to keep track of things.

Oh.. OK.. Makes sense, I guess @claudiux can decide how he want's to do it.

@claudiux
Copy link
Member Author

claudiux commented Nov 27, 2024

@klangman I agree. I'll make a PR for smart-panel after you make your own PR.

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

Successfully merging this pull request may close these issues.

3 participants