emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 96f60d1033: Fix display class of tooltip frames on Haiku


From: Po Lu
Subject: master 96f60d1033: Fix display class of tooltip frames on Haiku
Date: Fri, 13 May 2022 22:39:45 -0400 (EDT)

branch: master
commit 96f60d1033dfba41fd995657a9afc73742daace6
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    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 b628518c26..b4cdb93b96 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);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]