Bug 253170

Summary: ShareWindow option does not work correctly
Product: WebKit Reporter: rajesh.vaidya
Component: WebRTCAssignee: Nobody <webkit-unassigned>
Status: RESOLVED MOVED    
Severity: Normal CC: bfulgham, eric.carlson, ilja.smorgun, mawojtcz, vinayak.kulkarni, webkit-bug-importer, weizha2, youennf
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: Mac (Intel)   
OS: macOS 13   
See Also: https://bugs.webkit.org/show_bug.cgi?id=255080
Attachments:
Description Flags
Screen Recording of the issue with getDisplayMedia
none
Broken window selection controls for “Share Window"
none
Broken “Share Window” none

Description rajesh.vaidya 2023-03-01 10:25:09 PST
Safari recently added support for "Share Window" in Safari 16.x / MacOS 13 (in addition to the existing "Share Screen").
However, the "Share Window" option does not work correctly - specifically the dialog that allows you to select the window to share does not always appear in the foreground.

To test this, run the following webRTC sample from github:
1) open  https://webrtc.github.io/samples/src/content/getusermedia/getdisplaymedia/ in Safari
2) click the "start button on the page.This will launch a pop-up
3) select "Allow to Share Window" option from the pop-up
4) The "Share this window" option is not visible - often it is behind other app windows.
Comment 1 Radar WebKit Bug Importer 2023-03-01 10:38:31 PST
<rdar://problem/106094452>
Comment 2 Eric Carlson 2023-03-02 12:51:03 PST
The "Share the window" button appears in whichever window the mouse is over when the picker is active, but you need to bring the window to the foreground if you want to click the button to share the window.
Comment 3 vinayak.kulkarni 2023-04-05 03:52:56 PDT
Created attachment 465770 [details]
Screen Recording of the issue with getDisplayMedia

Faced a similar problem with getDisplayMedia
I am on Ventura 13.2.1 and Safari 16.3
1. When I choose to "Share the Window", the "Share this Window" Pop up from Safari comes immediately and selecting which, screen share starts fine.
2. When I choose to "Share the Screen", the "Share this Screen" Pop up from Safari comes only after I hover my mouse on the screen. If I don't hover my mouse over the screen and wait for a minute, the "Share this Screen" pop up doesn't appear but it appears as soon as I hover my mouse.

It would be a better experience if the popup appears as soon as the permission is provided and user can then select which Screen to share by hovering over a different screen.

Sharing the screen recording as an attached. Please share if there is any work around for this.
Comment 4 Brown Zhang 2023-04-19 20:29:48 PDT
This issue can also be reproduced on Safari 16.4 running on OS 13.3.0 with an Intel chip. 
In another machine with OS 13.3.1, even though the "Share the Window" button is visible, clicking on it will result in a black video source (but you can see the mouse cursor).
Comment 5 vinayak.kulkarni 2023-04-21 07:08:33 PDT
Team please let us know if there is any update on this and/or if you need any more information on this to proceed. Thanks!
Comment 6 youenn fablet 2023-05-16 07:36:43 PDT
FWIW, I am able to reproduce on a recent 16.x Safari build, contrary to https://bugs.webkit.org/show_bug.cgi?id=255080.
Comment 7 Ilja Smorgun 2023-05-17 02:30:19 PDT
Created attachment 466381 [details]
Broken window selection controls for “Share Window"

I began experiencing issues with sharing windows after updating to Ventura 13.3.1 and Safari 16.4. Before the update everything worked fine. Now when attempting to share a window the sharing controls are shown in the top right corner of the screen and only a top thin part of the selected window is shared.
Comment 8 Ilja Smorgun 2023-05-17 02:31:25 PDT
Just to clarify. Sharing the entire screen works just fine. The issue is only with the “Share Window” option.
Comment 9 Ilja Smorgun 2023-05-17 02:34:37 PDT
Created attachment 466382 [details]
Broken “Share Window”
Comment 10 Brent Fulgham 2023-06-08 13:22:12 PDT
This was investigated under:
<rdar://109515021>
Comment 11 Brent Fulgham 2023-06-08 13:23:09 PDT
The fix for this issue needs to be made outside of WebKit. Consequently, resolving this as MOVED.

The actual fix is being tracked in rdar://109515021.