amarullz / windowgestures

GNOME Extension to Manage window with touchpad gestures
https://amarullz.com/
GNU General Public License v2.0
55 stars 10 forks source link

About pinch implementation #4

Open YaQia opened 11 months ago

YaQia commented 11 months ago

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 commented 11 months ago

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

YaQia commented 11 months ago

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

amarullz commented 11 months ago

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)

YaQia commented 11 months ago

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

I tried it. The feature works properly.

amarullz commented 11 months ago

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

Implementing adaptive indicator. minimize, close, show desktop

amarullz commented 11 months ago

New Transition Implementation. 🤩🤩

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

amarullz commented 11 months ago

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

YaQia commented 11 months ago

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 commented 11 months ago

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

It turned some part of my screen red.

YaQia commented 11 months ago

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

amarullz commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

windowgestures@extension.amarullz.com.zip

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

YaQia commented 11 months ago

windowgestures@extension.amarullz.com.zip

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.

amarullz commented 11 months ago

windowgestures@extension.amarullz.com.zip 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.

YaQia commented 11 months ago

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.

amarullz commented 11 months ago

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

YaQia commented 11 months ago

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

amarullz commented 11 months ago

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 commented 11 months ago

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

can you test it: windowgestures@extension.amarullz.com.zip

Now next TODO (before submit ext):

So we will have alot of customizable gestures for different actions

YaQia commented 11 months ago

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).
amarullz commented 11 months ago

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

YaQia commented 11 months ago

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 commented 11 months ago

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 😯).

amarullz commented 11 months ago

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: windowgestures@extension.amarullz.com.zip

Basically the workaround is like this:

amarullz commented 11 months ago

Timeout duration will be configurable.

amarullz commented 11 months ago

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

YaQia commented 11 months ago

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 commented 11 months ago

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.

amarullz commented 11 months ago

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.

YaQia commented 11 months ago

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.

Oh sorry, I might misunderstood you once again. It is becoming pixelated actually.

YaQia commented 11 months ago

I saw you are binding swipe up > down(4 fingers) with Minimize window. I think if we use swipe down(4 fingers) to be minimize window will be better? The move window gesture could be a double tap with 3 fingers instead.

amarullz commented 11 months ago

I saw you are binding swipe up > down(4 fingers) with Minimize window. I think if we use swipe down(4 fingers) to be minimize window will be better? The move window gesture could be a double tap with 3 fingers instead.

nice ide

YaQia commented 11 months ago

It might be confusing about my last comment. I expect 3 fingers swipe down to be minimize window, which is more intuitive. And I am using Switch 3 and 4 fingers, which means I need a config menu for swipe down(4 fingers).

amarullz commented 11 months ago

I know what you mean. swipe up-down is only in 4-fingers (if not swapped), 3finger is down-up, and you also mention move window

YaQia commented 11 months ago

BTW, currently some 3 fingers gestures are fixed with 3 fingers (like pinch), maybe a hint for that is more user-friendly.

amarullz commented 11 months ago

BTW, currently some 3 fingers gestures are fixed with 3 fingers (like pinch), maybe a hint for that is more user-friendly.

Maybe I need to dynamically change settings title when Swap 3 fingers changed (still lower priority than implement double tap move).

amarullz commented 11 months ago

The only possible way is tap (4/3 finger) hold then move, there is no tap events for 3/4 fingers (except maybe capturing system wide touchpad)

amarullz commented 11 months ago

Can you test this version? windowgestures@extension.amarullz.com.zip

Changes:

Screenshot from 2023-10-17 00-43-08

YaQia commented 11 months ago

Love it! Probably no hint for moving window with 3 fingers tap and hold when the window is maximized would be better, because the maximized window can not be moved anymore.

amarullz commented 11 months ago

Love it! Probably no hint for moving window with 3 fingers tap and hold when the window is maximized would be better, because the maximized window can not be moved anymore.

Fixed: windowgestures@extension.amarullz.com.zip

Also I added window list indicator

Screencast from 2023-10-18 06-33-50.webm

YaQia commented 11 months ago

Currently Enable maximized window snap toggle is not working properly. I have disabled it but I can still do that. And this window list indicator is too small to me (200% scaling).

amarullz commented 11 months ago

hmm. when I try 200% or other scaling, the UI is also scaled, Maybe I set the scale different from yours? I change it in display settings.

I want to reproduce your problem so I can think how to fix it.

And about snap, you mean the snap/maximize preview? (The transition is not as smooth like before -- it's hide the preview first before showing the next preview), if you mean about it I know how to fix it and already have a plan to fix it.

But I am still on vacation 🤩🏖️

amarullz commented 11 months ago

Fix Enable maximized window snap glitch https://github.com/amarullz/windowgestures/commit/2473192d5791fabc5a3a6c7e4ec83a7c93f61bb8

windowgestures@extension.amarullz.com.zip

YaQia commented 11 months ago

For me the UI is way too small, if I use 300%, it will get as small as a pixel. 录屏 2023-11-06 09-51-22.webm