You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
activateSystemCursor should set the cursor on all views #140226
At least on the web, the cursor can be set at whatever scope we choose (e.g. entire window, flutter view element, etc). So in order for us to correctly scope the cursor, we would need the viewId information within the activateSystemCursor message.
At the moment, we are always setting the cursor property on the body element. It would be better to set the cursor property on all the <flutter-view> elements instead, for a few reasons:
Avoid polluting the cursor of other parts of the page that don't belong to Flutter.
Fix the mouse cursor when the Flutter View is moved to a PiP window (see comments below).
I suspect that this is going to be difficult because as far as I remember the mouse system doesn't associate the cursor with a view. It sees the cursor as "global".
Yeah. Normally such cursor changes are associated with widgets, which can be tracked down to a view. However, the cursor API itself is not built with this layer in mind, which allows arbitrary cursor changes unassociated with views. Requiring a view ID in activateSystemCursor might sound confusing.
Can we just set all views to use this cursor? It might impact the performance but I think the browser must have some kind of optimization.
Another way is to have the Web manually track the enter/leave events for the view that the cursor is currently in.
I'm not sure if this is related to this issue or if I should open up a new one. But it sounds like a solution to this problem would solve mine too:
I'm currently working on a project using the Document Picture-in-Picture API. Similar to the example on MDN, I just move the element containing the view into the pip window.
In browser DevTools, it looks like the mouse cursor changes are still sent to the body element in the originating window, not to the pip window.
Now that I look at it, I think we should apply the cursor to all Flutter views, and therefore activateSystemCursor should not include a view ID. As far as I see, Web is designed to support only a single mouse cursor.
As for @holzgeist 's issue, I'm not familiar with the PIP feature, but your description sounds like a bug to me. We should apply the cursor to the correct div. I'll appreciate it if you can file an issue with a complete reproduction. Thank you.
@dkwingsmt I found a workaround (Listen for cursor changes on the main window with a MutationObserver and copy the style to the pip window), but I'll try to generate a minimal example
Can we just set all views to use this cursor? It might impact the performance but I think the browser must have some kind of optimization.
That should work. Unless you have hundreds of views, I think the performance impact will be negligible.
Another way is to have the Web manually track the enter/leave events for the view that the cursor is currently in.
That's what the browser does for us for free. We just need to set the cursor property on all the appropriate elements.
I'm currently working on a project using the Document Picture-in-Picture API. Similar to the example on MDN, I just move the element containing the view into the pip window.
In browser DevTools, it looks like the mouse cursor changes are still sent to the body element in the originating window, not to the pip window.
Hmm I'm not familiar with pip, but it sounds like the CSS cursor property in the pip window is not inherited from the body.
As far as I see, Web is designed to support only a single mouse cursor.
It's true that there's only one mouse cursor active at a time. But the app can specify multiple cursors on different elements, and let the browser switch cursors depending on where the mouse is.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
[web] Set cursor property on body (#49098)
goderbauer commentedon Dec 19, 2023
cc @dkwingsmt
I suspect that this is going to be difficult because as far as I remember the mouse system doesn't associate the cursor with a view. It sees the cursor as "global".
dkwingsmt commentedon Dec 19, 2023
Yeah. Normally such cursor changes are associated with widgets, which can be tracked down to a view. However, the cursor API itself is not built with this layer in mind, which allows arbitrary cursor changes unassociated with views. Requiring a view ID in
activateSystemCursormight sound confusing.Can we just set all views to use this cursor? It might impact the performance but I think the browser must have some kind of optimization.
Another way is to have the Web manually track the enter/leave events for the view that the cursor is currently in.
holzgeist commentedon Nov 26, 2025
I'm not sure if this is related to this issue or if I should open up a new one. But it sounds like a solution to this problem would solve mine too:
I'm currently working on a project using the Document Picture-in-Picture API. Similar to the example on MDN, I just move the element containing the view into the pip window.
In browser DevTools, it looks like the mouse cursor changes are still sent to the body element in the originating window, not to the pip window.
dkwingsmt commentedon Dec 1, 2025
Now that I look at it, I think we should apply the cursor to all Flutter views, and therefore
activateSystemCursorshould not include a view ID. As far as I see, Web is designed to support only a single mouse cursor.As for @holzgeist 's issue, I'm not familiar with the PIP feature, but your description sounds like a bug to me. We should apply the cursor to the correct div. I'll appreciate it if you can file an issue with a complete reproduction. Thank you.
holzgeist commentedon Dec 2, 2025
@dkwingsmt I found a workaround (Listen for cursor changes on the main window with a
MutationObserverand copy the style to the pip window), but I'll try to generate a minimal examplemdebbar commentedon Dec 2, 2025
That should work. Unless you have hundreds of views, I think the performance impact will be negligible.
That's what the browser does for us for free. We just need to set the
cursorproperty on all the appropriate elements.Hmm I'm not familiar with pip, but it sounds like the CSS
cursorproperty in the pip window is not inherited from the body.It's true that there's only one mouse cursor active at a time. But the app can specify multiple cursors on different elements, and let the browser switch cursors depending on where the mouse is.
[-]`activateSystemCursor` should include a view ID[/-][+]`activateSystemCursor` should set the cursor on all views[/+]Fix: activateSystemCursor should set cursor on all views
Fix: activateSystemCursor should set cursor on all views
Fix: activateSystemCursor should set cursor on all views
Fix: activateSystemCursor should set cursor on all views
Fix: activateSystemCursor should set cursor on all views (flutter#185080
github-actions commentedon Aug 27, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.