diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2026-01-19 16:34:50 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2026-01-19 16:34:50 +0100 |
| commit | 61e75e4a12f199368f28dd274d83fc4ecd9cfec3 (patch) | |
| tree | 94c71a1dffe9c6d9ac4a51dbec84561d38828b2c /src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx | |
| parent | 59d93554b3aff9614276fec99792807d77b24ee5 (diff) | |
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.
Diffstat (limited to 'src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx')
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx index c474867d5..3816dff2c 100644 --- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx @@ -53,6 +53,7 @@ extern "C" { bool fl_is_surface_from_GTK_titlebar (struct wl_surface *surface, struct libdecor_frame *frame, bool *using_GTK); } +extern int fl_utf8_remove_context_dependent(char *text, int len); // set this to 1 for keyboard debug output, 0 for no debug output #define DEBUG_KEYBOARD 0 @@ -1017,6 +1018,7 @@ void text_input_commit_string(void *data, struct zwp_text_input_v3 *zwp_text_inp //printf("text_input_commit_string %s\n",text); free(pending_commit); pending_commit = text ? strdup(text) : NULL; + fl_utf8_remove_context_dependent(pending_commit, strlen(pending_commit)); } |
