From 4618e1d256394f39e67fc0fe898dc77e8a1584fc Mon Sep 17 00:00:00 2001 From: David Capello Date: Mon, 28 Oct 2024 11:23:45 -0300 Subject: [PATCH 1/3] [x11] Fix regression using TabletOptions.detectStylusPattern (fix aseprite/aseprite#4740) --- os/skia/skia_system.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/skia/skia_system.h b/os/skia/skia_system.h index 6a3c3d9a0..c0b23ec72 100644 --- a/os/skia/skia_system.h +++ b/os/skia/skia_system.h @@ -67,8 +67,8 @@ class SkiaSystem final : public SkiaSystemBase { } void setTabletOptions(const TabletOptions& options) override { -#if LAF_WINDOWS SkiaSystemBase::setTabletOptions(options); +#if LAF_WINDOWS if (SkiaWindow* window = dynamic_cast(defaultWindow())) { // TODO notify all windows window->onTabletOptionsChange(); From a6476b483d128ab8e31be406cebbb1bb4c8ce8f4 Mon Sep 17 00:00:00 2001 From: David Capello Date: Mon, 4 Nov 2024 17:36:39 -0300 Subject: [PATCH 2/3] Remove unused variable --- os/win/dnd.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/os/win/dnd.cpp b/os/win/dnd.cpp index 5af81407e..5de7e62f4 100644 --- a/os/win/dnd.cpp +++ b/os/win/dnd.cpp @@ -270,7 +270,6 @@ bool DragDataProviderWin::contains(DragDataItemType type) UINT urlFormat = RegisterClipboardFormat(CFSTR_INETURL); UINT pngFormat = RegisterClipboardFormat(L"PNG"); UINT fileDescriptorFormat = RegisterClipboardFormat(CFSTR_FILEDESCRIPTOR); - char name[101]; FORMATETC fmt; while (formats->Next(1, &fmt, nullptr) == S_OK) { switch (fmt.cfFormat) { From 5ec00f5373be19ecf77f9376584cdda5141f9890 Mon Sep 17 00:00:00 2001 From: David Capello Date: Mon, 4 Nov 2024 17:37:24 -0300 Subject: [PATCH 3/3] Disable some MSVC warnings from laf-base --- base/CMakeLists.txt | 21 ++++++++++++++++++++- gfx/path_skia.h | 9 --------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/base/CMakeLists.txt b/base/CMakeLists.txt index e347b710b..80e3a3a2c 100644 --- a/base/CMakeLists.txt +++ b/base/CMakeLists.txt @@ -90,7 +90,26 @@ if(WIN32) # We only support the Unicode API UNICODE _UNICODE) - target_compile_definitions(laf-base PRIVATE _CRT_SECURE_NO_WARNINGS) + if(MSVC) + target_compile_options(laf-base PUBLIC + # Disable warnings about possible loss of data + -wd4244 + + # Disable warnings about conversion from size_t to int + -wd4267 + + # Disable warning about using 'this' used in base member initializer list + -wd4355 + + # Disable function not inlined (generated by MSVC header files) + -wd4710 + + # Avoid warnings about usage of insecure standard C library + # functions and C++ STL functions + -D_CRT_SECURE_NO_WARNINGS + -D_SCL_SECURE_NO_WARNINGS) + endif() + target_link_libraries(laf-base dbghelp shlwapi version) else() if(APPLE) diff --git a/gfx/path_skia.h b/gfx/path_skia.h index 1914b7b36..f96d00851 100644 --- a/gfx/path_skia.h +++ b/gfx/path_skia.h @@ -14,11 +14,6 @@ #include "include/core/SkPath.h" -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4244) // 'argument': conversion from 'T' to 'SkScalar', possible loss of data -#endif - namespace gfx { // Simple wrapper for SkPath @@ -119,8 +114,4 @@ namespace gfx { } // namespace gfx -#ifdef _MSC_VER -#pragma warning(pop) -#endif - #endif