Commit Graph

7597 Commits

Author SHA1 Message Date
ManoloFLTK
445d26bb71 Improve usage of std::map::key_comp() member in fl_wayland_clipboard_dnd.cxx 2026-01-28 16:31:36 +01:00
ManoloFLTK
149bc2ca3b Improve usage of std::map objects in fl_wayland_clipboard_dnd.cxx 2026-01-28 16:21:22 +01:00
ManoloFLTK
d74b342141 Fix typo in documentation of fl_utf8len1(). 2026-01-28 12:52:42 +01:00
ManoloFLTK
37aeed359a Wayland: improve handling of priorities between diverse clipboard mime-types. 2026-01-27 16:21:36 +01:00
ManoloFLTK
1a285f43ec Modify fl_utf8toa() to make it account for composed emojis. 2026-01-26 15:40:35 +01:00
ManoloFLTK
f61d54e71d Improve documentation of fl_utf8_{next|from}_composed_char() 2026-01-26 10:24:33 +01:00
ManoloFLTK
521f7b3c5b Let text widgets handle gracefully composed unicode characters - Cont'd.
This commit adds support of another type of composed characters: flags.
It also fixes Fl_Text_Buffer::prev_char() and Fl_Text_Buffer::next_char()
that must use Fl_Text_Buffer::byte_at() to access to the content of the text buffer.
2026-01-26 09:17:18 +01:00
ManoloFLTK
188aa0be0e Fix "Setting window custom cursor from SVG image crashes" - cont'd (#1363) 2026-01-24 16:43:12 +01:00
ManoloFLTK
bd4ad3e4a0 Let Fl_Text_Editor and Fl_Input handle gracefully composed unicode characters. 2026-01-24 16:15:47 +01:00
ManoloFLTK
84b5623132 Wayland: use UTF8 text from clipboard when available. 2026-01-23 19:16:23 +01:00
ManoloFLTK
dd9cb9f042 Wayland: add support of recoded UTF8 text in clipboard. 2026-01-23 18:41:19 +01:00
ManoloFLTK
05a3f82a5c Fix "Setting window custom cursor from SVG image crashes" (#1363) 2026-01-22 14:27:13 +01:00
ManoloFLTK
14a5f705c8 Improve handling of text containing context-dependent unicode points.
This commit makes platforms Windows and macOS compute string widths
with the same mechanism as what is in place for platforms Wayland/X11:
- the width of a string containing a single codepoint is computed and
memorized in the table of character widths;
- the width of a string containing several codepoints is computed as
such rather than as the sum of the widths of its composing characters.

The result is that FLTK text widgets input and draw correctly also
complex emojis encoded with context-dependent codepoints.
Function fl_utf8_remove_context_dependent() is no longer necessary.
2026-01-21 14:00:26 +01:00
ManoloFLTK
d30ca18664 Improve docu of member variable Fl_SVG_Image::proportional - cont'd (#1361) 2026-01-20 17:08:08 +01:00
ManoloFLTK
4644521f8c Move call to fl_utf8_remove_context_dependent() to more appropriate place. 2026-01-20 11:41:45 +01:00
ManoloFLTK
138624fa27 Remove possible NULL dereference introduced at commit 61e75e4 2026-01-20 09:51:39 +01:00
ManoloFLTK
61e75e4a12 All platforms use same code to remove context-dependent codepoints from text input.
This commit introduces function fl_utf8_remove_context_dependent() that removes
from an UTF-8 string its context-dependent codepoints. Platforms macOS, Wayland
and X11 call this function to process UTF-8 text received from a character palette
as input to FLTK text. This makes sure FLTK text-editing widgets process textual input
equally and consistently across platforms, especially emojis entered via a palette.

Platform Windows creates a series of separate system events to input an emoji
via the character palette. For this reason, function fl_utf8_remove_context_dependent()
is not used by this platform which does internally the same filtering of context-
dependent codepoints.
2026-01-19 16:34:50 +01:00
ManoloFLTK
59d93554b3 Windows: error dragging window between differently scaled display - cont'd (#1127) 2026-01-19 11:08:29 +01:00
ManoloFLTK
bde474e0af Windows: error dragging window between differently scaled display - cont'd (#1127) 2026-01-19 10:01:30 +01:00
ManoloFLTK
f3cbce2e92 Emoji input: remove context-dependent unicode points from output of emoji palette.
The character palette allowing to input emojis in text generates in some cases a series
of unicode points to represent a single emoji. These series contain various kinds of
unicode points with context-dependent meaning. This commit prevents such context-
dependent unicodepoints from being inserted in FLTK text because FLTK text edition
mechanism is not ready to handle properly context dependency in edited UTF-8 text.
2026-01-18 18:04:06 +01:00
ManoloFLTK
20157f7caa Restore emojis support under recent macOS versions - cont'd (#1360)
This commit improves how FLTK follows changes to the focus window under macOS.
2026-01-16 11:02:37 +01:00
ManoloFLTK
81c965f8e2 Partial fix for the Windows platform of the emoji issue (#1360)
This fixes input of emojis to Fl_Input and Fl_Text_editor widgets under Windows with the emoji palette.
Most emojis have a Unicode point > 0xFFFF and therefore are encoded as a surrogate pair
by Windows which uses UTF-16. Thus, Windows sends 2 consecutive WM_CHAR messages to the
window and gives one member of the pair each time. After the second WM_CHAR message arrived
FLTK is able to enter the emoji in its text. Windows may also send "variation selectors" and
zero-width Unicode points when dealing with emojis. FLTK just skips them.
Windows also translates some Unicode emojis into 1 emoji + 1 other Unicode point: for example
"woman pilot" produces "pilot emoji" + "woman" unicode point. FLTK now handles
this gracefuly.

This fix also prefixes the windows class names with "FLTK-" under Windows to prevent
collisions with Windows-reserved class names. That fix is necessary for the emoji palette
to be usable in some scenarios. That fix is still under debate and may evolve in latter commits.
2026-01-14 16:16:25 +01:00
ManoloFLTK
1c1b6c12f4 Restore emojis support under recent macOS versions - cont'd (#1360)
Detect Ctrl+Command+Space to open character palette only if not used before as shortcut.
2026-01-12 17:03:19 +01:00
ManoloFLTK
306de09987 Restore emojis support under recent macOS versions - cont'd (#1360)
This makes FLTK open the character palette when typing Ctrl+Command+Space or Function+e
2026-01-12 16:34:30 +01:00
ManoloFLTK
69669256d4 Restore emojis support under recent macOS versions (#1360) 2026-01-12 11:21:48 +01:00
ManoloFLTK
afbdbb25b9 Function Fl::Private::cairo_make_current(void *gc) is not used anywhere in FLTK 2026-01-12 09:42:39 +01:00
ManoloFLTK
9a5688f000 Fix "Drawing to the wrong window with cairo and X11" (#1358) 2026-01-11 19:11:28 +01:00
ManoloFLTK
7c3b1f00f5 Don't pretend Wayland supports Fl::add_system_handler(). 2026-01-11 19:03:31 +01:00
ManoloFLTK
7b6a779fd3 Fix "Wayland: NULL pointer dereference in Fl::cairo_make_current()" (#1359) 2026-01-11 12:09:41 +01:00
ManoloFLTK
e59a5dc804 Windows: improve moving window across screens with distinct scale factors - cont'd 2026-01-10 12:36:23 +01:00
ManoloFLTK
fc3e6a1c53 Windows: improve moving window across screens with distinct scale factors - cont'd 2026-01-10 12:05:01 +01:00
ManoloFLTK
8914914735 Remove un-necessary code from Fl_Wayland_Window_Driver::resize() function 2026-01-09 11:19:45 +01:00
Albrecht Schlosser
4908dfd72a Add CMake option FLTK_OPTION_PEN_SUPPORT (default: ON)
This option can be used to disable pen/tablet support if there are
build problems on a particular platform or build system (e.g. MinGW)
so users can continue to build FLTK 1.5.

Users can also choose to disable pen support if they don't need it.
2026-01-08 21:22:03 +01:00
ManoloFLTK
bc05edd385 Wayland: use the "Cursor shape" protocol - Cont'd 2026-01-08 10:51:56 +01:00
Matthias Melcher
dc07fcdb6e Fix callback forwarding in Fl_Input_Choice.
Widget would always call CHANGED but never
RELEASE events, no matter how the when()
flags were set.
2026-01-07 13:18:29 +01:00
ManoloFLTK
522728de8c Wayland: use modern approach to cursor shapes with the "Cursor shape" protocol.
This removes the need to guess names of files each theme gives to cursor shapes
and makes linking with dbus superfluous when the compositor supports
the new protocol.
The old, surface-based approach to cursor shapes remains used for custom shapes.
2026-01-05 15:05:25 +01:00
Matthias Melcher
8d714acf33 Fix a possible popup menu crash event. 2026-01-04 22:17:06 +01:00
ManoloFLTK
46e6815612 Windows: improve moving window across screens having distinct scale factors. 2026-01-04 16:45:11 +01:00
Matthias Melcher
0e570fb672 Add C++11 Fl_Valuator::format API.
This is helpful for writing language wrapper, in
this particular case for PyFLTK.
2026-01-04 15:50:56 +01:00
ManoloFLTK
357336bd40 Fix "Wayland's wl_display_dispatch() can block a Vulkan application" (#1354)
This rewriting of the FLTK callback function that runs when there are data available
for reading in the socket connecting the app and the Wayland compositor is meant to
facilitate the integration of Vulkan.
This rewriting reproduces the recommended code to read from the socket
documented in Wayland function wl_display_prepare_read_queue() when several threads
potentially read from the socket.
2026-01-04 09:38:16 +01:00
Albrecht Schlosser
869df69ff2 Update FLTK colormap (src/fl_cmap.h) w/o changing colors
- update comments, including filenames
- update build instructions for developers in util/cmap.cxx
- update CMakeLists.txt (comments only)
2026-01-03 16:28:02 +01:00
Albrecht Schlosser
775239c2fc Fix compilation error on Windows (MinGW)
error: ‘fabs’ was not declared in this scope
2026-01-03 13:55:12 +01:00
Matthias Melcher
83fab8cb0f Fix Fl_Pack to support more box types.
Old code supported only frame styles, this code
can now handle box types with a background.
2025-12-29 16:21:17 +01:00
Albrecht Schlosser
22c1730261 Add Fl_Scheme::plastic_color_average() method [#464]
This method can be used to set a more appropriate color average to
prevent "graying out" the box colors of the 'plastic' scheme.
Alternatively environment variable 'FLTK_PLASTIC_AVERAGE' can be used
to set the color average value. See docs for details.

Set color average to 45% in test/unittests demo program.
2025-12-25 19:34:08 +01:00
Albrecht Schlosser
ec61d4ff4a Remove dead code from 'plastic' scheme implementation
- The removed code had been disabled in the year 2003 or earlier for
  reasons mentioned in those old commits and has never been officially
  used again. Use `git blame` to find these commits.
- Update comments and copyright.
- Remove empty lines.
2025-12-25 18:29:11 +01:00
Albrecht Schlosser
426dadb0d7 Fix doxygen warning (missing end quote) 2025-12-25 18:18:52 +01:00
ManoloFLTK
0105b593b6 Fix typos in documentation of FL_APP_ACTIVATE 2025-12-23 12:26:31 +01:00
Matthias Melcher
b715850d08 Wayland: Fix FL_APP_ACTIVATE with timer.
Deferred handling of FL_APP_DEACTIVATE works very well.
2025-12-22 00:26:37 +01:00
Matthias Melcher
525db6ddca Wayland: fixes syntax errors
This code generates a lot of
extra events
2025-12-22 00:12:48 +01:00
Matthias Melcher
e4fbf3e6ee Wayland: FL_APP_ACTIVATE and FL_APP_DEACTIVATE
This is an attempt. Will verify on another machine now.
2025-12-21 23:48:03 +01:00