r0x0r / pywebview

Build GUI for your Python program with JavaScript, HTML, and CSS
https://pywebview.flowrl.com
BSD 3-Clause "New" or "Revised" License
4.74k stars 554 forks source link

Windows frameless dragging is choppy / lagging #713

Closed awxsam closed 3 years ago

awxsam commented 3 years ago

Specification

Description

When creating an HTML element with class pywebview-drag-region, the dragging feels like it is choppy and lagging behind.

Practicalities

leonkvas commented 3 years ago

Having the exact same issue and additionally easyDrag (dragging the window at any point) is not working on Windows while it is on Mac. Would be really nice if there would be a solution for both or either the issues, thank you!

r0x0r commented 3 years ago

It seems that drag region logic does not compensate for the drag region position inside the window, which results in an initial jump. Maybe user32.ReleaseCapture() instead of SetWindowPos would do the trick.

As for easy easy drag, somehow its implementation had been left behind. The core problem is to delegate webview click to its parent form in order to use ReleaseCapture(). It can probably be done via JS API, but a more bullet-proof solution would be to do it in Winforms/win32.

I don't have a Windows machine at the moment, so I have no capacity to investigate these issues. See #637 for details.

github-actions[bot] commented 3 years ago

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.

github-actions[bot] commented 3 years ago

The message to post on the issue when closing it. If none provided, will not comment when closing an issue.