-
-
Notifications
You must be signed in to change notification settings - Fork 866
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
[BUG] MacOS: Multitouch introduction causes issues (Flutter 3.3.0) #1354
Comments
Hi @JosefWN, |
Just added Flutter 3.3.0 support (in terms of the |
I've tested the gestures with the sample application on my MacBook M1 Pro:
I'm going to take a look at the clockwise rotation, I think you might already be able to customize the behavior with the provided properties but I guess it would be nice to have it implemented by default on MacOS. For the pinch to zoom on the mouse pointer I wonder if this behavior should be specific to MacOS or generalized to all desktop platforms (maybe web too). |
I didn't know that was possible on macOS? I've never been able to do it in any program on my Macbook Air M1, that is, in a single touch gesture (not two gestures), both zoom and rotate similarly to what you can do on iOS. New feature on the Macbook Pro's or some hidden setting somewhere? Yeah can you please send the video, I'm curious if we are talking about the same thing. I will dig out my old Macbook Pro as well just to see if something is wrong with my Macbook Air.
In my case I target macOS, Linux, Windows, iOS and Android... can become a lot of code duplicated over every library user's code base. I will try to make videos as well, showing the difference between how the same app acts on iPad (everything touch-related works since pre-Flutter 3.3.0) and macOS (multiple issues since Flutter 3.3.0). I could try re-installing Flutter before that, just for the heck of it, to make sure it's not my own install that's borked.
It would be nice (but for web I don't think you have any multitouch gestures?), and in line with how scroll to zoom works in |
Same on Macbook Pro 2017, just tried rotating and zooming in a combined gesture ("pinch and rotate") on a picture in Preview and it starts flickering, competing for either zoom or rotate. Could be good to be aware of this limitation on the touchpads if you've come to expect the functionality from iOS to carry over to macOS. Perhaps it's only the latest high-end laptops that support this, then. |
Not sure we are talking about the same thing, I can't clearly see the combined gesture in your video. This is what I'm talking about (example on iOS where it works): Pardon the low resolution, apparently Quick Time is not compressing too much so I had to go with a lower resolution. Coming videos will look better. But as I said, I think this is a touchpad limitation rather than an issue with Flutter. No other app seems to support this behavior on macOS either. Tested with Preview and Affinity Designer and neither seem to support "pinch and rotate" to both zoom and rotate at the same time.
Clarified the ticket with steps to reproduce and a screenshot. Running a fresh install of Flutter 3.3.0 and an untouched |
Example in this video:
test.mp4 |
Out of interest, does it all work correct in Google Maps ? |
I've tested Google Maps on MacOS with Google Chrome and the pinch to zoom is influenced by the mouse position. |
Pinch works for me but I've never gotten rotation touch gestures to work in the browser. On macOS The touchpad works correctly on Apple Maps (the macOS app), I haven't noticed any issues with |
I have tested a bit more throughly and updated the list in my initial post. I have also looked around online and found that although there is a JavaScript touch API supporting multitouch, it seems that more complex gestures have scarce support on the web, especially the twist gesture for rotations. Support also seems to be lacking in Safari, so multitouch in the browser on iPad for example is also limited (it seems pinch to zoom works in the browser but not pinch to rotate). For testing we might need to use native applications like Apple Maps on macOS, if we want to align with the native multitouch behavior and leverage multitouch fully, as opposed to comparing to Google Maps. Hopefully this is somewhat cross-platform too, so we only need one implementation to support multitouch trackpads on laptops. The touch issues are not major, but enough to be quite annoying to the user experience. If I manage I'll have a look at the touch code, but I have no experience working with touch, so I'd be happy if someone else beat me to it 😅 |
Just came here to confirm that the pinch rotate (and to a much lesser extent zoom as well) behavior feels pretty unnatural on Mac (esp the rotation bug). If anyone can point me to the relevant code, I'd be happy to take a look. I'm actually a bit new to Flutter dev, but have over 10 years of experience building macOS and iOS apps so I'd be happy to be a sounding board and contribute code or otherwise. |
Hi @ianthetechie. I can't point you to the code right now, but all help is appreciated! If you go into the |
@JaffaKetchup I fired up a good ol debug session and have a vague idea of what's up now... It looks like you're essentially using the Flutter stdlib scale gesture recognizer (small miracle this exists in essentially pure dart... that's on MASSIVE hunk of code!) and just taking the gesture rotation value from the events it generates, so this actually might be an upstream issue. I have a feeling nobody at Google cares about Mac or something. I'll go poke around there a bit more and maybe raise an issue upstream, but an hour or 2 of poking seems to indicate it might not be your problem. |
Bug thanks @ianthetechie :). Yeah, I'm not familiar with the gesture code, and you seem to be much more comfortable with it. I know we use positioned_tap_detector (maybe v2), maybe that's part of the problem? Not sure to be honest. But if you found for rotation that we're just using values from somewhere else and not modifying them in any way, that would certainly indicate an issue on their part. |
No worries. I've come up with an MRE demonstrating the issue using nothing but a super vanilla Flutter app and standard components, so the positioned tap detector isn't likely an issue here. I opened a discussion on the Flutter official discord. Unless someone tells me I'm stupid / "holding it wrong" I'll update you guys here once it's tracked there via a GitHub issue ;) |
Acknowledged by a Flutter dev, who just opened a PR: flutter/engine#36444. What a quick turnaround :D |
Hooray! Indeed a quick turnaround :) |
Side note here: We ran into this regression ourselves (lack of momentum unlike Apple Maps). To get the previous behaviour back (for anyone reading this) just revert flutter_map to v.2.2.0 and Flutter v3.0.5, which seems to work. Thanks for looking into this btw!! 👏 ❤️ |
Ok, the flutter/engine#36444 PR seems to have been merged, so it is either already available, or will be available soon. It seems like this is the root cause (please correct me if I am misunderstanding), so I will close this issue for now. Please ping me if you need it reopened! |
IMO there are still some follow-up tasks here. The upstream issue that was fixed (looks slated for release in 3.4) just fixes the problem with polarity being wrong, which was huge 😂 The "unnatural-ness" described (points 2-4) are still open bugs and I haven't yet had time to determine if they are issues with Once the upstream fix drops in stable, think (someone who knows the ecosystem better correct if I'm wrong) the resolution from the |
Hi @ianthetechie, in this case I will reopen. In terms of depending on the latest Flutter SDK, it should be ok? That is quite confusing in Flutter, as you've got the local Flutter versions that your machine can actually run, then every project has its own version bounds, but sometimes those are ignored. It should be ok, as 3.4 will be non breaking. |
Updated the issue with the current status :) |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
Can we disable the stale bot perhaps? Seems like more trouble than help... |
@JosefWN We can I think, but it helps to keep me on top of things when waiting for responses etc. |
It would probably be better to add an exception tag so the bot skips certain issues. I'll think about implementing that. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
@JosefWN I think the bottom two points are now fixed in 'master' for v4. Please confirm. In terms of the remaining point, I think that's more of an enhancement/feature addition than a bug. The 'animation' is known as the fling - and you're right that there is probably a threshold somewhere. But I think this is really low priority. If you can confirm that the bottom two points are resolved, I'll close this issue. |
This is still an issue I think, but the other point you mention seems to be solved! |
Hey @JosefWN, |
Hi, yes, this is still valid on latest Flutter/Dart/flutter_map/macOS. My guess is that we need to do something analogous to what we did for rotations? #1437 |
What is the bug?
With Flutter's new multitouch support extending to desktop, the default behavior in
flutter_map
on Flutter 3.3.0 is two finger pan/rotate and pinch to zoom. This is completely in line with the Apple Maps app on Mac for example.A couple of issues:
The panning threshold is a bit tight, so you need some speed when you two-finger swipe to get it to continue the panning as an animation. With slight movements there is no animation and the pan stops abruptly, which is not the case in the native Maps application on macOS for example.It seems like #1358 is also related to this umbrella issue (where a
resolutions
list is provided, there seems to be bound checks for other gestures like scroll to zoom, but not for pinch to zoom). Tracked in a separate ticket.Combined rotation and zoom in a single gesture (which works just fine on iPad) doesn't seem to work on Mac at all, neither with
flutter_map
nor Apple Maps, unless it's some setting I need to change on my end. Tried disabling some more complex multitouch gestures in the macOS settings to see if they could be interfering but that was not the case.As things stand right now I almost liked the old behavior (with scroll to zoom and click & drag to pan) a bit more, although that prevented me from rotating the map intuitively.
What is the expected behaviour?
Rotating clockwise with a touch gesture in Apple Maps or rotating images in Preview (macOS) rotates the canvas clockwise. The same goes for
flutter_map
built for iPad. It would make sense if it worked the same way on macOS.How can we reproduce this issue?
Run on macOS with a touchpad, try to rotate the canvas with a touch gesture.
Do you have a potential solution?
No response
Can you provide any other information?
Running
flutter_map
3.0.0-beta3 on M1 Macbook Air.Platforms Affected
MacOS
Severity
Minimum: Allows normal functioning
Frequency
Consistently: Always occurs at the same time and location
Requirements
flutter doctor
finds no relevant issuesEDIT by @JaffaKetchup: The second bullet point above is a low priority enhancement unrelated to the main issue, so that will be ignored for now. Please create a separate feature request for this, if still wanted.
The text was updated successfully, but these errors were encountered: