Wayland: Fix initial_window_size in cells on scale != 1 screens

Fixes #3834
This commit is contained in:
Kovid Goyal 2021-07-17 06:04:56 +05:30
parent 3b585e6dbb
commit 070911d458
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 6 additions and 4 deletions

View File

@ -34,6 +34,9 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
- Add a new variable ``{num_window_groups}`` for the :opt:`tab_title_template`
(:iss:`3837`)
- Wayland: Fix :opt:`initial_window_width` specified in cells not working on
High DPI screens (:iss:`3834`)
0.21.2 [2021-06-28]
----------------------

View File

@ -4,7 +4,7 @@
from typing import Any, Callable, Dict, NamedTuple, Tuple
from .constants import is_macos
from .constants import is_macos, is_wayland
from .types import FloatEdges
from .typing import EdgeLiteral
from .utils import log_error
@ -47,9 +47,8 @@ def initial_window_size_func(opts: WindowSizeData, cached_values: Dict) -> Calla
h, h_unit = opts.initial_window_sizes.height
def get_window_size(cell_width: int, cell_height: int, dpi_x: float, dpi_y: float, xscale: float, yscale: float) -> Tuple[int, int]:
if not is_macos:
# scaling is not needed on Wayland, but is needed on macOS. Not
# sure about X11.
if not is_macos and not is_wayland():
# Not sure what the deal with scaling on X11 is
xscale = yscale = 1
def effective_margin(which: EdgeLiteral) -> float: