windows: Fix titlebar rendering on Windows 10 (#14656)

As we discussed in #14190, we agreed to open a new PR.

Release Notes:

- N/A
This commit is contained in:
张小白 2024-07-26 01:43:25 +08:00 committed by GitHub
parent beb8fbdf7f
commit 201db23b58
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 38 additions and 2 deletions

View file

@ -52,6 +52,7 @@ pub(crate) struct WindowsPlatform {
text_system: Arc<DirectWriteTextSystem>,
clipboard_hash_format: u32,
clipboard_metadata_format: u32,
windows_version: WindowsVersion,
}
pub(crate) struct WindowsPlatformState {
@ -98,6 +99,7 @@ impl WindowsPlatform {
let clipboard_hash_format = register_clipboard_format(CLIPBOARD_HASH_FORMAT).unwrap();
let clipboard_metadata_format =
register_clipboard_format(CLIPBOARD_METADATA_FORMAT).unwrap();
let windows_version = WindowsVersion::new().expect("Error retrieve windows version");
Self {
state,
@ -108,6 +110,7 @@ impl WindowsPlatform {
text_system,
clipboard_hash_format,
clipboard_metadata_format,
windows_version,
}
}
@ -300,6 +303,7 @@ impl Platform for WindowsPlatform {
self.icon,
self.foreground_executor.clone(),
lock.current_cursor,
self.windows_version,
)?;
drop(lock);
let handle = window.get_raw_handle();