Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometime init windows size wrong #4285

Closed
Kurt-Shiwz opened this issue Sep 13, 2023 · 5 comments
Closed

Sometime init windows size wrong #4285

Kurt-Shiwz opened this issue Sep 13, 2023 · 5 comments
Labels
bug Something isn't working macOS Issue applies to Apple macOS waiting-on-op Waiting for more information from the original poster

Comments

@Kurt-Shiwz
Copy link

What Operating System(s) are you seeing this problem on?

macOS

Which Wayland compositor or X11 Window manager(s) are you using?

No response

WezTerm version

20230712-072601-f4abf8fd

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

First, the focus of my mouse is on the internal screen of my Mac. Sometimes when I open wezterm, the window opens on the Dell monitor but the size of the window is incorrect. When I exit the wezterm. app and reopen it, it opens normally on the internal screen.

To Reproduce

No response

Configuration

confing:

    initial_rows = 40,
    initial_cols = 120,

Expected Behavior

No response

Logs

No response

Anything else?

No response

@Kurt-Shiwz Kurt-Shiwz added the bug Something isn't working label Sep 13, 2023
@wez wez added the macOS Issue applies to Apple macOS label Sep 13, 2023
@snobb
Copy link

snobb commented Oct 17, 2023

I've done a simple workaround of this issue by adding the code below into the conifg:

wezterm.on('gui-startup', function()
    local tab, pane, window = wezterm.mux.spawn_window(cmd or {})
    window:gui_window():maximize()
end)

Unfortunately that does not solve the window size after unlocking the screen or moving the terminal window between the screens (Mac Retina and Acer, which is bigger but with smaller resolution).

wez added a commit that referenced this issue Feb 7, 2024
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
#4966 case, and may help with
the various other macos quirky issues.

refs: #2958
refs: #3575
refs: #3900
refs: #4250
refs: #4285
refs: #4447
refs: #4851
refs: #4966
@wez
Copy link
Owner

wez commented Feb 8, 2024

Please try the latest nightly build and let me know if this is still an issue!

@wez wez added the waiting-on-op Waiting for more information from the original poster label Feb 8, 2024
Copy link
Contributor

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

Copy link
Contributor

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working macOS Issue applies to Apple macOS waiting-on-op Waiting for more information from the original poster
Projects
None yet
Development

No branches or pull requests

3 participants