winit
winit copied to clipboard
Fix 'no-decorations' in Windows.
In Windows, an overlapped window that used with_decorations(false) didn't have the proper styles.
Previously, between other flags it removed WS_CAPTION but only for child windows.
That doesn't actually make sense, because WS_CAPTION is intended for overlapped (non-child) windows only. Actually its numeric value is equal to WS_BORDER | WS_DLGFRAME:
#define WS_CAPTION __MSABI_LONG(0x00C00000)
#define WS_BORDER __MSABI_LONG(0x00800000)
#define WS_DLGFRAME __MSABI_LONG(0x00400000)
That is why removing it actually removes the decoration of child windows (WS_BORDER).
Anyway, trying to create a secondary overlapped window without decorations doesn't work, I think because the styles are not actually removed, but the inner/outer metrics is fixed as if it were.
With this change the decorations are removed both for child and overlapped windows.
- [X] Tested on all platforms changed
- [X] Added an entry to the
changelogmodule 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