Commit Graph

12046 Commits

Author SHA1 Message Date
Albrecht Schlosser
9bd68d9bf7 Fix out-of-bounds access in test/checkers.cxx
For details please see description in the source code in
  test/checkers.cxx lines 620++

This commit also disables unused code: function dumpnode() which is
  used only in VT100 mode.

(cherry picked from commit 5b648d2cfc)
2025-04-18 18:09:57 +02:00
MatthiasWM
8016a1fc95 Windows: Fix previous commit for Windows
Downgarde std::string to Fl_String
2025-04-18 18:08:14 +02:00
Matthias Melcher
2e47aeb384 Downgrade C++11 to C++98 calls.
Use Fl_String instead of std::string.Windows: fix "heap-use-after-free" in home_directory_name()

Calling getenv() twice with different output vars and accessing both
later could cause "heap-use-after-free" error in some Windows versions.
The result of home_directory_name() would be unpredictable.

Found using Wine and/or MSYS2/clang/libc++ with Address Sanitizer.

(cherry picked from commit 719fed2b13)
2025-04-18 18:03:52 +02:00
Matthias Melcher
89142ab507 Windows: fix "heap-use-after-free" in home_directory_name()
Calling getenv() twice with different output vars and accessing both
later could cause "heap-use-after-free" error in some Windows versions.
The result of home_directory_name() would be unpredictable.

Found using Wine and/or MSYS2/clang/libc++ with Address Sanitizer.

