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] 2.0.0-beta.7 the window cannot change size under Windows 11 #9023

Closed
yetone opened this issue Feb 28, 2024 · 14 comments
Closed

[bug] 2.0.0-beta.7 the window cannot change size under Windows 11 #9023

yetone opened this issue Feb 28, 2024 · 14 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@yetone
Copy link

yetone commented Feb 28, 2024

Describe the bug

‌‌The window can only change its width and cannot adjust its height, I have already granted all the window permissions.

Pressing alt+tab does not display applications.

Reproduction

No response

Expected behavior

No response

Full tauri info output

[✔] Environment
    - OS: Windows 10.0.22631 X64
    ✔ WebView2: 122.0.2365.52
    ✔ MSVC:
        - Visual Studio Build Tools 2019
        - Visual Studio Community 2022
    ✔ rustc: 1.76.0-nightly (eeff92ad3 2023-12-13)
    ✔ cargo: 1.76.0-nightly (1aa9df1a5 2023-12-12)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: nightly-x86_64-pc-windows-msvc (default)
    - node: 20.10.0
    - pnpm: 8.12.1
    - npm: 10.2.3

[-] Packages
    - tauri [RUST]: 2.0.0-beta.7
    - tauri-build [RUST]: 2.0.0-beta.5
    - wry [RUST]: 0.37.0
    - tao [RUST]: 0.26.1
    - @tauri-apps/api [NPM]: 2.0.0-beta.2
    - @tauri-apps/cli [NPM]: 2.0.0-beta.3

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist/tauri
    - devUrl: http://localhost:3333/
    - framework: React
    - bundler: Rollup

Stack trace

No response

Additional context

No response

@yetone yetone added status: needs triage This issue needs to triage, applied to new issues type: bug labels Feb 28, 2024
@yetone
Copy link
Author

yetone commented Feb 28, 2024

My ACL:

  "permissions": [
    {
      "identifier": "http:default",
      "allow": [
        {
          "url": "https://*"
        },
        {
          "url": "http://*"
        }
      ]
    },
    "path:default",
    "event:default",
    "webview:default",
    "webview:allow-create-webview",
    "webview:allow-create-webview-window",
    "webview:allow-internal-toggle-devtools",
    "webview:allow-print",
    "webview:allow-reparent",
    "webview:allow-set-webview-focus",
    "webview:allow-set-webview-position",
    "webview:allow-set-webview-size",
    "webview:allow-webview-close",
    "webview:allow-webview-position",
    "webview:allow-webview-size",
    "window:default",
    "window:allow-available-monitors",
    "window:allow-center",
    "window:allow-close",
    "window:allow-create",
    "window:allow-current-monitor",
    "window:allow-destroy",
    "window:allow-hide",
    "window:allow-inner-position",
    "window:allow-inner-size",
    "window:allow-internal-toggle-maximize",
    "window:allow-is-closable",
    "window:allow-is-decorated",
    "window:allow-is-focused",
    "window:allow-is-fullscreen",
    "window:allow-is-maximizable",
    "window:allow-is-maximized",
    "window:allow-is-minimizable",
    "window:allow-is-minimized",
    "window:allow-is-resizable",
    "window:allow-is-visible",
    "window:allow-maximize",
    "window:allow-minimize",
    "window:allow-outer-position",
    "window:allow-outer-size",
    "window:allow-primary-monitor",
    "window:allow-request-user-attention",
    "window:allow-scale-factor",
    "window:allow-set-always-on-bottom",
    "window:allow-set-always-on-top",
    "window:allow-set-closable",
    "window:allow-set-content-protected",
    "window:allow-set-cursor-grab",
    "window:allow-set-cursor-icon",
    "window:allow-set-cursor-position",
    "window:allow-set-cursor-visible",
    "window:allow-set-decorations",
    "window:allow-set-effects",
    "window:allow-set-focus",
    "window:allow-set-fullscreen",
    "window:allow-set-icon",
    "window:allow-set-ignore-cursor-events",
    "window:allow-set-max-size",
    "window:allow-set-maximizable",
    "window:allow-set-min-size",
    "window:allow-set-minimizable",
    "window:allow-set-position",
    "window:allow-set-progress-bar",
    "window:allow-set-resizable",
    "window:allow-set-shadow",
    "window:allow-set-size",
    "window:allow-set-skip-taskbar",
    "window:allow-set-title",
    "window:allow-set-visible-on-all-workspaces",
    "window:allow-show",
    "window:allow-start-dragging",
    "window:allow-theme",
    "window:allow-title",
    "window:allow-toggle-maximize",
    "window:allow-unmaximize",
    "window:allow-unminimize",
    "app:default",
    "resources:default",
    "menu:default",
    "tray:default",
    "updater:default",
    "aptabase:allow-track-event",
    "shell:allow-execute",
    "shell:allow-kill",
    "shell:allow-open",
    "shell:allow-stdin-write",
    "autostart:allow-is-enabled",
    "autostart:allow-enable",
    "fs:allow-app-write",
    "fs:scope-app",
    "fs:scope-appcache",
    "fs:scope-appconfig",
    "fs:scope-appdata",
    "fs:scope-applocaldata",
    "fs:scope-applog",
    "global-shortcut:allow-unregister",
    "global-shortcut:allow-register",
    "global-shortcut:allow-is-registered",
    "global-shortcut:allow-unregister-all",
    "process:allow-restart",
    "notification:default",
    "notification:allow-is-permission-granted"
  ],

