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
Frameless window can not be minimized by clicking its taskbar button #1357
Comments
Another problem related to frameless mode, from time import sleep
import webview
def maximize(window):
sleep(5)
print('Maximizing window')
window.maximize()
if __name__ == '__main__':
window = webview.create_window(
'Maximize window example', frameless=True, html='<h1>window</h1>'
)
webview.start(maximize, window) |
For the first question, I found a solution in C# https://www.fluxbytes.com/csharp/minimize-a-form-without-border-using-the-taskbar/, and asked GPT how to use .NET in Python through pythonnet. Finally, I overwrote the # webview/platforms/winforms.py
class BroswerView:
...
class BrowserForm(WinForms.Form):
...
@property
def CreateParams(self):
cp = super().CreateParams
WS_MINIMIZEBOX = 0x20000
CS_DBLCLKS = 0x8
cp.Style |= WS_MINIMIZEBOX
cp.ClassStyle |= CS_DBLCLKS
return cp |
I ran into a similar problem some time ago - form methods cannot be overridden for BrowserForm for some reason. It can be done, though. See for example overridding WndProc here |
WndProc is a method, while CreateParams is a property, and this difference may be causing the different results. I noticed that in C# when overriding CreateParams, there is a
After that, I tried different approaches, all of which ended in failure. This matter has exceeded my capabilities... |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
The message to post on the issue when closing it. If none provided, will not comment when closing an issue. |
Specification
Description
Hi, I found that on my Win10 computer, a frameless window cannot be minimized by clicking its taskbar icon, and this issue can be easily replicated as below.
I also noticed that Qt exhibit the same problem, with Qt already having a solution in place. Thus, I wonder if pywebview offer similar workarounds? After searching, I haven't come across anyone reporting this issue, so I'd appreciate any assistance on this matter. Many thanks in advance!
The text was updated successfully, but these errors were encountered: