From 67685de75c2223443db892695cbc0af283839db6 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sun, 22 May 2022 05:03:12 +0000 Subject: [PATCH] Fix focus redirection to/from surrogate minibuffer frames on Haiku * src/haikuterm.c (haiku_get_focus_frame): New function. (haiku_create_terminal): Register new hook. --- src/haikuterm.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/haikuterm.c b/src/haikuterm.c index 6401ea12330..47cffded48d 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c @@ -3960,6 +3960,21 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) return message_count; } +static Lisp_Object +haiku_get_focus_frame (struct frame *f) +{ + Lisp_Object lisp_focus; + struct frame *focus; + + focus = FRAME_DISPLAY_INFO (f)->focused_frame; + + if (!focus) + return Qnil; + + XSETFRAME (lisp_focus, focus); + return lisp_focus; +} + static void haiku_frame_rehighlight (struct frame *frame) { @@ -4185,6 +4200,7 @@ haiku_create_terminal (struct haiku_display_info *dpyinfo) terminal->fullscreen_hook = haiku_fullscreen; terminal->toolkit_position_hook = haiku_toolkit_position; terminal->activate_menubar_hook = haiku_activate_menubar; + terminal->get_focus_frame = haiku_get_focus_frame; return terminal; } -- 2.39.2