From 96f60d1033dfba41fd995657a9afc73742daace6 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sat, 14 May 2022 02:38:53 +0000 Subject: [PATCH] Fix display class of tooltip frames on Haiku * haikufns.c (haiku_create_tip_frame): Set up frame display class. (syms_of_haikufns): New symbols `mono', `grayscale' and `color'. --- src/haikufns.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/haikufns.c b/src/haikufns.c index b628518c26f..b4cdb93b96d 100644 --- a/src/haikufns.c +++ b/src/haikufns.c @@ -1119,6 +1119,23 @@ haiku_create_tip_frame (Lisp_Object parms) /* FIXME - can this be done in a similar way to normal frames? https://lists.gnu.org/r/emacs-devel/2007-10/msg00641.html */ + { + Lisp_Object disptype; + + if (be_get_display_planes () == 1) + disptype = Qmono; + else if (be_is_display_grayscale ()) + disptype = Qgrayscale; + else + disptype = Qcolor; + + if (NILP (Fframe_parameter (frame, Qdisplay_type))) + { + AUTO_FRAME_ARG (arg, Qdisplay_type, disptype); + Fmodify_frame_parameters (frame, arg); + } + } + /* Set up faces after all frame parameters are known. This call also merges in face attributes specified for new frames. @@ -3006,6 +3023,9 @@ syms_of_haikufns (void) DEFSYM (Qstatic_color, "static-color"); DEFSYM (Qstatic_gray, "static-gray"); DEFSYM (Qtrue_color, "true-color"); + DEFSYM (Qmono, "mono"); + DEFSYM (Qgrayscale, "grayscale"); + DEFSYM (Qcolor, "color"); defsubr (&Sx_hide_tip); defsubr (&Sxw_display_color_p); -- 2.39.2