Open stevenwithaph opened 8 months ago
Thanks for using Wails and reporting this.
The sizes specified are always the size of the Window and not the size of the WebView. So IMHO this is correct that the WebView's size is smaller due to titlebar and borders.
IMHO this is also too late to change such a fundamental behaviour in v2 anymore, but might be revisited for v3. IIRC there was already somewhere a discussion how this should work in v3 and the consense was to keep the v2 behaviour.
Understandable, but it feels incorrect to me.
Is there anywhere this is being tracked? I included this feature into my own branch and the change was trivial. If wanted I could look into fixing this.
The window size isn't incorrect, it's set to what you give it. The content is a different size for sure. Electron also uses size for the window not the web view. They use the concept of "content size". I did a poll when I started v2 as to whether people wanted the value to be content or window and the vast majority said window. We could add content size for sure but you're the only person who has asked for it so far 😄 Windows has an extra nuance where the menu is included in the client rect size, making the content even smaller. The same is probably true for linux.
We would welcome a PR for this! The things to consider:
SizeIsContentSize
GetContentSize
and SetContentSize
to the runtime This would need to be done on all 3 platforms. How far along is your branch with these considerations in mind?
Description
The actual window is smaller on when including the frame. I've attached a screenshot of the application, the dimensions of both width and height should be 1024x768, but according to the screenshot it's 1010x761.
Setting frameless seems to render the application at the correct size.
To Reproduce
Expected behaviour
Correct screen size
Screenshots
Attempted Fixes
No response
System Details
Additional context
No response