1
1
mirror of https://github.com/wez/wezterm.git synced 2024-10-05 18:58:52 +03:00
wezterm/lua-api-crates/mux/src
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
..
domain.rs deps: upgrade mlua to 0.9.0-rc.1 2023-07-12 14:14:55 -07:00
lib.rs macos (mostly): try harder to get initial dpi 2024-02-06 22:57:05 -07:00
pane.rs mux: allow specifying cache policy for process information 2024-02-02 18:02:18 -07:00
tab.rs add window:active_tab(), window:active_pane(), tab:active_pane() 2023-04-01 19:46:15 -07:00
window.rs add window:active_tab(), window:active_pane(), tab:active_pane() 2023-04-01 19:46:15 -07:00