diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/dispextern.h | 4 | ||||
-rw-r--r-- | src/ftfont.c | 17 | ||||
-rw-r--r-- | src/keyboard.c | 15 | ||||
-rw-r--r-- | src/nsterm.m | 25 | ||||
-rw-r--r-- | src/window.c | 7 |
5 files changed, 50 insertions, 18 deletions
diff --git a/src/dispextern.h b/src/dispextern.h index 0615b16d712..4bf9f39cd08 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -123,7 +123,9 @@ typedef HDC Emacs_Pix_Context; #ifdef HAVE_NS #include "nsgui.h" -#define FACE_COLOR_TO_PIXEL(face_color, frame) ns_color_index_to_rgba(face_color, frame) +#define FACE_COLOR_TO_PIXEL(face_color, frame) (FRAME_NS_P (frame) \ + ? ns_color_index_to_rgba (face_color, frame) \ + : face_color) /* Following typedef needed to accommodate the MSDOS port, believe it or not. */ typedef struct ns_display_info Display_Info; typedef Emacs_Pixmap Emacs_Pix_Container; diff --git a/src/ftfont.c b/src/ftfont.c index b8199dc4ba7..5bc048c3003 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -865,6 +865,9 @@ ftfont_list (struct frame *f, Lisp_Object spec) #ifdef FC_FONTFORMAT FC_FONTFORMAT, #endif +#if defined HAVE_XFT && defined FC_COLOR + FC_COLOR, +#endif NULL); if (! objset) goto err; @@ -904,7 +907,19 @@ ftfont_list (struct frame *f, Lisp_Object spec) for (i = 0; i < fontset->nfont; i++) { Lisp_Object entity; - +#if defined HAVE_XFT && defined FC_COLOR + { + /* Some fonts, notably NotoColorEmoji, have an FC_COLOR value + that's neither FcTrue nor FcFalse, which means FcFontList + returns them even when it shouldn't really do so, so we + need to manually skip them here (Bug#37786). */ + FcBool b; + if (Vxft_ignore_color_fonts + && FcPatternGetBool (fontset->fonts[i], FC_COLOR, 0, &b) + == FcResultMatch && b != FcFalse) + continue; + } +#endif if (spacing >= 0) { int this; diff --git a/src/keyboard.c b/src/keyboard.c index 4cf1f64b487..cb311efd7e5 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1318,6 +1318,11 @@ command_loop_1 (void) message1 (0); safe_run_hooks (Qecho_area_clear_hook); + /* We cleared the echo area, and the minibuffer will now + show, so resize the mini-window in case the minibuffer + needs more or less space than the echo area. */ + resize_mini_window (XWINDOW (minibuf_window), false); + unbind_to (count, Qnil); /* If a C-g came in before, treat it as input now. */ @@ -2989,6 +2994,16 @@ read_char (int commandflag, Lisp_Object map, { safe_run_hooks (Qecho_area_clear_hook); clear_message (1, 0); + /* If we were showing the echo-area message on top of an + active minibuffer, resize the mini-window, since the + minibuffer may need more or less space than the echo area + we've just wiped. */ + if (minibuf_level + && EQ (minibuf_window, echo_area_window) + /* The case where minibuffer-message-timeout is a number + was already handled near the beginning of command_loop_1. */ + && !NUMBERP (Vminibuffer_message_timeout)) + resize_mini_window (XWINDOW (minibuf_window), false); } else if (FUNCTIONP (Vclear_message_function)) clear_message (1, 0); diff --git a/src/nsterm.m b/src/nsterm.m index c575e6c100c..ab571e4a1a7 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -2290,26 +2290,21 @@ ns_lisp_to_color (Lisp_Object color, NSColor **col) /* Convert an index into the color table into an RGBA value. Used in xdisp.c:extend_face_to_end_of_line when comparing faces and frame - color values. No-op on non-gui frames. */ + color values. */ unsigned long ns_color_index_to_rgba(int idx, struct frame *f) { - if (FRAME_DISPLAY_INFO (f)) - { - NSColor *col; - col = ns_lookup_indexed_color (idx, f); + NSColor *col; + col = ns_lookup_indexed_color (idx, f); - EmacsCGFloat r, g, b, a; - [col getRed: &r green: &g blue: &b alpha: &a]; + EmacsCGFloat r, g, b, a; + [col getRed: &r green: &g blue: &b alpha: &a]; - return ARGB_TO_ULONG((unsigned long) (a * 255), - (unsigned long) (r * 255), - (unsigned long) (g * 255), - (unsigned long) (b * 255)); - } - else - return idx; + return ARGB_TO_ULONG((unsigned long) (a * 255), + (unsigned long) (r * 255), + (unsigned long) (g * 255), + (unsigned long) (b * 255)); } void @@ -2330,7 +2325,7 @@ ns_query_color(void *col, Emacs_Color *color_def, bool setPixel) if (setPixel == YES) color_def->pixel = ARGB_TO_ULONG((unsigned long) (a * 255), - (unsigned long) (r * 255), + (unsigned long) (r * 255), (unsigned long) (g * 255), (unsigned long) (b * 255)); } diff --git a/src/window.c b/src/window.c index c52a8ca2855..1962e07f8d0 100644 --- a/src/window.c +++ b/src/window.c @@ -5229,10 +5229,15 @@ grow_mini_window (struct window *w, int delta) { struct frame *f = XFRAME (w->frame); int old_height = window_body_height (w, true); + int min_height = FRAME_LINE_HEIGHT (f); eassert (MINI_WINDOW_P (w)); - if ((delta != 0) && (old_height + delta >= FRAME_LINE_HEIGHT (f))) + /* Never shrink mini-window to less than its minimum height. */ + if (old_height + delta < min_height) + delta = old_height > min_height ? min_height - old_height : 0; + + if (delta != 0) { Lisp_Object root = FRAME_ROOT_WINDOW (f); struct window *r = XWINDOW (root); |