Skip to content

Commit 8b5a276

Browse files
authored
Merge pull request #641 from hdijkema/move-fix
Fix a problem with WebView2, which won't generate a move event
2 parents 0758da5 + 8bf079a commit 8b5a276

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/webui.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11485,6 +11485,21 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) {
1148511485
}
1148611486
break;
1148711487
}
11488+
case WM_MOVE: {
11489+
if (win) {
11490+
if (win->webView && win->webView->webviewController) {
11491+
RECT bounds;
11492+
GetClientRect(hwnd, &bounds);
11493+
11494+
// Because WebView2 does not do anything if the size has not changed...and still we want to be able to register moves
11495+
bounds.right -= 1;
11496+
win->webView->webviewController->lpVtbl->put_Bounds(win->webView->webviewController, bounds);
11497+
bounds.right += 1;
11498+
win->webView->webviewController->lpVtbl->put_Bounds(win->webView->webviewController, bounds);
11499+
}
11500+
}
11501+
break;
11502+
}
1148811503
case WM_SIZE: {
1148911504
if (win) {
1149011505
if (win->webView && win->webView->webviewController) {

0 commit comments

Comments
 (0)