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
feat: Implement BrowserWindow.getMediaSourceId() and BrowserWindow.moveAbove(mediaSourceId) #18926
Conversation
CC @MarshallOfSound @alexeykuzmin , Hi I am not sure who to add as reviewer, thx. |
fff8470
to
1141d12
Compare
I have added 5 unit tests |
485d2ce
to
1e24458
Compare
I am fighting with the unit tests (flakiness of API I am using in the tests but not the new API itself). |
1e24458
to
50e07bf
Compare
cf62392
to
b5dc201
Compare
I addressed remaining issues. The test failure seem unrelated to this change. Please take a look, thx! |
Hi, gentle ping ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
b5dc201
to
8188541
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation looks good to me.
02953ce
to
24dc332
Compare
Hi, I have addressed all the remaining remarks, please take a look, thx! |
Hi @nornagon , gentle ping ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally lgtm, just a few concerns with the tests.
24dc332
to
0580552
Compare
Hi @nornagon I think I addressed all your remarks, let me know if I forgot something, thx! |
0580552
to
1f23b2f
Compare
9b55504
to
09b779b
Compare
still seems to be failing @CapOM |
@CapOM would you still like to move forward with this? it needs a rebase as well. |
09b779b
to
8814f44
Compare
Back from vacations, I just rebased the 2 commits for now. |
@CapOM test failure on macOS:
|
Thx, I will have a look. |
Return the Window id in the format of DesktopCapturerSource's id. For example "window:1234:0". electron#16460 Notes: Added BrowserWindow.getMediaSourceId
BrowserWindow.{focus,blur,moveTop}() are not enough in some situations. For example when implementing an overlay that follows another window that can lose focus. In that case it is useful to move the overlay above the tracked window. sourceId is a string in the format of DesktopCapturerSource.id, for example "window:1869:0". Notes: Added BrowserWindow.moveAbove(mediaSourceId) electron#18922
8814f44
to
9ca6bc0
Compare
@codebytere I fixed the test. The -1 was because [NSWindow windowNumber] returns the max value of uint64_t which is (the reason why it is translated to -1 in the string is because content:DesktopMediaID cast it to intptr_t instead of uintptr_t, so the conversion to string through content:DesktopMediaID.ToString selects the |
@CapOM great detective work 🕵 i'll get this merged as soon as CI is ✅ |
CI looks green, thx! |
Release Notes Persisted
|
Has this been removed? I cant find the API to get the media source id mentioned in this PR |
Fantastic. Thank you @CapOM |
Description of Change
BrowserWindow.{focus,blur,moveTop}() are not enough in some
situations. For example when implementing an overlay that
follows another window that can lose focus. In that case
it is useful to move the overlay above the tracked window.
sourceId is a string in the format of DesktopCapturerSource.id,
for example "window:1869:0".
Resolves #18922.
Checklist
npm test
passesRelease Notes
Notes: Added BrowserWindow.getMediaSourceId() and BrowserWindow.moveAbove(mediaSourceId)