1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-24 05:42:03 +03:00
wezterm/docs
Wez Furlong aee37784e5 Windows: fix initial window size when display scaling != 100%
The heart of this issue was that the resize callbacks have two
layers of state; one in the low level window and one in the application
level window.

On Windows, the system triggers the low level callback prior to
opengl being initialized.  Since the application level depends on
the opengl state, there are some code paths where it NOPs and
returns early if opengl isn't yet initialized.

When the system-wide display scaling is set to say 200%, the application
layer can't know the effective DPI of the window it is creating because
it doesn't know which monitor will be used or what its DPI will be.

New windows are created at the default DPI of 96, and we rely on the
resize events to detect the actual DPI and adjust the scaling in
the window.

The early call of the resize callback meant that the low level and
application level size/dpi state was out of sync and the result was
that the window had half as many pixels as it should, but that the
terminal model was still sized as though it had the correct amount
(twice as many as visible).  This resulted in the window being too
small for the viewport.

The resolution is simple: we now suppress emitting the resize processing
until opengl has been initialized.

The test scenario for this is:

* Set system scaling to 100%
* Launch wezterm
* Set system scaling to 200%
* Observe that wezterm scales to match
* Press CTRL-SHIFT-N to spawn a new window
* Observe that the new window size matches the other window (previously
  this one would be half the size)

While I was looking at this, I noticed that the manifest didn't
match the DPI awareness that we have in the code, so update that.

refs: https://github.com/wez/wezterm/issues/427
2021-01-18 09:27:04 -08:00
..
colorschemes colors: set cursor border to bg in the color schemes 2020-10-27 09:17:20 -07:00
config docs: fix custom event example 2021-01-01 20:07:46 -08:00
install ci: generate universal binaries for macOS 2021-01-13 20:11:58 -08:00
screenshots docs: add a screenshot demonstrating background image 2020-10-19 08:59:53 -07:00
_config.yml docs: switch to the "Hacker" theme which is darker 2019-12-18 09:25:36 -08:00
book.toml docs: tweak mdbook config 2020-12-26 10:05:39 -08:00
changelog.markdown Windows: fix initial window size when display scaling != 100% 2021-01-18 09:27:04 -08:00
contributing.markdown docs: link to new GitHub Discussions thingy 2020-12-08 20:32:46 -08:00
copymode.markdown docs: update released version info for some newer features 2020-06-17 00:08:43 -07:00
custom.css style download buttons a bit better 2019-12-29 21:39:23 -08:00
faq.markdown docs: add a note on undercurl 2021-01-17 23:21:26 -08:00
features.markdown docs: add splits/panes to features list 2020-10-10 10:52:15 -07:00
help.markdown Update matrix room url (#378) 2020-12-13 10:06:52 -08:00
hyperlinks.markdown docs: update for lua configuration syntax 2020-04-06 16:32:16 -07:00
imgcat.markdown add screenshot of imgcat 2019-12-31 18:33:24 -08:00
index.markdown docs: add splits/panes to features list 2020-10-10 10:52:15 -07:00
installation.markdown docs: split install page into pages by platform 2020-05-30 10:30:32 -07:00
lua.js docs: enable syntax highlighting for lua 2020-04-06 17:39:57 -07:00
multiplexing.markdown docs: update for 20201031-154415-9614e117 release 2020-10-31 15:51:08 -07:00
scrollback.markdown docs: fix capitalization of PageUp/PageDown 2020-11-24 10:45:42 -08:00
serial.markdown docs: update for lua configuration syntax 2020-04-06 16:32:16 -07:00
shell-integration.markdown wezterm: add SelectionMode::SemanticZone 2020-11-15 22:23:18 -08:00
ssh.markdown docs: update for lua configuration syntax 2020-04-06 16:32:16 -07:00