-
-
Notifications
You must be signed in to change notification settings - Fork 540
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
Fix CEF win resize hangs. https://github.com/r0x0r/pywebview/issues/484 #504
Conversation
``` bash | ||
pip install pypiwin32 | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pywin32 is not needed. You can use from ctypes import windll
webview/platforms/cef.py
Outdated
self.initialized = True | ||
self.loaded.set() | ||
|
||
def close(self): | ||
self.browser.CloseBrowser(True) | ||
|
||
def resize(self, width, height): | ||
win32gui.SetWindowPos(self.inner_hwnd, win32con.NULL, 0, 0, width - 16, height - 38, | ||
win32con.SWP_NOZORDER | win32con.SWP_NOMOVE | win32con.SWP_NOACTIVATE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
windll.user32.SetWindowPos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's strange but using ctypes.windll I got hangs when I randomly resize window by dragging it (but with much less chance than using cef.WindowUtils.OnSize). In the same case I got no hangs using win32gui during much longer test.
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days |
What's the status of this? I have a project that's kind of waiting for this fix. |
Merged. I have not tested it personally. |
Temporary solution until cefpython release 66.1 version (after that
Browser.SetBounds
method will be available for Win and we should use it to resize window)