Open merlindru opened 1 year ago
Thanks for opening this. Wails uses native controls so I'm curious about your thinking with CSS variables
@leaanthony I'm not sure how --wails-draggable: drag
is implemented, but couldn't we add --wails-window-control: maxbutton
and then respond like this in WndProc WM_NCHITTEST?
I don't know anything about Win32 API development, I just found these ^ thru googling and saw that Wails implements a function called "WndProc" in it's win32 internals
This would put Wails one step ahead of Electron, I think, because you can designate any element as a window control.
Electron only supports PWA-style controls:
Oh, you're talking about frameless windows? I'll come back to you when all this Christmas stuff is over 🤣
Yes!! Sorry, should've made that more clear :P
@merlindru - Oops this totally slipped off the radar. I'm very keen on adding this to v3.
IIRC this is pretty hard to achieve in the current way the WebView2 is hosted on the Window and goes more or less down the same route as for frameless dragging. The problem is the WM_NCHITTEST
never gets fired on the Window because it is directly catched by the WebView2 when using frameless. I think this is only achievable by using composition hosting of the WebView2, which is a greater refactoring.
But it would be awesome to support this, we would take some efforts to test composition hosting and for testing if it is really going to allow us to support this.
Is your feature request related to a problem? Please describe.
No response
Describe the solution you'd like
We could expose a CSS variable to mark minimize/maximize/close buttons, just like --wails-draggable
https://github.com/microsoft/vscode/issues/140932
Describe alternatives you've considered
No response
Additional context
No response