Skip to content

fix(win32): ensure window type is always set when using WS_EX_TOPMOST - #4659

Merged
ogoffart merged 1 commit into
rust-windowing:masterfrom
TechnoPorg:push-zkwpxwyvztsx
Sep 12, 2026
Merged

ogoffart merged 1 commit into
rust-windowing:masterfrom
TechnoPorg:push-zkwpxwyvztsx

Conversation

@TechnoPorg

@TechnoPorg TechnoPorg commented Aug 6, 2026

Copy link
Copy Markdown
Contributor
  • Tested on all platforms changed
  • Added an entry to the changelog module if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality

This fixes a bug I encountered in iced with a window having both always-on-top and borderless fullscreen enabled, which would cause DX12 surface creation to crash with this message:

[2026-08-06T14:24:00Z ERROR wgpu_hal::dx12] SwapChain creation error: The application made a call that is invalid. Either the parameters of the call or the state of some object was incorrect.
    Enable the D3D debug layer in order to see details via debug messages. (0x887A0001)
[2026-08-06T14:24:00Z ERROR wgpu_core::device::resource] surface configuration failed: swapchain creation
[2026-08-06T14:24:00Z ERROR wgpu::backend::wgpu_core] Handling wgpu errors as fatal by default

As per this StackOverflow question with debug layer output and this DXVK issue, setting WS_EX_TOPMOST requires that some other window style be set as well; however, previously, the window style would be unset when the fullscreen flag was set. I'm reasonably confident that setting WS_POPUP is correct here, since WS_CAPTION creates a border and that's obviously undesired for borderless fullscreen.

I'd also love to see this backported to 0.30.x if possible, but I understand if it's not.

@TechnoPorg

Copy link
Copy Markdown
Contributor Author

The failed job appears related to the GitHub outage yesterday and not these changes.

@TechnoPorg
TechnoPorg force-pushed the push-zkwpxwyvztsx branch 3 times, most recently from d3044ea to ef9feb4 Compare August 16, 2026 11:38
@TechnoPorg TechnoPorg changed the title fix: ensure window type is always set when using WS_EX_TOPMOST fix(win32): ensure window type is always set when using WS_EX_TOPMOST Sep 10, 2026
@TechnoPorg

Copy link
Copy Markdown
Contributor Author

@kchibisov would you or anyone else from the org be able to review this? Very sorry for the ping, but I haven't been able to find a better way to request a review. Thanks!

Comment thread winit-win32/src/window_state.rs
@TechnoPorg

Copy link
Copy Markdown
Contributor Author

Given that it's not getting past the toolchain installation, the Windows CI breakage seems unrelated to this change?

@ogoffart
ogoffart merged commit 475f5e2 into rust-windowing:master Sep 12, 2026
104 of 106 checks passed
@TechnoPorg

Copy link
Copy Markdown
Contributor Author

Wonderful, thank you! Would it be okay if I were to open a PR backporting this change to 0.30.x, since that's what's used by iced and where I originally ran into the bug?

@TechnoPorg
TechnoPorg deleted the push-zkwpxwyvztsx branch September 12, 2026 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants