fix mac, windows builds

refs: https://github.com/wez/wezterm/issues/1794
This commit is contained in:
Wez Furlong committed 2022-04-02 07:58:27 -07:00
1 parent 89b653acb8
commit 2faa6822f9
3 files changed
+11 -9

No files matched your search

+6 -2
View File
@@ -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| {
+3 -4
View File
@@ -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.,
};
+2 -3
View File
@@ -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.,
};