Skip to content
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

Merged
merged 4 commits into from
Jun 2, 2020
Merged

Fix CEF win resize hangs. https://github.com/r0x0r/pywebview/issues/484 #504

merged 4 commits into from
Jun 2, 2020

Conversation

ikhz
Copy link
Contributor

@ikhz ikhz commented Apr 23, 2020

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)

``` bash
pip install pypiwin32
```

Copy link
Owner

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

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)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

windll.user32.SetWindowPos

Copy link
Contributor Author

@ikhz ikhz Apr 23, 2020

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.

@ikhz ikhz requested a review from r0x0r April 23, 2020 19:54
@github-actions
Copy link

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

@github-actions github-actions bot added the stale label May 24, 2020
@NiceneNerd
Copy link

What's the status of this? I have a project that's kind of waiting for this fix.

@r0x0r r0x0r merged commit 68a662e into r0x0r:master Jun 2, 2020
@r0x0r
Copy link
Owner

r0x0r commented Jun 2, 2020

Merged. I have not tested it personally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants