microsoft/Terminal

Defer initial terminal sizing until terminal initialization

Open

#3,182 建立於 2019年10月13日

在 GitHub 查看
 (1 留言) (1 反應) (0 負責人)C++ (3,212 fork)batch import
Area-RenderingArea-UserInterfaceHelp WantedIssue-TaskProduct-Terminal

倉庫指標

Star
 (35,764 star)
PR 合併指標
 (平均合併 27天 19小時) (30 天內合併 24 個 PR)

描述

Right now the initial window size is calculated just as the window is created but before the terminal is. This has two disadvantages:

  1. It doesn't have all the size information. Right now its only the width of a scrollbar that it has to guess but there could be more (potentially variable size) elements in the future. There might also be some additional spacing in layers above, like pane or terminal page.
  2. It creates temporary DxRenderer just to locate required fond and calculate its size and then discards it.

If we instead calculated the initial size when terminal initializes this problems would be gone (it would be able to query sizes of the controls and use the real renderer of a terminal). We might potentially resolve them otherwise but this seems to be the simplest and most robust approach.

The problem is that it could result in two sizing operations (one when window opens and another one when the size is calculated) which could be noticeable to user or CPU, unless this can be somehow avoided. Thus I'm here to ask what do you think about this approach.

貢獻者指南