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

[Windows] Do not force redraw window background on mouse pass-through region change. #80153

Merged
merged 1 commit into from
Aug 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions platform/windows/display_server_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ void DisplayServerWindows::_update_window_mouse_passthrough(WindowID p_window) {
ERR_FAIL_COND(!windows.has(p_window));

if (windows[p_window].mpass || windows[p_window].mpath.size() == 0) {
SetWindowRgn(windows[p_window].hWnd, nullptr, TRUE);
SetWindowRgn(windows[p_window].hWnd, nullptr, FALSE);
} else {
POINT *points = (POINT *)memalloc(sizeof(POINT) * windows[p_window].mpath.size());
for (int i = 0; i < windows[p_window].mpath.size(); i++) {
Expand All @@ -1201,8 +1201,7 @@ void DisplayServerWindows::_update_window_mouse_passthrough(WindowID p_window) {
}

HRGN region = CreatePolygonRgn(points, windows[p_window].mpath.size(), ALTERNATE);
SetWindowRgn(windows[p_window].hWnd, region, TRUE);
DeleteObject(region);
SetWindowRgn(windows[p_window].hWnd, region, FALSE);
memfree(points);
}
}
Expand Down