From db4aa25e99c288a3219f1e1ea061ae0dbe7889a8 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Mon, 2 Feb 2026 19:48:41 +0100 Subject: [PATCH] Windows: define required Windows version for Pen/Tablet support This is necessary for some (not all!) Windows toolchains that define the required symbols only for Windows 8 and later. --- src/drivers/WinAPI/Fl_WinAPI_Pen_Driver.cxx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/drivers/WinAPI/Fl_WinAPI_Pen_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Pen_Driver.cxx index dd205fac4..06cc1e477 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Pen_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Pen_Driver.cxx @@ -1,7 +1,7 @@ // // Definition of Windows Pen/Tablet event driver. // -// Copyright 2025 by Bill Spitzak and others. +// Copyright 2025-2026 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -14,6 +14,23 @@ // https://www.fltk.org/bugs.php // +// Note: We require Windows 8 or later features for Pen/Tablet support. +// Defining WINVER and _WIN32_WINNT to 0x0602 *may* be required on some +// Windows build platforms. Must be done before all #include's. + +#if !defined(WINVER) || (WINVER < 0x0602) +# ifdef WINVER +# undef WINVER +# endif +# define WINVER 0x0602 +#endif +#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0602) +# ifdef _WIN32_WINNT +# undef _WIN32_WINNT +# endif +# define _WIN32_WINNT 0x0602 +#endif + #include "src/drivers/Base/Fl_Base_Pen_Events.H" #include