Skip to content
Draft
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
12 changes: 11 additions & 1 deletion model/windowInformation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ namespace minsky
HDC dc=BeginPaint(winfo.childWindowId, &ps);
BitBlt(dc, x, y, width,height,winfo.hdcMem,x,y,SRCCOPY);
EndPaint(winfo.childWindowId, &ps);
SetWindowPos(winfo.childWindowId,HWND_TOP,winfo.offsetLeft,winfo.offsetTop,winfo.childWidth,winfo.childHeight,0);
// Note: SetWindowPos was previously called here on every blit to keep the
// child window at HWND_TOP, but that fired WM_WINDOWPOSCHANGED on every
// paint which could cascade into further WM_PAINT messages and interact
// badly with screen-sharing hooks (e.g. Zoom). The window is already
// positioned correctly at creation time in WindowInformation().
#elif defined(USE_X11)
static mutex blitting;
const lock_guard<mutex> lock(blitting);
Expand Down Expand Up @@ -159,6 +163,12 @@ namespace minsky
if (GetUpdateRect(hwnd,&r,false))
blit(*winfo, r.left, r.top, r.right-r.left, r.bottom-r.top);
}
else
// GWLP_USERDATA is zeroed in ~WindowInformation before the window is
// closed, so reaching here means the WindowInformation has already been
// torn down. Validate the rect so Windows stops generating WM_PAINT
// messages for a window that no longer has a backing buffer.
ValidateRect(hwnd, nullptr);
return 0;
case WM_NCHITTEST:
return HTTRANSPARENT;
Expand Down
Loading