Make CosmicTextSystem
Linux-only (#14728)
Since `WindowsDispatcher` requires a minimum Windows version of Windows 10 Fall Creators Update (10.0.16299), and the `alacritty_terminal` dependency relies on conPTY, an API introduced in the same version, additionally, `DirectWriteTextSystem` also relies on Windows 10 Fall Creators Update (10.0.16299), so it seems reasonable to make `CosmicTextSystem` Linux-only. And we can use `DirectWriteTextSystem` on the Windows platform exclusively. I hope this approach makes sense. Release Notes: - N/A
This commit is contained in:
parent
a60b3b9389
commit
82d6ad4616
7 changed files with 11 additions and 28 deletions
|
@ -49,7 +49,7 @@ pub(crate) struct WindowsPlatform {
|
|||
icon: HICON,
|
||||
background_executor: BackgroundExecutor,
|
||||
foreground_executor: ForegroundExecutor,
|
||||
text_system: Arc<dyn PlatformTextSystem>,
|
||||
text_system: Arc<DirectWriteTextSystem>,
|
||||
clipboard_hash_format: u32,
|
||||
clipboard_metadata_format: u32,
|
||||
}
|
||||
|
@ -90,13 +90,8 @@ impl WindowsPlatform {
|
|||
let dispatcher = Arc::new(WindowsDispatcher::new());
|
||||
let background_executor = BackgroundExecutor::new(dispatcher.clone());
|
||||
let foreground_executor = ForegroundExecutor::new(dispatcher);
|
||||
let text_system = if let Some(direct_write) = DirectWriteTextSystem::new().log_err() {
|
||||
log::info!("Using direct write text system.");
|
||||
Arc::new(direct_write) as Arc<dyn PlatformTextSystem>
|
||||
} else {
|
||||
log::info!("Using cosmic text system.");
|
||||
Arc::new(CosmicTextSystem::new()) as Arc<dyn PlatformTextSystem>
|
||||
};
|
||||
let text_system =
|
||||
Arc::new(DirectWriteTextSystem::new().expect("Error creating DirectWriteTextSystem"));
|
||||
let icon = load_icon().unwrap_or_default();
|
||||
let state = RefCell::new(WindowsPlatformState::new());
|
||||
let raw_window_handles = RwLock::new(SmallVec::new());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue