Subject: bug#25408: Remove Decorations Around Emacs Frame (Windows OS)

From: martin rudalics <[email-masked]>
Date: Sat, 06 May 2017 09:40:28 +0200

> I've run into another small issue: there doesn't seem to be a way to turn off truncation marks in tooltip frames. Is that correct? This bit of xdisp.c seems to take care of that for Emacs' default tip frame; is there a way to emulate this for Lisp-created frames?
 >
 >    /* Get dimensions of truncation and continuation glyphs.  These are
 >       displayed as fringe bitmaps under X, but we need them for such
 >       frames when the fringes are turned off.  But leave the dimensions
 >       zero for tooltip frames, as these glyphs look ugly there and also
 >       sabotage calculations of tooltip dimensions in x-show-tip.  */
 > #ifdef HAVE_WINDOW_SYSTEM
 >    if (!(FRAME_WINDOW_P (it->f)
 > 	&& FRAMEP (tip_frame)
 > 	&& it->f == XFRAME (tip_frame)))
 > #endif

Please try the attached patch (I only checked whether it compiles and
builds on Windows).  You have to add a non-nil 'no-special-glyphs' frame
parameter to suppress such glyphs.

And please test the new behavior for tooltip frames as well.

Thanks, martin
diff --git a/lisp/tooltip.el b/lisp/tooltip.el
index 367114b..5260be2 100644
--- a/lisp/tooltip.el
+++ b/lisp/tooltip.el
@@ -119,7 +119,8 @@ tooltip-y-offset
 (defcustom tooltip-frame-parameters
   '((name . "tooltip")
     (internal-border-width . 2)
-    (border-width . 1))
+    (border-width . 1)
+    (no-special-glyphs . t))
   "Frame parameters used for tooltips.

 If `left' or `top' parameters are included, they specify the absolute
diff --git a/src/frame.c b/src/frame.c
index 4d17a07..920df22 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -684,6 +684,7 @@ struct frame *
   f->horizontal_scroll_bars = false;
   f->want_fullscreen = FULLSCREEN_NONE;
   f->undecorated = false;
+  f->no_special_glyphs = false;
 #ifndef HAVE_NTGUI
   f->override_redirect = false;
 #endif
@@ -3289,6 +3290,7 @@ struct frame_parm_table {
   {"no-accept-focus",		SYMBOL_INDEX (Qno_accept_focus)},
   {"z-group",			SYMBOL_INDEX (Qz_group)},
   {"override-redirect",		SYMBOL_INDEX (Qoverride_redirect)},
+  {"no-special-glyphs",		SYMBOL_INDEX (Qno_special_glyphs)},
 };

 #ifdef HAVE_WINDOW_SYSTEM
@@ -5077,6 +5079,7 @@ or a list (- N) meaning -N pixels relative to bottom/right corner.
   DEFSYM (Qicon, "icon");
   DEFSYM (Qminibuffer, "minibuffer");
   DEFSYM (Qundecorated, "undecorated");
+  DEFSYM (Qno_special_glyphs, "no-special-glyphs");
   DEFSYM (Qparent_frame, "parent-frame");
   DEFSYM (Qskip_taskbar, "skip-taskbar");
   DEFSYM (Qno_focus_on_map, "no-focus-on-map");
diff --git a/src/frame.h b/src/frame.h
index 4aa7c34..6991583 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -354,7 +354,11 @@ struct frame

   /* The z-group this frame's window belongs to. */
   ENUM_BF (z_group) z_group : 2;
-#endif /* HAVE_WINDOW_SYSTEM and not HAVE_NS */
+
+  /* Non-zero if display of truncation and continuation glyphs outside
+     the fringes is suppressed.  */
+  bool_bf no_special_glyphs : 1;
+#endif /* HAVE_WINDOW_SYSTEM */

   /* Whether new_height and new_width shall be interpreted
      in pixels.  */
diff --git a/src/xdisp.c b/src/xdisp.c
index 41458c3..95b8a34 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2838,9 +2838,7 @@ static Lisp_Object calc_line_height_property (struct it *, Lisp_Object,
      zero for tooltip frames, as these glyphs look ugly there and also
      sabotage calculations of tooltip dimensions in x-show-tip.  */
 #ifdef HAVE_WINDOW_SYSTEM
-  if (!(FRAME_WINDOW_P (it->f)
-	&& FRAMEP (tip_frame)
-	&& it->f == XFRAME (tip_frame)))
+  if (!(FRAME_WINDOW_P (it->f) && it->f->no_special_glyphs))
 #endif
     {
       if (it->line_wrap == TRUNCATE)