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] inability to change the height/length of the window using the drag area #9510

Closed
Rostov4an1n opened this issue Apr 19, 2024 · 8 comments · Fixed by #9862
Closed

[bug] inability to change the height/length of the window using the drag area #9510

Rostov4an1n opened this issue Apr 19, 2024 · 8 comments · Fixed by #9862
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@Rostov4an1n
Copy link

Describe the bug

Hi. When trying to resize a window in the drag-and-drop area, it's difficult because, as far as I know, there's 1 pixel highlighted there that you can grab to change the window. There is no way to change the window at all at the edges, and when you try to double-click on the edge of the window, the application unfolds with an artifact

Reproduction

unknown_2024.04.19-15.18.1.mp4

Expected behavior

Make it so that when the cursor changes the borders of the window, the drag function is disabled. Maybe you can somehow add an event listener that will read the current state of the cursor

image

Full tauri info output

[✔] Environment
    - OS: Windows 10.0.22631 X64
    ✔ WebView2: 123.0.2420.97
    ✔ MSVC: Visual Studio Community 2022
    ✔ rustc: 1.77.2 (25ef9e3d8 2024-04-09)
    ✔ cargo: 1.77.2 (e52e36006 2024-03-26)
    ✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 20.11.0
    - yarn: 1.22.19
    - npm: 10.5.0

[-] Packages
    - tauri [RUST]: 2.0.0-beta.15
    - tauri-build [RUST]: 2.0.0-beta.12
    - wry [RUST]: 0.39.1
    - tao [RUST]: 0.27.0
    - @tauri-apps/api [NPM]: 2.0.0-beta.8
    - @tauri-apps/cli [NPM]: 2.0.0-beta.13

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - framework: React
    - bundler: Vite
Done in 6.82s.

Stack trace

No response

Additional context

No response

@Rostov4an1n Rostov4an1n added status: needs triage This issue needs to triage, applied to new issues type: bug labels Apr 19, 2024
@Rostov4an1n Rostov4an1n changed the title [bug] the inability to change the window using the drag and drop area [bug] inability to change the height/length of the window using the drag area Apr 19, 2024
@sultaniman
Copy link

If you got custom draggable title then try to play w/ z-index

@amrbashir
Copy link
Member

please provide a minimal reproduction repo

@Eatham532
Copy link

Hi, I created a repo that reproduces this bug. It is in TauriV2. tauri-titlebar-bug

@amrbashir
Copy link
Member

Quoting from #9023 (comment):

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.

@amrbashir
Copy link
Member

Reached out to Webview2 for a proper WM_NCHITTEST handling, MicrosoftEdge/WebView2Feedback#446 (comment), hopefully they can provide a solution.

I have already spent too much time on this now and before and right now, and without a proper WM_NCHITTEST handling, this is the best we can provide for now.

@amrbashir
Copy link
Member

For now, I'd suggest you leave a 1~3px at the top of your custom title bar, if you want to still be able to resize from top, otherwise drag will take precedence.

@amrbashir
Copy link
Member

A PR #9862 is up to fix this and almost all annoyances that comes with the current resizing implementation, please test and let me know if it fixes it for you

@Eatham532
Copy link

Eatham532 commented May 24, 2024

Hey, @amrbashir just tested your PR, it works on my machine.
Windows 10.0.22631 X64

Thanks for fixing this

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

Successfully merging a pull request may close this issue.

4 participants