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

[Feature Request] Snap Assistant not showing on touch devices #82

Closed
palexdev opened this issue Jul 9, 2024 · 12 comments
Closed

[Feature Request] Snap Assistant not showing on touch devices #82

palexdev opened this issue Jul 9, 2024 · 12 comments
Labels
enhancement New feature or request next release

Comments

@palexdev
Copy link

palexdev commented Jul 9, 2024

Describe the bug
The Snap Assistant popup does not show (not properly at least) when using touchscreens

To Reproduce

  1. You need a touchscreen
  2. Drag a window
  3. Observe that the Snap Assistant popup is not shown properly

Screenshots
https://github.com/domferr/tilingshell/assets/16880178/b0553d1e-e4e3-458a-aee8-6e1dd43650db

Information (please complete the following):

  • Tiling Shell version: v11.0
  • GNOME version: 46.3.1

Additional context
The device I'm experiencing the issue on is an Android tablet that I modded to use Linux. I have a bluetooth keyboard, and as you can see in the video (when the cursor appears I'm using the keyboard's trackpad) it works properly with it.
Let me know if you need logs or anything else and how to collect them

@domferr
Copy link
Owner

domferr commented Jul 9, 2024

Hey @palexdev thank you for sharing this! I didn't test Tiling Shell on touch devices, but thanks to you we can assume that it does not work ahaha. I'm looking to add this feature! Hope to give you an update soon 🥳

@domferr domferr added the enhancement New feature or request label Jul 9, 2024
@domferr domferr changed the title Snap Assistant not showing [Feature Request] Snap Assistant not showing on touch devices Jul 9, 2024
@palexdev
Copy link
Author

palexdev commented Jul 9, 2024

Thank you very much @domferr your awesome extension is the last piece to complete my setup, looking forward to it 😄

@domferr
Copy link
Owner

domferr commented Jul 11, 2024

Hey @palexdev I'm writing to give you a quick update. I hoped to implement this in few days and after some research it turned out that GNOME doesn't provide to extensions a way to know the touch position while moving the window. I'm looking into ask them 😉 and I'll tell you whether this is doable or not!

@palexdev
Copy link
Author

palexdev commented Jul 11, 2024

@domferr Thanks for the update 👍🏻
May I ask a question, how does it work?

Like, I don't understand why there's a difference between moue and touch gestures (in the context of tilingshell of course) and how does it affect the Snap Assistant.

In my head the system works as follows:

  1. Detect window drag
  2. Display the Snap Assistant on the window's monitor (or all monitors). The popup's position does not depend on the event or window position, but rather on the monitor's geometry
  3. Detect window on one of the layouts and position on drop

Of course I know it's much more complicated, but I'm curious to know what is happening behind the scenes

@domferr
Copy link
Owner

domferr commented Jul 11, 2024

Yeah, and I use the mouse pointer position to show or hide the snap assistant and to detect which snap assistant's tile is hovered by the mouse.

The problem here is that GNOME provides a way to know at any time the mouse pointer position, but touch events don't move the mouse pointer and GNOME doesn't provide a way to know the last touch position.

I have tried to listen to touch events: they get fired correctly but as soon as you start grabbing a window the touch events are got by the window and not propagated to anything else

The window position is itself a good thing to use to understand whether or not the snap assistant is shown, but it's not useful to solve the second problem 😕

However...I have a workaround in mind, which is complicated but at least we have a solution:

  • I can get the touch position in a hacky way when the window starts to be dragged
  • I can assume that if the window moved by X and Y pixels, the person touching the window moved its finger by the same amount

That won't work well when the window is moved to the edges, since my assumption may be wrong

@palexdev
Copy link
Author

palexdev commented Jul 11, 2024

Ah yes I see the problem now

It's a bit sad considering that GNOME is one of the best environments when it comes to touch support.
Edit: yet, proper touch support in Linux has still a long way to go. I recently had to ditch both VSCode and Zed in favor of Sublime Text because the latter works a little better on touchscreens, but many things still don't work (e.g. long press to open context menus)

The workaround could work in theory. I don't know the behavior at the edges, but I think the major issue is going to be precision. Still better than nothing though

@domferr
Copy link
Owner

domferr commented Jul 11, 2024

Hey @palexdev I've got very good news for you 😄

I implemented my workaround and it seems to work on my touch device! Please consider it is a rough version, test it for a while if you can and let me know of any bug or missing features!

- GNOME 42, 43 and 44: GNOME.42-44.tilingshell@ferrarodomenico.com.zip
- GNOME 45 and 46: tilingshell@ferrarodomenico.com.zip
Edit: this version is now outdated, there is a new one with bugfixes below.


If you don't know how to install, here it is a little guide for you. You need to perform the following steps: overwrite the files into .local/share/gnome-shell/extensions/tilingshell@ferrarodomenico.com with the ones in the archive I shared, then log out and log in (or restart the system).

@domferr
Copy link
Owner

domferr commented Jul 11, 2024

Another update, with bugs fixed. It seems to work, but some everyday testing is still needed. I'll leave here the updated version, with touch support!

@domferr
Copy link
Owner

domferr commented Jul 21, 2024

Touch support is now available on Tiling Shell! ⭐

@domferr domferr closed this as completed Jul 21, 2024
@palexdev
Copy link
Author

@domferr hello, sorry for not reporting back sooner, it's been a very busy week
The new version indeed fixes the snap assistant, but it's still buggy on my device
Here's a video: https://github.com/user-attachments/assets/99b62405-5e55-414d-9a41-f70bf53954f1

As you can see, two issues:

  1. Precision at edges is not great (I can live with that tbh)
  2. The snap assistant does not place windows as intended, this is a major issue

@domferr
Copy link
Owner

domferr commented Jul 21, 2024

Hey thank you for the video. I'm curious: does it happen with apps that need on-screen keyboard only?

Can you confirm that the highlighted tile of the snap assistant is the right one (the one under your finger)?

@domferr
Copy link
Owner

domferr commented Jul 22, 2024

A quick update: it seems a bug of the latest version (#99).

I'm publishing a bugfix for that which will solve yours as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request next release
Projects
None yet
Development

No branches or pull requests

2 participants