Skip to content
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

[Bug]: setContentProtection affects an application window behavior #31735

Closed
3 tasks done
KazuyaHayashi opened this issue Nov 7, 2021 · 3 comments · Fixed by #31768
Closed
3 tasks done

[Bug]: setContentProtection affects an application window behavior #31735

KazuyaHayashi opened this issue Nov 7, 2021 · 3 comments · Fixed by #31768

Comments

@KazuyaHayashi
Copy link

KazuyaHayashi commented Nov 7, 2021

Preflight Checklist

Electron Version

15.2.0

What operating system are you using?

Windows

Operating System Version

Windows 10 version 20H2

What arch are you using?

x64

Last Known Working Electron version

15.1.2

Expected Behavior

Apply setContentProtection function without any effects on the application window behavior on browser-window-created event.

Actual Behavior

When setContentProtection function is called on browser-window-created event, the application window form will changed when the focus is backed. The value of the argument of setContentProtection has no effect on the result.
setContentProtectionIssue

Testcase Gist URL

https://gist.github.com/KazuyaHayashi/33372ae657dde602e68fdb50aabafa31

Additional Information

When I call setContentProtection just after creating BrowserWindow, this issue does not happen. But I want to set contents protection on each windows which are created by new-window event. Therefor, I have called setContentProtection function on browser-window-created event.

@deermichel deermichel added status/confirmed A maintainer reproduced the bug or agreed with the feature 15-x-y 16-x-y 13-x-y 14-x-y labels Nov 8, 2021
@deermichel
Copy link
Contributor

deermichel commented Nov 8, 2021

Reproduced on Win10 2004, introduced by #31340. Doesn't occur with setOpacity though 🤔

@deermichel
Copy link
Contributor

deermichel commented Nov 8, 2021

Actually this serves as a temporary workaround:

app.on('browser-window-created', function(e, w) {
  w.setOpacity(1.0)
  w.setContentProtection(true)
})

@deermichel
Copy link
Contributor

Fixed and confirmed to work in 16.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants