1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-26 08:25:50 +03:00
wezterm/window
Wez Furlong 4f123a461b
macos (mostly): try harder to get initial dpi
There are a number of open issues that relate to getting the dpi
wrong when spawning a window. In theory it shouldn't matter because
we will immediately realize the difference and synthesize the correct
information, but evidence shows this isn't quite true.

What this commit does is:

* Override Connection::default_dpi() on macOS to return the
  effective_dpi from the active screen instead of the default
  non-retina dpi
* Adjust the Config::initial_size() method to accept an optional
  cell pixel dimension
* Add a helper function to wezterm-gui to compute the cell pixel
  dimensions given the config and the (usually default) dpi, and
  feed that through to Config::initial_size
* in the macos window impl, scale the computed geometry based on
  the ratio of the Connection::default_dpi and the default non-retina
  dpi.

This helps to avoid needing to do a fixup in the
https://github.com/wez/wezterm/issues/4966 case, and may help with
the various other macos quirky issues.

refs: https://github.com/wez/wezterm/issues/2958
refs: https://github.com/wez/wezterm/issues/3575
refs: https://github.com/wez/wezterm/issues/3900
refs: https://github.com/wez/wezterm/issues/4250
refs: https://github.com/wez/wezterm/issues/4285
refs: https://github.com/wez/wezterm/issues/4447
refs: https://github.com/wez/wezterm/issues/4851
refs: https://github.com/wez/wezterm/issues/4966
2024-02-06 22:57:05 -07:00
..
examples Implement SetInnerSizeCompleted events 2024-02-04 09:40:54 -07:00
src macos (mostly): try harder to get initial dpi 2024-02-06 22:57:05 -07:00
build.rs macos: handle dead keys without IME 2021-01-31 17:06:30 -08:00
Cargo.toml deps: update glium 2024-02-06 16:52:02 -07:00
LICENSE.md Add missing license files 2022-08-17 07:19:12 -07:00