@amrbashir
Copy link
Member

I couldn't reproduce, could you share a minimal repro?

@yetone
Copy link
Author

yetone commented Feb 29, 2024

@amrbashir I used the Tauri scaffold to create a simplest application to reproduce this issue. I found that the root cause is due to the combination of window.decorations(false) + data-tauri-drag-region.

The result is that under Windows 11, it's impossible to adjust the window size by dragging the top left corner.

https://github.com/yetone/tauri-bug-reproducer/blob/a007bfc912375c65a7770afe47d073a033aba0f0/src/App.tsx#L20C10-L20C32

@amrbashir
Copy link
Member

I believe that's is the same behavior as v1, simply data-tauri-drag-region takes precedence.

You can leave 1px at the top and resizing can work when clicking in that 1px area. We could also add this hack into our code like this 7a822bb but I am not sure just yet if this is the right way.

@yetone
Copy link
Author

yetone commented Mar 1, 2024

@amrbashir The previous users didn't report this bug, I guess it's because they could resize from the bottom right corner before. Now it can only be done from the top left corner, so this behavior has been exposed.

@amrbashir
Copy link
Member

I guess it's because they could resize from the bottom right corner before. Now it can only be done from the top left corner, so this behavior has been exposed.

Is that something you did in your app or did bottom right corner also stopped working?

@yetone
Copy link
Author

yetone commented Mar 1, 2024

@amrbashir Yes, in the simple app I mentioned above, it's also impossible to resize by dragging from the bottom right corner, even if there are no data-tauri-drag-region elements at the bottom right.

@amrbashir
Copy link
Member

amrbashir commented Mar 1, 2024

works fine for me though, can you check what tao version is used?

@yetone
Copy link
Author

yetone commented Mar 1, 2024

I recorded a video to reproduce this bug. I added a margin in the header, and now the top left corner can be dragged to resize, but the bottom right corner cannot be dragged. @amrbashir

tauri-bug.mp4

@yetone
Copy link
Author

yetone commented Mar 2, 2024

‌‌The tao version is 0.26.1.

@yetone yetone changed the title [bug] 2.0.0-beta.7 the window cannot change its height under Windows 11, and alt+tab does not display applications [bug] 2.0.0-beta.7 the window cannot change size under Windows 11 Mar 2, 2024
@amrbashir
Copy link
Member

amrbashir commented Mar 4, 2024

For this bottom-right corner issue, it is because of the scrollbars, which prevents mouesedown and mousemove events to our JS listeners. Also this behavior exists in v1 so it is not a new thing.

Anyways, unless webview2 exposes a way for us to hit test the webview, we are kinda stuck with this JS implementation, however I will look into a better way to solve this but no promises.

@amrbashir
Copy link
Member

Closing this for now since there is no better way than detecting clicks in JS and then start resizing, hopefully the webview team will provide a better way to do hit tests on the Rust side

@amrbashir amrbashir closed this as not planned Won't fix, can't repro, duplicate, stale Mar 28, 2024
@CodeDoctorDE
Copy link

Btw: With the newest versions tao 0.26.1 and tauri 2.0 beta 13 the resize handle are still a bit buggy but I can now use the left and top handles again

@amrbashir
Copy link
Member

what do you mean by buggy?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

3 participants