summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2026-01-12 11:21:48 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2026-01-12 11:21:48 +0100
commit69669256d44b0686db5e4dfe6cdacd56fdcc8608 (patch)
tree74a9522b5de931d1efdaf2935f859e5949b026ce
parentafbdbb25b9dc92460871abbf7e8295b630141d42 (diff)
Restore emojis support under recent macOS versions (#1360)
-rw-r--r--src/Fl_cocoa.mm5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 2a90f5bf1..14f9a557b 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -98,6 +98,8 @@ static BOOL through_drawRect = NO;
static BOOL through_Fl_X_flush = NO;
static BOOL views_use_CA = NO; // YES means views are layer-backed, as on macOS 10.14 when linked with SDK 10.14
static int im_enabled = -1;
+static Fl_Widget *previous_focus = NULL; // restore lost focus when character palette window appears
+
// OS version-dependent pasteboard type names.
// Some, but not all, versions of the 10.6 SDK for PPC lack the 3 symbols below (PR #761)
#if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6) || defined(__POWERPC__)
@@ -1488,6 +1490,7 @@ static FLWindowDelegate *flwindowdelegate_instance = nil;
[nsw setLevel:NSNormalWindowLevel];
fixup_window_levels();
}
+ previous_focus = Fl::focus();
Fl::handle( FL_UNFOCUS, window);
fl_unlock_function();
}
@@ -2940,7 +2943,9 @@ static FLTextInputContext* fltextinputcontext_instance = nil;
// insertText sent during handleEvent of a key without text cannot be processed in a single FL_KEYBOARD event.
// Occurs with deadkey followed by non-text key
if (!in_key_event || !has_text_key) {
+ if (palette && !Fl::focus()) Fl::focus(previous_focus);
Fl::handle(FL_KEYBOARD, target);
+ if (palette) previous_focus = NULL;
Fl::e_length = 0;
}
else need_handle = YES;