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

add built-in actions and animations #59

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft

add built-in actions and animations #59

wants to merge 12 commits into from

Conversation

taj-ny
Copy link
Owner

@taj-ny taj-ny commented Feb 5, 2025

2025-02-09.07-32-38.mp4

This adds the ability to create hard-coded actions, which can then be easily configured and assigned to a gesture, making animations possible.

For now the animation is just a simple rectangle overlay, like in other projects. Proper animations (like the close window animation in one of the comments) will be added in the future, as long as there are no conflicts with existing Plasma animations.

Current actions: drag, window_drag, window_fullscreen, window_maximize, window_minimize, window_restore, window_tile_left, window_tile_right

New properties

See the documentation for more information.

Root

animations

Animations (new)

duration, curve, overlay_color, overlay_opacity

Actions

builtin, animation, instant

Example

touchpad:
  gestures:
    - type: swipe
      fingers: 3
      direction: up
      
      actions:
        - builtin: window_maximize
        # animation: none
        # instant: true
          
        - builtin: window_fullscreen
        
    - type: swipe
      fingers: 4
      direction: any
      
      actions:
        - builtin: window_drag

To do

  • Transform overlay colorspace for HDR screens
  • Window animations that animate the window instead of drawing an overlay
  • Add ability to configure minimum and maximum deltas for animated gestures
  • Add actions: window_tile_up, window_tile_down
  • Respect global animation speed

@taj-ny
Copy link
Owner Author

taj-ny commented Feb 5, 2025

Proof of concept window maximization gesture:

2025-02-05.18-54-38.mp4

The gesture is cancelled if the minimum delta (not threshold) isn't reached and fingers are lifted, otherwise the gesture ends.

Right now it just resizes the window, but proper smooth animation will be added (if possible).

@taj-ny
Copy link
Owner Author

taj-ny commented Feb 6, 2025

First proper 1-to-1 gesture: close window

2025-02-06.18-56-59.mp4

Is that how it's supposed to work? I've never used those before.

@taj-ny
Copy link
Owner Author

taj-ny commented Feb 8, 2025

I'll probably just use an overlay like other projects instead, as scaling the window up (for maximize, fullscreen and tile gestures) looks really ugly.

2025-02-08.16-17-16.mp4

@taj-ny taj-ny changed the title add builtin actions add built-in gestures Feb 8, 2025
@subhasutra
Copy link

I personally liked the earlier one-to-one version of the gesture over the overlay one, in case you might keep it. And you are correct, most projects do have the overlay only, but it does feel like a hack unlike the real one-to-one gestures. It's all my opinion of course, and you have an amazing progress going on, so take it where you deem fit. Looking forward to the releases, just wanted to share my thoughts.

@taj-ny taj-ny changed the title add built-in gestures add built-in actions and animations Feb 9, 2025
@taj-ny
Copy link
Owner Author

taj-ny commented Feb 9, 2025

I'll try to add the proper animations as well then, although last time I tried there were conflicts with the normal maximize animation. Maybe there's a way to solve that.

…rent one

This fixes an issue where the overlay would be animated towards the wrong screen if the window was on multiple screens at once.
@taj-ny taj-ny added this to the v0.5.0 milestone Feb 9, 2025
@taj-ny
Copy link
Owner Author

taj-ny commented Feb 9, 2025

I found an easy way to suppress and override animations of other effects for a particular window, so conflicts won't be a problem.

@taj-ny
Copy link
Owner Author

taj-ny commented Feb 12, 2025

I combined window resizing and scaling for smoother animations even with applications that resize slowly.

2025-02-12.20-53-01.mp4
2025-02-12.20-54-56.mp4

@subhasutra
Copy link

The first one looks extremely smooth! Looking forward to test it out.

@taj-ny
Copy link
Owner Author

taj-ny commented Mar 1, 2025

Animations require more work than I though they would. I'll focus on functionality rather than fancy effects for a while, as there are a lot of things that need to be done.

@taj-ny taj-ny removed this from the v0.5.0 milestone Mar 1, 2025
@Covkie
Copy link

Covkie commented Mar 11, 2025

Would this eventually include the (currently) hard-coded progressive animations that 3 finger left/right virtual desktop switching or the 4 finger up/down overview have?

@taj-ny
Copy link
Owner Author

taj-ny commented Mar 12, 2025

Would this eventually include the (currently) hard-coded progressive animations that 3 finger left/right virtual desktop switching or the 4 finger up/down overview have?

It looks like the only way this plugin can control the progress of those animations is by simulating a touchpad swipe gesture. If I can get it to look good I'll add it eventually, probably after window animations.

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