diff --git a/.gitignore b/.gitignore
index 099566f..dec0999 100644
--- a/.gitignore
+++ b/.gitignore
@@ -75,3 +75,4 @@ test/libc3_test_cov
test/libc3_test_debug
*.tmp
ucd2c/ucd2c
+win32/c3*
diff --git a/libc3/window/cairo/win32/window_cairo_win32.c b/libc3/window/cairo/win32/window_cairo_win32.c
index 93eadd5..e925487 100644
--- a/libc3/window/cairo/win32/window_cairo_win32.c
+++ b/libc3/window/cairo/win32/window_cairo_win32.c
@@ -75,6 +75,7 @@ LRESULT CALLBACK window_cairo_win32_proc(HWND hwnd, UINT message,
EndPaint(hwnd, &ps);
DeleteObject(buffer_hbitmap);
DeleteDC(buffer_hdc);
+ DeleteDC(window_hdc);
break;
case WM_SIZE:
if (! window->resize(window, LOWORD(lParam), HIWORD(lParam)))
diff --git a/win32/Makefile b/win32/Makefile
index b56af2f..6d2a56e 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -11,43 +11,56 @@ c3-${C3_VERSION}.win32:
rm -rf ${DEST}
mkdir -p ${DEST}/test/ic3
cp -a ../README.md ${DEST}
- cp -a ../libffi/.libs/libffi-8.dll ${DEST}
- cp -a ../libffi/.libs/libffi-8.dll ${DEST}/test
+ cp -a ../c3s/.libs/c3s*.exe ${DEST}
+ cp -a ../ic3/.libs/ic3*.exe ${DEST}
+ cp -a ../lib ${DEST}/
cp -a ../libc3/.libs/libc3*-0.dll ${DEST}
cp -a ../libc3/.libs/libc3*-0.dll ${DEST}/test
cp -a ../libc3/window/.libs/libc3_window*-0.dll ${DEST}
cp -a ../libc3/window/cairo/.libs/libc3_window_cairo*-0.dll ${DEST}
-# cp -a /mingw32/bin/libgcc_s_seh-1.dll ${DEST}
- cp -a /mingw32/bin/libcairo-2.dll ${DEST}
+ cp -a ../libc3/window/cairo/demo/.libs/libc3_window_cairo_demo*-0.dll ${DEST}
cp -a ../libc3/window/cairo/win32/.libs/libc3_window_cairo_win32*-0.dll ${DEST}
- cp -a ../libc3/window/cairo/win32/demo/.libs/c3_window_cairo_win32_demo.exe ${DEST}
- cp -a /mingw32/bin/libxkbcommon-0.dll ${DEST}
- cp -a /mingw32/bin/libwinpthread-1.dll ${DEST}
- cp -a /mingw32/bin/libstdc++-6.dll ${DEST}
+ cp -a ../libc3/window/cairo/win32/demo/.libs/c3_window_cairo_win32_demo*.exe ${DEST}
+ cp -a ../libc3/window/sdl2/demo/.libs/c3_window_sdl2_demo*.exe ${DEST}
+ cp -a ../libffi/.libs/libffi-8.dll ${DEST}
+ cp -a ../libffi/.libs/libffi-8.dll ${DEST}/test
+ cp -a ../test/*.facts ${DEST}/test
+ cp -a ../test/.libs/libc3*.exe ${DEST}/test
+ cp -a ../test/ic3/*.in ../test/ic3/*.expected ${DEST}/test/ic3
+ cp -a ../test/ic3_test ${DEST}/test
+ cp -a /mingw32/bin/edit.dll ${DEST}
+ cp -a /mingw32/bin/edit.dll ${DEST}/test
+ cp -a /mingw32/bin/libbrotlicommon.dll ${DEST}
+ cp -a /mingw32/bin/libbrotlidec.dll ${DEST}
+ cp -a /mingw32/bin/libbsd-0.dll ${DEST}
+ cp -a /mingw32/bin/libbsd-0.dll ${DEST}/test
+ cp -a /mingw32/bin/libbz2-1.dll ${DEST}
+ cp -a /mingw32/bin/libcairo-2.dll ${DEST}
+ cp -a /mingw32/bin/libdl.dll ${DEST}
+ cp -a /mingw32/bin/libdl.dll ${DEST}/test
+ cp -a /mingw32/bin/libexpat-1.dll ${DEST}
cp -a /mingw32/bin/libfontconfig-1.dll ${DEST}
cp -a /mingw32/bin/libfreetype-6.dll ${DEST}
- cp -a /mingw32/bin/libpixman-1-0.dll ${DEST}
- cp -a /mingw32/bin/zlib1.dll ${DEST}
- cp -a /mingw32/bin/libpng16-16.dll ${DEST}
- cp -a /mingw32/bin/libexpat-1.dll ${DEST}
- cp -a /mingw32/bin/libiconv-2.dll ${DEST}
- cp -a /mingw32/bin/libintl-8.dll ${DEST}
- cp -a /mingw32/bin/libbz2-1.dll ${DEST}
- cp -a /mingw32/bin/libbrotlidec.dll ${DEST}
- cp -a /mingw32/bin/libharfbuzz-0.dll ${DEST}
- cp -a /mingw32/bin/libbrotlicommon.dll ${DEST}
+ cp -a /mingw32/bin/libftgl-2.dll ${DEST}
+ cp -a /mingw32/bin/SDL2.dll ${DEST}
+ cp -a /mingw32/bin/libgcc_s_dw2-1.dll ${DEST}
+ cp -a /mingw32/bin/libgcc_s_dw2-1.dll ${DEST}/test
cp -a /mingw32/bin/libglib-2.0-0.dll ${DEST}
cp -a /mingw32/bin/libgraphite2.dll ${DEST}
+ cp -a /mingw32/bin/libharfbuzz-0.dll ${DEST}
+ cp -a /mingw32/bin/libiconv-2.dll ${DEST}
+ cp -a /mingw32/bin/libintl-8.dll ${DEST}
+ cp -a /mingw32/bin/libmd-0.dll ${DEST}
+ cp -a /mingw32/bin/libmd-0.dll ${DEST}/test
cp -a /mingw32/bin/libpcre2-8-0.dll ${DEST}
- cp -a ../lib ${DEST}/
- cp -a ../c3s/.libs/c3s*.exe ${DEST}
- cp -a ../ic3/.libs/ic3*.exe ${DEST}
- cp -a ../test/.libs/libc3*.exe ${DEST}/test
- cp -a ../test/ic3_test ${DEST}/test
- cp -a ../test/*.facts ${DEST}/test
- cp -a ../test/ic3/*.in ../test/ic3/*.expected ${DEST}/test/ic3
+ cp -a /mingw32/bin/libpixman-1-0.dll ${DEST}
+ cp -a /mingw32/bin/libpng16-16.dll ${DEST}
+ cp -a /mingw32/bin/libstdc++-6.dll ${DEST}
+ cp -a /mingw32/bin/libwinpthread-1.dll ${DEST}
+ cp -a /mingw32/bin/libxkbcommon-0.dll ${DEST}
+ cp -a /mingw32/bin/zlib1.dll ${DEST}
rm -rf c3-${C3_VERSION}.win32.old
- mv c3-${C3_VERSION}.win32 c3-${C3_VERSION}.win32.old
+ if [ -d c3-${C3_VERSION}.win32 ]; then mv c3-${C3_VERSION}.win32 c3-${C3_VERSION}.win32.old; fi
mv ${DEST} c3-${C3_VERSION}.win32
.PHONY: c3-${C3_VERSION}.win32 release