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

inner_size() is always 1600 x 1200 on macOS #889

Open
jkelleyrtp opened this issue Mar 19, 2024 · 2 comments
Open

inner_size() is always 1600 x 1200 on macOS #889

jkelleyrtp opened this issue Mar 19, 2024 · 2 comments

Comments

@jkelleyrtp
Copy link
Contributor

Describe the bug

Calling window.inner_size() always return the same wrong answer on mac (presumably whatever the window started as).

This makes implementing window size restore difficult since we can only set the inner_size of the window, but the outer_size works properly.

Here's me attempting to use it in dioxus. We're able to catch the size from the resize event, which solves the problem I was trying to solve, but is a hacky solution in lieu of this actually working.

Screenshot 2024-03-19 at 4 53 26 PM

Steps To Reproduce

  • Resize the window
  • call .inner_size()
  • doesn't work
@jkelleyrtp
Copy link
Contributor Author

I have a fix for this - but I think there's just something wrong with tao internally.

Old:

let view_frame = unsafe { NSView::frame(*self.ns_view) };

Suggested:

let view_frame = unsafe { NSView::frame((*self.ns_window).contentView()) };

I can confirm that this fixes the bug.

However, this leads me to believe the pointer used by the ns_view is just stale, and is endemic to the rest of the tao codebase.

@pewsheen
Copy link
Contributor

Hi, are you calling inner_size() from Tauri window API or from tao?

It looks fine with tao only (from multithreaded example in tao). For Tauri, there is an issue that has already been fixed recently tauri-apps/tauri#9236

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants