CMake/compatibility.cmake: define functions and macros to be used
if a particular CMake functionality requires a higher CMake version
than FLTK's minimum CMake version, see 'cmake_minimum_required(...)'
in the root CMakeLists.txt.
Note: target_link_directories() is available since CMake 3.13
Add CMake test for PTHREAD_MUTEX_RECURSIVE
Add autoconf/configure compile test for PTHREAD_MUTEX_RECURSIVE
Replace "#ifdef PTHREAD_MUTEX_RECURSIVE"
with "#ifdef HAVE_PTHREAD_MUTEX_RECURSIVE"
and define HAVE_PTHREAD_MUTEX_RECURSIVE in config.h
- add missing dependencies to build the shared libfltk_cairo(.dylib)
- remove incorrect dependency on cairo from libfltk
- add cairo_test-shared demo (linked with shared libs)
The old version would reschedule an existing timer if a matching timer
existed already which was unique to macOS.
The new behavior is consistent on all platforms and allows to create
multiple timer entries with the same callback and userdata.
Calling Fl::repeat_timeout() instead of Fl::add_timeout() to create
a timer would crash on macOS but fall back to Fl::add_timeout() on
Windows and Unix/Linux. Although this is documented as "undefined
behavior" a crash should always be avoided and the fallback is now
consistent on all major platforms.
In the future this may be documented as the standard behavior.
Issue #210: "Fl::event_x() & event_y() doesn't take into account
embedded window's coords with Mouse wheel events"
In fact the calculation of Fl::event_x() and Fl::event_y() used the
wrong window coordinates if the event was sent to a subwindow.
This is a hypothetical fix, since the condition `count == 0` may not
be true although `doit` has been allocated. In practice this should
not be possible since the same loop is executed twice in lines 463++
and 471++. But anyway, here it is...
Some of the previous constness changes turned out to be incomplete,
others had to be reverted because some other driver methods could
not be made 'const' - particularly those calling open_display() to
get the requested information.
As requested by issue #181:
"Fl_Screen_Driver.H non-const functions should be const"
Not all methods could be made 'const' because some screen related
methods call init() internally.
Fl::event_key() display needs to be converted to UTF-8 for keycodes
outside the ASCII range (0xa0 - 0xff). Such keycodes can be found
on international keyboards.
src/Fl_Native_File_Chooser_WIN32.cxx:190:10:
warning: ‘char* strncpy(char*, const char*, size_t)’ specified bound
depends on the length of the source argument [-Wstringop-overflow=]
190 | strncpy(wp2, string, n);
| ~~~~~~~^~~~~~~~~~~~~~~~
Although there was no real problem with the code (the allocated buffer
was large enough), the code was questionable and there was redundant
code that could be simplified.
Format code according to the CMP, add instructions on how to copy
the code to the fluid tutorial, and update the tutorial with the
current code of test/CubeView.h and test/CubeView.cxx.
macOS Big Sur 11.3 introduced a new "security feature" such that
app bundles created from existing bundle templates in downloaded
files (tar distibutions, expanded) could no longer be executed
without unsetting the "quarantine" attribute. This commit fixes
this by creating all bundles from scratch.
Known *workaround* for older tarballs and snapshots:
$ xattr -d -r com.apple.quarantine xxx.app
There's no need to blow up the source file by including the bitmap
file literally in the source code. Use '#include' instead.
Another benefit is that the original source file is referenced in
the source code so it is not accidentally removed.
Actually we don't know about some newer MSVC versions, but current
version MSVC 2019 works fine w/o defining round(). If other MSVC
versions need this as well we can change the version test or add
a compiler feature test to CMake (configure not required).
Apple clang version 12.0.5 (clang-1205.0.22.9)
Target: arm64-apple-darwin20.4.0
Warning appeared after upgrade to Xcode 12.5 in several files,
example:
In file included from Fl_Scroll.cxx:19:
../FL/Fl_Scroll.H:102:17: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage]
typedef struct {
^
ScrollInfo
../FL/Fl_Scroll.H:104:5: note: type is not C-compatible due to this member declaration
typedef struct { int x,y,w,h; } Fl_Region_XYWH;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../FL/Fl_Scroll.H:128:5: note: type is given name 'ScrollInfo' for linkage purposes by this typedef declaration
} ScrollInfo;
^