Skip to content

Conversation

@mayfield
Copy link

Related to: #48554

Description of Change

Frameless windows use hit-test based resize in chromium. Version 39 of electron regressed resizable windows that did not have a "frame" on win32.

Checklist

  • PR description included
  • npm test passes
    I ran tests but there were 245 fails that seemed to have nothing to do with my change. I don't know if HEAD is broken or if my windows VM is not setup correctly.
  • PR release notes describe the change in a way relevant to app developers, and are capitalized, punctuated, and past tense.

Release Notes

notes: Fix user resizing of transparent windows on win32 platform

@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Jan 17, 2026
@mayfield
Copy link
Author

Here is my test matrix to gauge user impact...

commonOptions = {
  width: 800,
  height: 600,
  maxWidth: 1000,
  minWidth: 400,
}
version - options Sizable by user .isResizable() isMaximizable() .maximize() behavior .restore() after maximize() notes
38.0.0 - frame:true, transparent:false, thickFrame: true YES true true YES PASS
39.2.7 - frame:true, transparent:false, thickFrame: true YES true true YES PASS
40 +pr - frame:true, transparent:false, thickFrame: true YES true true YES PASS
38.0.0 - frame:true, transparent:true, thickFrame: true NO false true YES FAIL not transparent, has frame
39.2.7 - frame:true, transparent:true, thickFrame: true NO false false YES, ignores constraints PASS transparent, NO frame
40 +pr - frame:true, transparent:true, thickFrame: true NO false false YES, ignores constraints PASS transparent, NO frame
38.0.0 - frame:false, transparent:false, thickFrame: true YES true true YES YES
39.2.7 - frame:false, transparent:false, thickFrame: true YES true true YES YES
40 +pr - frame:false, transparent:false, thickFrame: true YES true true YES YES
38.0.0 - frame:false, transparent:true, thickFrame: true YES true true YES FAIL
39.2.7 - frame:false, transparent:true, thickFrame: true NO false false YES, ignores constraints PASS
40 +pr - frame:false, transparent:true, thickFrame: true YES true true YES FAIL
38.0.0 - frame:true, transparent:true, thickFrame: true, resizable: false NO false false YES, ignores constraints PASS affected by #48421
39.2.7 - frame:true, transparent:true, thickFrame: true, resizable: false NO false false YES, ignores constraints PASS unaffected by #48421
40 +pr - frame:true, transparent:true, thickFrame: true, resizable: false NO false false YES, ignores constraints PASS unaffected by #48421
38.0.0 - thickFrame:false NO false true YES PASS
39.2.7 - thickFrame:false NO false false YES PASS
40 +pr - thickFrame:false NO false false YES PASS
38.0.0 - thickFrame:false, frame:false YES true true YES PASS
39.2.7 - thickFrame:false, frame:false NO false false YES PASS
40 +pr - thickFrame:false, frame:false NO true true YES PASS
38.0.0 - thickFrame:false, frame:false, transparent:true YES true true YES FAIL
39.2.7 - thickFrame:false, frame:false, transparent:true NO false false YES, ignores constraints PASS
40 +pr - thickFrame:false, frame:false, transparent:true YES true true YES FAIL

@mayfield
Copy link
Author

Hi @zoy-l, Here is the PR for the win32 resize regression. I kept the changes as minimal as possible and attempted to keep behavior identical to docs/pre-39.

@zoy-l
Copy link
Contributor

zoy-l commented Jan 20, 2026

@mayfield Hey, I'm not an API reviewer, so I can't really give any suggestions. Please be patient — someone will review it.
😃

steveseguin added a commit to steveseguin/electron that referenced this pull request Jan 22, 2026
This commit addresses the transparent window rendering issues on Windows:

1. Apply PR electron#49428 fix for CanResize() and IsResizable()
   - Frameless windows use hit-test based resize, not WS_THICKFRAME
   - CanResize() now returns resizable_ for frameless windows
   - IsResizable() simplified to delegate to CanResize()

2. Add SetIsTranslucent(false) for transparent windows after widget init
   - During widget creation, transparent windows get is_translucent_=true
   - This causes Win11 background material patch to call DefWindowProc(-1)
   - On some hardware, this causes black/grey backgrounds on focus events
   - Explicitly setting is_translucent_=false prevents this issue

3. Keep SetBackgroundMaterial() early return for transparent windows
   - Background materials (Mica/Acrylic) are not appropriate for transparent windows

Fixes: electron#48554
See: electron#49428

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Jan 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants