Skip to content

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

Open
TechnoPorg wants to merge 1 commit into
rust-windowing:masterfrom
TechnoPorg:push-zkwpxwyvztsx
Open

fix: ensure window type is always set when using WS_EX_TOPMOST#4659
TechnoPorg wants to merge 1 commit into
rust-windowing:masterfrom
TechnoPorg:push-zkwpxwyvztsx

Conversation

@TechnoPorg

@TechnoPorg TechnoPorg commented Aug 6, 2026

Copy link
Copy Markdown
  • 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
Author

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

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.

1 participant