From 503712f54780e674f1bcc86b389b492c86df87bf Mon Sep 17 00:00:00 2001 From: Russell Standish Date: Mon, 8 Jan 2024 16:16:13 +1100 Subject: [PATCH 1/2] Release 3.2.0-beta.2 --- gui-js/libs/shared/src/lib/constants/version.ts | 2 +- gui-js/package-lock.json | 4 ++-- gui-js/package.json | 2 +- minskyVersion.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gui-js/libs/shared/src/lib/constants/version.ts b/gui-js/libs/shared/src/lib/constants/version.ts index 98ca4a66c..359ed62f9 100644 --- a/gui-js/libs/shared/src/lib/constants/version.ts +++ b/gui-js/libs/shared/src/lib/constants/version.ts @@ -1 +1 @@ -export const version="3.2.0-beta.1"; +export const version="3.2.0-beta.2"; diff --git a/gui-js/package-lock.json b/gui-js/package-lock.json index 95c236f3e..8e32be8df 100644 --- a/gui-js/package-lock.json +++ b/gui-js/package-lock.json @@ -1,12 +1,12 @@ { "name": "minsky", - "version": "3.2.0-beta.1", + "version": "3.2.0-beta.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "minsky", - "version": "3.2.0-beta.1", + "version": "3.2.0-beta.2", "hasInstallScript": true, "license": "GPL-3.0-or-later", "dependencies": { diff --git a/gui-js/package.json b/gui-js/package.json index 762640330..8a0796428 100644 --- a/gui-js/package.json +++ b/gui-js/package.json @@ -1,6 +1,6 @@ { "name": "minsky", - "version":"3.2.0-beta.1", + "version":"3.2.0-beta.2", "author": "High Performance Coders", "description": "Graphical dynamical systems simulator oriented towards economics", "build": { diff --git a/minskyVersion.h b/minskyVersion.h index 1eeb73369..f65186a71 100644 --- a/minskyVersion.h +++ b/minskyVersion.h @@ -1 +1 @@ -#define MINSKY_VERSION "3.2.0-beta.1" +#define MINSKY_VERSION "3.2.0-beta.2" From 4ae7596ebc0c488c779b89cd1a79f200455f06b7 Mon Sep 17 00:00:00 2001 From: Russell Standish Date: Wed, 17 Jan 2024 10:40:18 +1100 Subject: [PATCH 2/2] Change DestroyWindow to PostMessage(WM_CLOSE). This _ensures_ that DestroyWindow is called from the correct thread. For #1686 and #1698. --- model/windowInformation.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/model/windowInformation.cc b/model/windowInformation.cc index 79ab51911..34986ad70 100644 --- a/model/windowInformation.cc +++ b/model/windowInformation.cc @@ -56,7 +56,6 @@ using namespace ecolab; namespace minsky { - namespace { #ifdef USE_WIN32_SURFACE @@ -101,10 +100,10 @@ namespace minsky SelectObject(hdcMem, hOld); DeleteObject(hbmMem); DeleteDC(hdcMem); - DestroyWindow(childWindowId); + SetWindowLongPtrA(childWindowId, GWLP_USERDATA, 0); + PostMessageA(childWindowId,WM_CLOSE,0,0); #elif defined(MAC_OSX_TK) #elif defined(USE_X11) - //eventThread.reset(); //shut thread down before destroying window XFreeGC(display, graphicsContext); XDestroyWindow(display, childWindowId); XDestroyWindow(display, bufferWindowId); @@ -160,10 +159,10 @@ namespace minsky #ifdef USE_WIN32_SURFACE LRESULT CALLBACK windowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { - WindowInformation* winfo=reinterpret_cast(GetWindowLongPtr(hwnd, GWLP_USERDATA)); switch (msg) { case WM_PAINT: + if (WindowInformation* winfo=reinterpret_cast(GetWindowLongPtr(hwnd, GWLP_USERDATA))) { RECT r; if (GetUpdateRect(hwnd,&r,false)) @@ -243,7 +242,7 @@ namespace minsky // adjust everything by the monitor scale factor DEVICE_SCALE_FACTOR scaleFactor; GetScaleFactorForMonitor(MonitorFromWindow(parentWindowId, MONITOR_DEFAULTTONEAREST), &scaleFactor); - sf=scaleFactor/100.0; + sf=int(scaleFactor)/100.0; } if (sf>0) {