-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
Animation PR #1032
Animation PR #1032
Conversation
is @FT-Labs ok with «borrowing» his work? i thought he’ll eventually consider his fork stable and make a pull request himself. |
Hum, |
i’ve already poked him with a mention. let’s see what he’ll say and if he’s ok with this, i’ll start reviewing. for now you can (actually must, if you want this to be merged) fix all ci’s failures (until ci’s failing for unknown reasons). |
Thank you! |
you may want to draft this pull request if there’s still work to be done. |
So it depends, technically it's ready for review... but I know the review will not pass at least for items I wrote, but for those remaining I need some assistance to make it clean, it works, but not everything with the general style. I already cleaned my code, the remaining bits are mistakes or lack of competence/knowledge in this programming type. I didn't even know draft pull requests were added actually, what is the advantage ? (I can update my commits as well in a normal PR isn't it ?) |
ok, let’s postpone any fixes while waiting for @FT-Labs reply to prevent wasting of at least your time. draft pull requests basically indicate that there’s still work to be done and they can’t be merged. i usually make my pull requests draft when they’re technically ready for review or merging, but i still want/need to fix something. it’s optional, though. |
Hey guys just saw this. I am open for anyone wants to help, but there is some work to do. i) Shadows needs to be fixed I'm working on it too, just too busy these days. Once these problems are solved, it will be good to go. |
Thank you for the quick feedback & amazing work!
I had time & motivation for a week, I can't commit for the future but I'ld like to see better animations on picom and willing to help. |
It also fails on the same test (299) on my computer, with or without my PR, on similar check but even earlier... (line 77). |
Codecov Report
@@ Coverage Diff @@
## next #1032 +/- ##
==========================================
- Coverage 37.82% 36.37% -1.46%
==========================================
Files 48 48
Lines 10844 11368 +524
==========================================
+ Hits 4102 4135 +33
- Misses 6742 7233 +491
|
I pushed a style fix and the test 299 is passing now (but still not locally). |
fyi, to fix the style quickly you’re supposed to use |
I had the same idea but unfortunately I have to undo many chunks which are not supposed to be in the PR... so in the end it turned to be more time consuming. Adding such rules late makes things a bit more tricky... |
bump? |
It would be great if someone can check this with different window managers! Thanks |
also cc @dccsillag and @Arian8j2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really good animation system, good job, things i think is missing:
- add commands and descriptions to
man
docs - add examples to
picom.sample.conf
- animation rule (like opacity rule), eg: can declare specific open animation for apps that match a rule
also it has some bugs with my setup with dwm
and multiple monitors, windows in second monitor will come all the way from first monitor to second, tried animation-extra-desktops
but it didn't help it
@@ -40,6 +40,24 @@ enum backend { | |||
NUM_BKEND, | |||
}; | |||
|
|||
enum open_window_animation { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imo window_animation
is more suited name
{"animation-for-transient-window", required_argument, 811, NULL , "Set animation for transient (child) windows."}, | ||
// blacklist ?? | ||
{"animation-for-tag-change", required_argument , 813, NULL , "Set animation for switching desktops."}, | ||
{"animation-extra-desktops", required_argument , 814, NULL , "N desktops will not be considered as standard desktops (useful for some window managers)."}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no command for --animation-for-unmap-window
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, it's always the "mirror" animation of the "open".
if (animation == OPEN_WINDOW_ANIMATION_INVALID) { | ||
if (transient_window) { | ||
int16_t mx, my; | ||
animation = OPEN_WINDOW_ANIMATION_SLIDE_DOWN; //ps->o.animation_for_transient_window; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opps 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is on purpose, I couldn't decide, I left what I liked the most as the code but it's quite opinionated so I left the more boring but less debatable way in comments ;)
animation = OPEN_WINDOW_ANIMATION_SLIDE_DOWN; //ps->o.animation_for_transient_window; | ||
if (get_mouse_position(ps, &mx, &my)) { | ||
if (my >= (randr_mon_center_y*2) - w->pending_g.height) { | ||
animation = OPEN_WINDOW_ANIMATION_SLIDE_UP; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, same purpose... I really like those animations but maybe it breaks on some toolkits / WM so I left the boring way in comments.
/// Whether to clamp animations | ||
bool animation_clamping; | ||
/// Animation blacklist. A linked list of conditions. | ||
c2_lptr_t *animation_blacklist; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
animation_exclude
is more suitable
{"animation-dampening" , required_argument, 807, NULL , "Animation dampening ratio (spring dampening as an example)."}, | ||
{"animation-window-mass" , required_argument, 808, NULL , "Animation window mass (lower mass makes animations bumpy)."}, | ||
{"animation-clamping" , no_argument , 809, NULL , "Enable/disable animation clamping. Disabling increases performance"}, | ||
{"animation-for-open-window" , required_argument, 810, NULL , "Set animation for opening window (Check sample.conf for options)."}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is sample.conf
😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I switched to hyprland in the meantime and quite happy with it so I'm not sure I'll spend a lot of time on this PR, I can do some tiny things but maybe not more... note that most of the code isn't from me, I just simplified some of the code and added a couple of things after fixing it for my own use case.
Looks like FTLabs made another branch which could be worth checking: https://github.com/FT-Labs/picom/tree/generalanimation
Hey guys, I'll try to implement your ideas after all bug's are resolved |
It seems like the right approach should just be to get SOMETHING merged, and then iterate from there. |
Also, can anyone weigh in on what the status of this PR is vs #772? Are they just completely unrelated attempts to add animations? Leaving outstanding PRs like this forever that don't get merged is bad for the community, IMO. |
This PR is further work on top of what was done on #772. I haven't been able to check all of the differences between them, though. |
@dccsillag weird are you sure? I don't see of the original commits from #772 in here. |
I can't confirm for sure, but I struggled to take over FT-lab's code and rebase it on Picom because it was mostly "hard to track" merges, so it's possible. And I probably didn't help as well, with my own "mega patch"... so it's quite likely the history is messed up. In short, my PR doesn't keep FTlab's history and focused on making code compatible with Picom's upstream, dealing with the history of FTlab wasn't easy (without making a huge fake merge) so I just mentioned it in github to keep track of it. Check FTlab's fork to know more about the history, you can assume my branch was 100% in sync with FTlab's when this PR was made (in case you need to check commit dates). |
But I had already noted that. I looked at @FT-Labs 's code and I think it also does not include @dccsillag 's original commits either. git was designed to work in a distributed fashion. Kind of frustrating that people are just taking code without having the original commits/attribution, and it also can land you in legal trouble eventually. |
@FT-Labs is it worth it for me to attempt a merge of your current generalanimation branch? |
I fully agree, but once the mess is done it's very hard to clean, especially when you are not the author... if I could have done a better job starting from this state please share some hints. It already took me quite some time with the indentation changes etc which were not kept in history so in the end I decided to trash the fork history. |
Borrowed most of the code from FTLabs which was the only one I found without graphical glitches.
Some of the code couldn't be made clean, reusing the current APIs, with some hints I can fix it.
It supports:
This could eventually cover #635 and #217
Most of the code is from FTLabs' fork, I mostly changed some structures & the win.c file.