windowgestures icon indicating copy to clipboard operation
windowgestures copied to clipboard

About pinch implementation

Open YaQia opened this issue 2 years ago • 45 comments

I have tested it. Almost everything is great, but I can not let Show Desktop work. BTW it might be better to add some hint of Close Window, cause that might be an accidental touch.

YaQia avatar Oct 11 '23 02:10 YaQia

If I have an input box, Show Desktop will send a d into it.

YaQia avatar Oct 11 '23 02:10 YaQia

I got it. It is Super+d, which is not mapped in my distribution by default.

YaQia avatar Oct 11 '23 02:10 YaQia

I still find a way to add a hint indicator. Maybe adding red border into active window (close/minimize action).

You should test volume up/down. Try pinch then hold (don't release it directly)

amarullz avatar Oct 11 '23 06:10 amarullz

You should test volume up/down. Try pinch then hold (don't release it directly)

I tried it. The feature works properly.

YaQia avatar Oct 11 '23 06:10 YaQia

Screencast from 2023-10-12 09-28-17.webm

Implementing adaptive indicator. minimize, close, show desktop

amarullz avatar Oct 12 '23 02:10 amarullz

New Transition Implementation. 🤩🤩

Screencast from 2023-10-12 11-17-18.webm

amarullz avatar Oct 12 '23 04:10 amarullz

Update can be tested at 3-beta1 https://github.com/amarullz/windowgestures/releases/tag/3.0-beta1

amarullz avatar Oct 12 '23 04:10 amarullz

I have tested Close Window and Show Desktop, Close Window seems to reserve the red indicator, leaving a transparent red border (BTW I think red color could be brighter, meaning adding Green and Blue values). And I think it might be probably better to use APIs for those pinch actions rather than assuming the keyboard mapping is the same as other people.

YaQia avatar Oct 12 '23 05:10 YaQia

录屏 2023-10-12 13-40-22.webm

It turned some part of my screen red.

YaQia avatar Oct 12 '23 05:10 YaQia

Strange, it start to influence my topbar now. It is letting my topbar to be transparent (I have Blur My Shell).

YaQia avatar Oct 12 '23 06:10 YaQia

Strange, it start to influence my topbar now. It is letting my topbar to be transparent (I have Blur My Shell).

Maybe tint color should be implement differently. I don't have that problem btw

amarullz avatar Oct 12 '23 06:10 amarullz

I have tested Close Window and Show Desktop, Close Window seems to reserve the red indicator, leaving a transparent red border (BTW I think red color could be brighter, meaning adding Green and Blue values). And I think it might be probably better to use APIs for those pinch actions rather than assuming the keyboard mapping is the same as other people.

Yea, still search api for show desktop. I think I already know api for close window.

I will try all command call with api if I can find it.

amarullz avatar Oct 12 '23 13:10 amarullz

[email protected]

Add forward-back & Fix close tint indicator garbage (red) didn't cleanup.

amarullz avatar Oct 12 '23 15:10 amarullz

[email protected]

Add forward-back & Fix close tint indicator garbage (red) didn't cleanup.

I guess the red indicator window size is not set correctly. It seems to cover to the corner of my right bottom pixel of the screen. And the left up pixel is not aligned to the current window properly.

YaQia avatar Oct 12 '23 15:10 YaQia

[email protected] Add forward-back & Fix close tint indicator garbage (red) didn't cleanup.

I guess the red indicator window size is not set correctly. It seems to cover to the corner of my right bottom pixel of the screen. And the left up pixel is not aligned to the current window properly.

But it's didn't left the garbage indicator anymore right?

note: I also use Blur My Shell

Maybe I just need to drop the color overlay, I cannot find a more reliable window position from window actor object. Or find other solution. I don't want use shader effect.

amarullz avatar Oct 12 '23 15:10 amarullz

But it's didn't left the garbage indicator anymore right?

Yes, no garbage anymore.

Maybe I just need to drop the color overlay, I cannot find a more reliable window position from window actor object. Or find other solution. I don't want use shader effect.

I hope you will get the solution.

YaQia avatar Oct 13 '23 06:10 YaQia

I used shader in last commit. It work nicely. Also switch next/prev window

amarullz avatar Oct 13 '23 10:10 amarullz

Sounds good to me. Does that mean we can use the shader effect in minimize/maximize window as well?

YaQia avatar Oct 13 '23 14:10 YaQia

I just use basic shader for color manipulation, like change red proportion, make it brighter/dimmer, or lower saturation.

I don't think switch window need some change color indicator 😆.

amarullz avatar Oct 13 '23 14:10 amarullz

Screencast from 2023-10-13 21-55-38.webm

can you test it: [email protected]

Now next TODO (before submit ext):

  • Add swipe down (3 fingers)
  • Add swipe down left/right (3 fingers)
  • Remove unusable/shortcut-based actions
  • Move move-window to left/right workspace into action list
  • Configurable actions for:
    • Swipe down (3f)
    • Swipe down + left (3f)
    • Swipe down + right (3f)
    • Swipe left (4f)
    • Swipe right (4f)

So we will have alot of customizable gestures for different actions

amarullz avatar Oct 13 '23 15:10 amarullz

Wow, this is fantastic! I have tested pinch for next/previous window, which works perfectly well. (The only problem for me is that next window can only be effective on top 2 windows, but previous window can be triggered cyclically. Well, switch window with 3 fingers swiping is also a little strange for me. Switch to next window can only be triggered once, but previous window can be cyclically.) Currently I think there are 2 small bugs to be fixed:

  1. As shown in your video, Close Window has a blurry overview somehow (seems like using bitmap pooling calculation rather than using the same tech for Next Window).
  2. The swipe left/right to move workspace function is not able to be toggle now (tried not handling active window but not works as well).

YaQia avatar Oct 13 '23 16:10 YaQia

Wow, this is fantastic! I have tested pinch for next/previous window, which works perfectly well. (The only problem for me is that next window can only be effective on top 2 windows, but previous window can be triggered cyclically. Well, switch window with 3 fingers swiping is also a little strange for me. Switch to next window can only be triggered once, but previous window can be cyclically.) Currently I think there are 2 small bugs to be fixed:

There is 2 method to get list windows, list-all window & list windows stacking. Alt-Tab is using stacking, and change everytime active window changes. In this next/prev window I use stacking just like Alt-Tab, so when doing next it will change active window from index 0 to 1 but next call the current window is on index 0 and last active is on 1, so it's like switching window 😝, Its different when you do prev window because it will not mess with stacking change.

Try Alt+Tab once and release all keys, then do again Alt+Tab then release again all keys. Then try with Alt+Shift+Tab 😝

Maybe I will change Next-Window to Switch Window, and Next/Prev Window use non-stack-window list.

  1. As shown in your video, Close Window has a blurry overview somehow (seems like using bitmap pooling calculation rather than using the same tech for Next Window).

Nope, the problem was from Blur my Shell implementation. without this extension it works perfectly. I think blur my shell use widget layer method (just like my previous close tint color method) but placed behind the window. that layer is the one that process the blur, but I think it's not inside window container, when the window opacity changed it don't automatically transparent.

  1. The swipe left/right to move workspace function is not able to be toggle now (tried not handling active window but not works as well).

You mean the default swipe (3 fingers)?. can you list what extensions you use now?

I change show desktop transition like this btw:

Screencast from 2023-10-13 23-44-02.webm

amarullz avatar Oct 13 '23 17:10 amarullz

You mean the default swipe (3 fingers)?. can you list what extensions you use now?

Well, I am only using this plugin and AppIndicator and KStatusNotifierItem Support. I will test more to check out whether it is a misconfiguration.

YaQia avatar Oct 13 '23 17:10 YaQia

There is 2 method to get list windows, list-all window & list windows stacking. Alt-Tab is using stacking, and change everytime active window changes. In this next/prev window I use stacking just like Alt-Tab, so when doing next it will change active window from index 0 to 1 but next call the current window is on index 0 and last active is on 1, so it's like switching window 😝, Its different when you do prev window because it will not mess with stacking change.

I see, Alt+Tab swaps the second element and the first element of the stack, Alt+Shift+Tab pops up the first element and pushes it into the last one (this stack seems to be more like a circular queue rather than a stack 😯).

YaQia avatar Oct 13 '23 17:10 YaQia

I see, Alt+Tab swaps the second element and the first element of the stack, Alt+Shift+Tab pops up the first element and pushes it into the last one (this stack seems to be more like a circular queue rather than a stack 😯).

Try this for Next Window switch fix&tweaks: [email protected]

Basically the workaround is like this:

  • If you trigger and repeat next-window before 1 timeout, it will go to next window just like Alt+Tab multiple times without releasing Alt key.
  • If you trigger next-window wait 1 seconds, then trigger again, it will cycle to recently active window, just like Alt+Tab release Alt and Tab then press Alt+Tab again.

amarullz avatar Oct 13 '23 21:10 amarullz

Timeout duration will be configurable.

amarullz avatar Oct 13 '23 21:10 amarullz

Try beta3: https://github.com/amarullz/windowgestures/releases/tag/3.0-beta3

All features has been developed

Screenshot from 2023-10-16 18-27-11

amarullz avatar Oct 16 '23 11:10 amarullz

I am using it. Send window left/right seems not working properly. When I swipe left with 4 fingers in the far left workspace, Send window left leads me to the second left workspace and switches back to the far left workspace.

Like this: 录屏 2023-10-16 21-55-25.webm

YaQia avatar Oct 16 '23 13:10 YaQia

By the way, Close Window is still blurry without Blur my shell, which I'm not using currently. And Send window right will create workspaces for me, which is not expected as I have fixed my workspace number.

YaQia avatar Oct 16 '23 14:10 YaQia

By the way, Close Window is still blurry without Blur my shell, which I'm not using currently. And Send window right will create workspaces for me, which is not expected as I have fixed my workspace number.

Oh.. I will check for dynamic workspace. If it not dynamic it will not add any workspace.

For Close Window, I don't know about blur, but yes the quality is of text becoming pixelated (maybe due usage of shader), still trying alternative method.

amarullz avatar Oct 16 '23 14:10 amarullz