1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 06:54:45 +03:00

window: fixup tests for font config changes

This commit is contained in:
Wez Furlong 2021-06-26 22:57:48 -07:00
parent 282c148bf6
commit 7f04c4601a
2 changed files with 15 additions and 2 deletions

View File

@ -1,6 +1,7 @@
use ::window::*;
use promise::spawn::spawn;
use std::rc::Rc;
use wezterm_font::FontConfiguration;
struct MyWindow {
allow_close: bool,
@ -15,7 +16,12 @@ impl Drop for MyWindow {
}
async fn spawn_window() -> Result<(), Box<dyn std::error::Error>> {
let (win, events) = Window::new_window("myclass", "the title", 800, 600, None).await?;
let fontconfig = Rc::new(FontConfiguration::new(
None,
::window::default_dpi() as usize,
)?);
let (win, events) =
Window::new_window("myclass", "the title", 800, 600, None, fontconfig).await?;
let mut state = MyWindow {
allow_close: false,

View File

@ -3,6 +3,8 @@ use anyhow::Context;
use promise::spawn::spawn;
#[cfg(target_os = "macos")]
use raw_window_handle::{HasRawWindowHandle, RawWindowHandle};
use std::rc::Rc;
use wezterm_font::FontConfiguration;
pub struct GpuContext {
pub swap_chain: wgpu::SwapChain,
@ -191,7 +193,12 @@ impl MyWindow {
}
async fn spawn_window() -> anyhow::Result<()> {
let (win, events) = Window::new_window("myclass", "the title", 800, 600, None).await?;
let fontconfig = Rc::new(FontConfiguration::new(
None,
::window::default_dpi() as usize,
)?);
let (win, events) =
Window::new_window("myclass", "the title", 800, 600, None, fontconfig).await?;
let mut state = MyWindow {
allow_close: false,