diff --git a/RavelCAPI b/RavelCAPI index edbdf36c6..84764879e 160000 --- a/RavelCAPI +++ b/RavelCAPI @@ -1 +1 @@ -Subproject commit edbdf36c6ce7f1a2cd597b06f8da0c529961cddb +Subproject commit 84764879eb36f7e52cef362561fe64d0f9077d95 diff --git a/model/windowInformation.cc b/model/windowInformation.cc index 7b13419b9..3c7c28366 100644 --- a/model/windowInformation.cc +++ b/model/windowInformation.cc @@ -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 lock(blitting); @@ -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; diff --git a/schema/optional.h b/schema/optional.h index 6ad916586..5206f98da 100644 --- a/schema/optional.h +++ b/schema/optional.h @@ -77,7 +77,7 @@ namespace classdesc void xsd_generate(xsd_generate_t& g, const string& d, const minsky::Optional& a) { xsd_generate_t::Optional o(g,true); - T tmp; // a may be null + T tmp{}; // a may be null xsd_generate(g,d,tmp); } diff --git a/test/testMinsky.cc b/test/testMinsky.cc index 15cef020f..affccabf4 100644 --- a/test/testMinsky.cc +++ b/test/testMinsky.cc @@ -1270,7 +1270,7 @@ TEST(TensorOps, evalOpEvaluate) // renaming just the canvas variable should change it's type canvas.item=stockVar; - if (auto v=canvas.item->variableCast()) + if (canvas.item->variableCast()) { canvas.renameItem("foo"); EXPECT_TRUE(canvas.item && canvas.item->variableCast()); diff --git a/test/testPubTab.cc b/test/testPubTab.cc index a49a7e62b..7711ca274 100644 --- a/test/testPubTab.cc +++ b/test/testPubTab.cc @@ -157,7 +157,7 @@ TEST_F(PubTabSuite,removeSelf) load("1Free.mky"); // send the Godley table to the pub tab for (auto& i: model->items) - if (auto g=dynamic_cast(i.get())) + if (dynamic_cast(i.get())) { publicationTabs[0].items.emplace_back(i); break;