5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 06:01:52 +08:00

[runtime] Frameless resize now sets the cursor on documentElement (#2289)

Otherwise if the body does not cover the full viewport the cursor won't
be shown outside of its rectangle.
This commit is contained in:
stffabi 2023-01-10 13:19:09 +01:00 committed by GitHub
parent 8e4606d104
commit 05679e70d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 8 deletions

View File

@ -123,7 +123,7 @@ window.addEventListener('mousedown', (e) => {
}); });
function setResize(cursor) { function setResize(cursor) {
document.body.style.cursor = cursor || window.wails.flags.defaultCursor; document.documentElement.style.cursor = cursor || window.wails.flags.defaultCursor;
window.wails.flags.resizeEdge = cursor; window.wails.flags.resizeEdge = cursor;
} }
@ -141,10 +141,10 @@ window.addEventListener('mousemove', function (e) {
return; return;
} }
if (window.wails.flags.defaultCursor == null) { if (window.wails.flags.defaultCursor == null) {
window.wails.flags.defaultCursor = document.body.style.cursor; window.wails.flags.defaultCursor = document.documentElement.style.cursor;
} }
if (window.outerWidth - e.clientX < window.wails.flags.borderThickness && window.outerHeight - e.clientY < window.wails.flags.borderThickness) { if (window.outerWidth - e.clientX < window.wails.flags.borderThickness && window.outerHeight - e.clientY < window.wails.flags.borderThickness) {
document.body.style.cursor = "se-resize"; document.documentElement.style.cursor = "se-resize";
} }
let rightBorder = window.outerWidth - e.clientX < window.wails.flags.borderThickness; let rightBorder = window.outerWidth - e.clientX < window.wails.flags.borderThickness;
let leftBorder = e.clientX < window.wails.flags.borderThickness; let leftBorder = e.clientX < window.wails.flags.borderThickness;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Improved fullscreen mode for frameless window on Windows. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2279) - Improved fullscreen mode for frameless window on Windows. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2279)
- On Windows unmaximising a window has no effect anymore when the window is in fullscreen mode, this makes it consistent with e.g. macOS. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2279) - On Windows unmaximising a window has no effect anymore when the window is in fullscreen mode, this makes it consistent with e.g. macOS. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2279)
- Frameless resize now sets the cursor on documentElement, otherwise resizing cursor won't be shown outside of the body rectangle. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2289)
### Fixed ### Fixed
- Fixed failing build hooks when `build/bin` was missing. Fixed by @Lyimmi in [PR](https://github.com/wailsapp/wails/pull/2273) - Fixed failing build hooks when `build/bin` was missing. Fixed by @Lyimmi in [PR](https://github.com/wailsapp/wails/pull/2273)