(cherry picked from commit 719fed2b13)
2025-04-18 17:56:17 +02:00
Matthias Melcher
5e82d0ba78 Fix potential buffer overflow on Windows when loading fonts (#1221)
This commit is bigger than necessary to fix the buffer allocation but
it also prevents some unnecessary string copies: the font name is
converted from UTF-16 to UTF-8 directly in the buffer used later.

Code reformatted and clarified as well, some duplicated code was
removed.

(cherry picked from commit 2e1730d2f0)
2025-04-18 17:48:55 +02:00
ManoloFLTK
e693353536 CI for Wayland: replace libgtk-3-dev by libdecor-0-dev libxfixes-dev libxcursor-dev libxinerama-dev
(cherry picked from commit 1054e81504)
2025-04-18 17:19:52 +02:00
Matthias Melcher
4a48107e82 Fix handling of menu windows taller than their screen
A problem was visible with the menubar test app and a 2-screen system where screens are one above the other.
When moving down the huge menu, it became positioned on the wrong screen.

(cherry picked from commit f4f93fda15)
2025-04-18 17:18:24 +02:00
Matthias Melcher
a7c4b4eb7d Fix comparison that's always true
... because base_dir[0] and dest_dir[0] are *signed* chars.
(Backport from FLTK 1.5)
2025-04-17 15:28:16 +02:00
Matthias Melcher
80ec48e95e Revised version of the glpuzzle man page
Backported from master (76e76ba80a).
2025-04-11 14:56:14 +02:00
ManoloFLTK
58b0b2b7e0 Fix "Minor drawing artifact at scale 200% under X11 session" (#1243) 2025-04-08 11:09:49 +02:00
Albrecht Schlosser
03dc76846d CMake: simplify fluid build
- define variable MAIN_FILES to avoid repetition
- make target_include_directories(fluid-lib) PUBLIC rather than PRIVATE

Backported and slightly modified from master,
  commit 61f132845b
2025-04-04 16:10:38 +02:00
Albrecht Schlosser
135debc5f3 Update man pages of games (demo programs), add glpuzzle.man
Prepare for installation of `games` demo programs. Fix inconsistencies
and typos in man pages. In the future the man pages can be installed
together with the executables. This will be done in a later commit.

documentation/src/glpuzzle.man: new file.

Backported from master (eb1e0f423d).
2025-04-04 16:01:38 +02:00
Aaron Ucko
6b8409fc6c
Use CMake's built-in timestamp formatting (#1242)
* Use CMake's built-in timestamp formatting.

It notably honors SOURCE_DATE_EPOCH if set, making for reproducible
output.  For even better reproducibility, use UTC.  (Unlike the date
command's output, the result is already always in English.)  Extend
this approach to the book, introducing appropriately formatted
PDF_DATE and TODAY variables for its PDF metadata and title page
respectively and making make_pdf configurable.

Under the traditional build system, don't attempt to handle
SOURCE_DATE_EPOCH because date's portable interface is too limited,
just supply PDF_DATE and TODAY values corresponding to the current
date (and time zone) and use the C (English) locale for month names
and abbreviations.

* Fix missing parts and a syntax error in documentation/Makefile

- documentation/Makefile:
  - add make_pdf to target 'clean'
  - add make_pdf to dependencies of 'refman.pdf'
  - add missing quotes to `date` command

- documentation/.gitignore: add make_pdf

---------

Co-authored-by: Albrecht Schlosser <albrechts.fltk@online.de>
2025-04-03 01:49:59 +02:00
Albrecht Schlosser
838b7b98ea CMake: check version for some properties in fl_debug_target()
Debug only, if fl_debug_target() is used:

Prior to CMake 3.19 some properties of "INTERFACE_LIBRARY targets"
can't be read with get_property(). These properties are now
excluded if the CMake version is lower than 3.19.

(Backported from master)
2025-04-02 20:01:15 +02:00
Aaron M. Ucko
2e6e94d118 options.cmake: Check Threads_FOUND, not CMAKE_HAVE_THREADS_LIBRARY
The former's been available since CMake v2.8 and documented since v3.17;
the latter was never documented and quietly went away in CMake v3.24.
2025-04-01 19:16:25 +02:00
Albrecht Schlosser
6336959306 Allow FL_ABI_VERSION = FL_API_VERSION + 1
so users can enable ABI features designated for the *next* release
when using FLTK from Git (or snapshots) before the API version has
been raised for the next release.
2025-03-29 20:57:53 +01:00
Greg Ercolano
26d183ca77 Changed two connector methods to virtual
For reference, see fltk.general thread started Mar 26 2025, entitled:
    "Make some Fl_Tree_Item methods virtual?"

Backported Greg's commit from master (1.5.0) by Albrecht-S,
    added ABI guards for FLTK 1.4.3
2025-03-29 20:21:08 +01:00
ManoloFLTK
caabc3c2a8 Fix: Windows: Clipboard gets stuck when text is copied while window is hidden (#1233) 2025-03-25 17:33:10 +01:00
ManoloFLTK
880636eb12 Fix "Windows: dotted lines may be drawn solid when GUI is rescaled" (#1214) 2025-03-04 16:04:10 +01:00
ManoloFLTK
257435dca0 Remove deprecated, commented-out code.
This code was used in the past to support a deprecated way to obtain the initial
value of the GUI scaling factor for the X11 platform.
2025-02-24 12:12:07 +01:00
Albrecht Schlosser
a206a778b4 Update CHANGES.txt and ANNOUNCEMENT for release 1.4.2 2025-02-23 12:34:18 +01:00
ManoloFLTK
5b617a6cc1 Fix "Fl_RGB_Image::draw() seg faults when offset is too big" - cont'd (#1211) 2025-02-22 09:02:01 +01:00
ManoloFLTK
e27edad5f1 Fix "Fl_RGB_Image::draw() seg faults when offset is too big" (#1211) 2025-02-22 08:33:20 +01:00
ManoloFLTK
7ce2632bfc Fix "Wayland: resizing window may crash the program" (#1210) 2025-02-21 21:16:02 +01:00
Albrecht Schlosser
e932b94436 Update dependencies 2025-02-21 20:12:57 +01:00
Albrecht Schlosser
02af6a57eb Bump version numbers to 1.4.2 2025-02-21 16:25:39 +01:00
Albrecht Schlosser
97f2cdcc29 Fix copyright, a typo, and remaining casts (#1207)
make remaining casts consistent with other casts of the same
variables
2025-02-21 13:37:22 +01:00
ManoloFLTK
d5612afd61 Fix "Fl_JPEG_Image infinite longjmp loop on Mac release builds" (#1207) 2025-02-20 23:16:17 +01:00
Albrecht Schlosser
030c3fa5bc Update "GitHub Actions" Linux runner to 'ubuntu-latest'
Note: ubuntu-20.04 will be phased out soon
2025-02-19 18:34:12 +01:00
Albrecht Schlosser
eaf5fb8d11 Fix buffer overflow warning [-Wstringop-truncation]
Note: this fixes the warning, but a better fix would be to use either
  strlcpy(), fl_strlcpy(), or a string type in 1.5.0 or higher.
2025-02-19 17:22:16 +01:00
Albrecht Schlosser
45476d093c test/editor: ensure buffer termination
... in source file and documentation
2025-02-19 17:14:25 +01:00
ManoloFLTK
27d991f046 Update bundled libdecor to last upstream version (21 jan 2025) 2025-02-14 17:12:39 +01:00
ManoloFLTK
4c64264e0c Fix "fltk-config reports dep on gtk3 when it does not exist" (#1201) 2025-02-14 16:14:39 +01:00
ManoloFLTK
81a5736006 Make Fl_Cocoa_Gl_Window_Driver::capture_gl_rectangle() return a depth-4 image
This change allows to capture the rounded corners of a top-level GL window.

Also, rename Fl_Cocoa_Window_Driver::capture_decorated_window_10_5()
from capture_decorated_window_10_6() because this function uses
CGWindowListCreateImageFromArray() available from macOS 10.5.
2025-02-08 17:19:07 +01:00
ManoloFLTK
9afb35f3a6 fix macOS Sonoma/Sequoia not capturing OpenGL text on macOS - cont'd (#1197 2025-02-06 14:39:54 +01:00
ManoloFLTK
d60141bb71 fix "macOS Sonoma/Sequoia not capturing OpenGL 1 text on macOS" (#1197) 2025-02-06 12:25:39 +01:00
ManoloFLTK
c92bf829b4 macOS: restore building with SDK versions between 10.7 and 10.11 2025-02-05 18:53:55 +01:00
Albrecht Schlosser
904039c4c6 Fix typos and trailing whitespace
Also replace 'MSWindows' with 'Windows' where appropriate, leaving
only old documents like README files from 1.3 and older as-is.
2025-02-05 12:34:39 +01:00
ManoloFLTK
89d146ecee macOS: fix when fullscreen window looses and regains focus with SDK 10.6 (#1192) 2025-02-04 17:30:35 +01:00
ManoloFLTK
02f431bd88 macOS: Restore fullscreen window mode when using SDK < 10.7 (#1192) 2025-02-03 15:25:05 +01:00
ManoloFLTK
af5b2cf464 fullscreen test app: prevent combination of fullscreen + maximize
Also, use more explicit button names
2025-02-03 12:22:07 +01:00
ManoloFLTK
94f471b701 macOS: fix transition from single-screen fullscreen to "All Screens" fullscreen 2025-02-03 12:08:20 +01:00
ManoloFLTK
bc764dabc1 Avoid code repetitions among Fl_{X11_}Window_Driver::{un_}maximize() functions 2025-02-03 09:34:19 +01:00
Albrecht Schlosser
0c7ed2b44f Document "New FL_HELVETICA Font on Windows" (#478)
This commit adds only documentation.
2025-02-01 20:39:28 +01:00
Albrecht Schlosser
77a7752123 Fix potential buffer overflow in Fl_Help_View (#1196) 2025-02-01 19:40:24 +01:00
ManoloFLTK
ab9fd0f503 macOS: add support of showing window to multi-screen fullscreen state 2025-01-30 16:47:57 +01:00
ManoloFLTK
6e922b8005 macOS: Fix "Full screen broken on macOS in FLTK 1.3.10 (regression)" (#1192)
FLTK now supports 2 types of fullscreen modes under macOS:
1) normal macOS fullscreen mode where the menubar and titlebar appear when mouse is moved to top of screen
and the window covers one screen only;
2) multiple-screen mode that requires calling Fl_Window::fullscreen_screens() before.

This commit fixes all possible transitions between these fullscreen modes and normal window mode.
2025-01-30 11:14:17 +01:00
Albrecht Schlosser
18ea5bcb20 Improve documentation of Fl_Box constructors (#1194)
Separate both constructor types and document parameters.
2025-01-29 14:33:07 +01:00
Albrecht Schlosser
5a0551df0a CMake: fix include directories of bundled image libs
If FLTK has been built with bundled image libs the include directory
of the *installed* library headers is 'FL/images' relative to the
normal 'include' directory.

The CMake property "include_directories" is now added to the installed
fltk_images library so it is used when building user programs with
bundled image libs.
2025-01-27 15:51:34 +01:00
ManoloFLTK
6b87b01b65 Refrain static function capture_decorated_window_SCK() from capturing the cursor 2025-01-26 22:45:02 +01:00