RESOLVED FIXED236395
Clipboard Paste dialog doesn't show on external monitors
https://bugs.webkit.org/show_bug.cgi?id=236395
Summary Clipboard Paste dialog doesn't show on external monitors
Michael Feldstein
Reported 2022-02-09 12:02:08 PST
If you use the `navigator.clipboard.read` methods, safari throws up a "Paste" context menu for permission approval, but if you're on an external monitor that context menu doesn't show up so the api is unusable for people with external monitors. Sometimes it only works on external monitors, and sometimes it only works on built-in display. I'm not sure what causes the difference. https://codepen.io/msfeldstein/pen/qBVrOev
Attachments
Fixes the bug (7.56 KB, patch)
2022-03-01 11:39 PST, Wenson Hsieh
no flags
+ Test coverage (9.16 KB, patch)
2022-03-01 12:16 PST, Wenson Hsieh
no flags
Radar WebKit Bug Importer
Comment 1 2022-02-14 19:58:02 PST
Wenson Hsieh
Comment 2 2022-02-25 13:17:30 PST
I suspect this is due to the way in which we compute the confinement rect when positioning the DOM paste context menu: ``` - (NSRect)confinementRectForMenu:(NSMenu *)menu onScreen:(NSScreen *)screen { auto confinementRect = WebCore::enclosingIntRect(NSRect { NSEvent.mouseLocation, menu.size }); confinementRect.move(0, -confinementRect.height()); return confinementRect; } ``` ...will look into this soon.
Wenson Hsieh
Comment 3 2022-03-01 11:39:18 PST Comment hidden (obsolete)
Wenson Hsieh
Comment 4 2022-03-01 12:16:49 PST
Created attachment 453521 [details] + Test coverage
Wenson Hsieh
Comment 5 2022-03-01 16:23:19 PST
Comment on attachment 453521 [details] + Test coverage Thanks for the review!
EWS
Comment 6 2022-03-01 17:09:00 PST
Committed r290712 (247959@main): <https://commits.webkit.org/247959@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 453521 [details].
Note You need to log in before you can comment on or make changes to this bug.