-
Notifications
You must be signed in to change notification settings - Fork 9
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 BlockingToolbar #43
base: master
Are you sure you want to change the base?
Conversation
Thanks. I will review this PR soon. |
I don’t fully understand the behavior of the blocking toolbar. It seems like it blocks double clicks from zooming the window when the right side of the window’s toolbar is double-clicked, while still triggering the zooming when the left side of the window is clicked. It doesn’t seem to check if a Flutter widget is blocking the toolbar from being clicked. Unless I’m misunderstanding something, I don’t think this solves the linked issue. Ideally, there would be some way to check if a Flutter widget obstructs the toolbar at the clicked position, such that the clicks only get blocked when an actual widget is being clicked. |
Right, I’d argue that it is indeed unlikely that someone would want a Flutter widget to be placed on top of the native title, so I guess that’s fine the way it is. Still, disabling the double-click feature completely would irritate people who prefer to maximize their windows by double-clicking. Perhaps a better solution would be to add an API that enables or disables the blocking toolbar? Then, a Flutter widget could enable it for a few milliseconds when it is clicked (thereby blocking the second click), thus blocking the double-click only when the cursor is placed on top of the widget. Do you think that would be a good idea? |
I also played with this idea but currently have dropped it. It might work but every Flutter widget you place in the toolbar would need to be made aware of this. Maybe we can leave this as an improvement for later? |
I think we could just offer a wrapper widget that you can wrap around your toolbar buttons, which would then handle the toolbar clicking automatically. |
Can this be merged without such a wrapper widget? I think this can be improved later if anyone needs it. |
I’d be willing to merge it if there was a method to enable and disable the blocking toolbar. Right now I think it’s too likely that some users may rely on the double-click-to-maximize feature in their apps to completely take it away with no way to enable it again. Looking at your commit, I think all that’s necessary to achieve this is to add some sort of parameter of some sort to the If you’re unfamiliar with the way the platform channels are implemented in macos_window_utils, I’d be happy to do that myself. |
I'd happily accept that offer. Please feel free to push to this branch. |
How did you add the blue background to the |
@cbenhagen Bump, in case you missed my previous comment. |
Sorry, I indeed missed your comment. Unfortunately I don't remember how I did it. |
Use
BlockingToolbar
instead ofNSToolbar
to prevent maxmizing the window on double clicking a Flutter button. See macosui/macos_ui#308