mirror of
https://github.com/wez/wezterm.git
synced 2025-01-08 23:17:36 +03:00
fix mac, windows builds
refs: https://github.com/wez/wezterm/issues/1794
This commit is contained in:
parent
89b653acb8
commit
2faa6822f9
@ -1,4 +1,5 @@
|
||||
use ::window::*;
|
||||
use config::Dimension;
|
||||
use promise::spawn::spawn;
|
||||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
@ -107,8 +108,11 @@ async fn spawn_window() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let win = Window::new_window(
|
||||
"myclass",
|
||||
"the title",
|
||||
800,
|
||||
600,
|
||||
RequestedWindowGeometry {
|
||||
width: Dimension::Pixels(800.),
|
||||
height: Dimension::Pixels(600.),
|
||||
..Default::default()
|
||||
},
|
||||
None,
|
||||
fontconfig,
|
||||
move |event, window| {
|
||||
|
@ -383,7 +383,7 @@ impl Window {
|
||||
pub async fn new_window<F>(
|
||||
_class_name: &str,
|
||||
name: &str,
|
||||
geometry: usize,
|
||||
geometry: RequestedWindowGeometry,
|
||||
config: Option<&ConfigHandle>,
|
||||
_font_config: Rc<FontConfiguration>,
|
||||
event_handler: F,
|
||||
@ -397,14 +397,13 @@ impl Window {
|
||||
};
|
||||
|
||||
// TODO: populate these dimension contexts based on NSScreen info
|
||||
let dpi = conn.default_dpi();
|
||||
let width_context = DimensionContext {
|
||||
dpi: dpi as f32,
|
||||
dpi: crate::DEFAULT_DPI as f32,
|
||||
pixel_max: 65535.,
|
||||
pixel_cell: 65535.,
|
||||
};
|
||||
let height_context = DimensionContext {
|
||||
dpi: dpi as f32,
|
||||
dpi: crate::DEFAULT_DPI as f32,
|
||||
pixel_max: 65535.,
|
||||
pixel_cell: 65535.,
|
||||
};
|
||||
|
@ -457,14 +457,13 @@ impl Window {
|
||||
let raw = rc_to_pointer(&inner);
|
||||
|
||||
// TODO: populate these dimension contexts based on monitor info
|
||||
let dpi = conn.default_dpi();
|
||||
let width_context = DimensionContext {
|
||||
dpi: dpi as f32,
|
||||
dpi: crate::DEFAULT_DPI as f32,
|
||||
pixel_max: 65535.,
|
||||
pixel_cell: 65535.,
|
||||
};
|
||||
let height_context = DimensionContext {
|
||||
dpi: dpi as f32,
|
||||
dpi: crate::DEFAULT_DPI as f32,
|
||||
pixel_max: 65535.,
|
||||
pixel_cell: 65535.,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user