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

[bug] Window.max_inner_size does not function correctly on os=windows build #498

Closed
dchicchon opened this issue Jul 14, 2022 · 3 comments · Fixed by #491
Closed

[bug] Window.max_inner_size does not function correctly on os=windows build #498

dchicchon opened this issue Jul 14, 2022 · 3 comments · Fixed by #491
Assignees
Labels
platform: Windows status: backlog Issue is ready and we can work on it type: bug

Comments

@dchicchon
Copy link

dchicchon commented Jul 14, 2022

Describe the bug

When creating a window, using the method <WindowBuilder>.max_inner_size() does not work on os=windows builds. The main workaround is using the method <WindowBuilder>.inner_size.

Reproduction

  1. Create a window using <WindowBuilder>.
  2. Use method max_inner_size and set a max size.
  3. Compare windows and mac builds.

Example:

   let preferences_window = WindowBuilder::new(
        handle,
        "preferences",
        tauri::WindowUrl::App("src/preferences/index.html".into()),
    )
    .center()
    .max_inner_size(300.0, 250.0)
    .always_on_top(true)
    .resizable(false)
    .build()
    .unwrap();

Expected behavior

Expect that both windows and mac builds will have the same size window built.

Platform and versions

Environment
  › OS: Windows 10.0.22000 X64
  › Webview2: 103.0.1264.49
  › MSVC:
      - Visual Studio Build Tools 2022
      - Visual Studio Build Tools 2017
  › Node.js: 16.13.0
  › npm: 8.13.2
  › pnpm: Not installed!
  › yarn: Not installed!
  › rustup: 1.24.3
  › rustc: 1.61.0
  › cargo: 1.61.0
  › Rust toolchain: stable-x86_64-pc-windows-msvc 

Packages
  › @tauri-apps/cli [NPM]: 1.0.3
  › @tauri-apps/api [NPM]: 1.0.2
  › tauri [RUST]: 1.0.3,
  › tauri-build [RUST]: 1.0.3,
  › tao [RUST]: 0.12.1,
  › wry [RUST]: 0.19.0,

App
  › build-type: bundle
  › CSP: unset
  › distDir: ../dist
  › devPath: http://localhost:3000/
  › framework: React

App directory structure
  ├─ .git
  ├─ dist
  ├─ node_modules
  ├─ src
  └─ src-tauri

Stack trace

N/A

Additional context

No response

@dchicchon dchicchon added status: needs triage This issue or pull request needs to be investigated type: bug labels Jul 14, 2022
@amrbashir
Copy link
Member

Do you mean that you can resize the window using the mouse beyond constraints provided to WindowBuilder::max_inner_size?

@dchicchon
Copy link
Author

Not in this case since I also created the window with .resize(false). On my mac if I set it to something like (20.0,20.0) its a small window but on my windows dev build its the default size. In that case it ignores the max_inner_size

@islandryu
Copy link

I think it's the unconditional inner_size set here.

Can I modify it so that it adjusts and then sets the same as the event loop?

util::adjust_size(window, max_size, is_decorated).into();

@amrbashir amrbashir added status: backlog Issue is ready and we can work on it status: needs triage This issue or pull request needs to be investigated platform: Windows and removed status: needs triage This issue or pull request needs to be investigated labels Jul 25, 2022
@amrbashir amrbashir self-assigned this Jul 25, 2022
@amrbashir amrbashir transferred this issue from tauri-apps/tauri Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: Windows status: backlog Issue is ready and we can work on it type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants