From: Yuuki Harano Date: Sat, 6 Jul 2019 18:15:20 +0000 (+0900) Subject: Add support for handing the internal border X-Git-Tag: emacs-29.0.90~3842 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=19da22ed25753d0e90b9cbc2c79b37d0aae67712;p=emacs.git Add support for handing the internal border src/pgtkterm.c (pgtk_clear_under_internal_border): remove #if 0 src/pgtkfns.c (x_set_internal_border_width): add clear and fill support internal-border 対応。 --- diff --git a/src/pgtkfns.c b/src/pgtkfns.c index b726d1bcaf4..3f31c086f2d 100644 --- a/src/pgtkfns.c +++ b/src/pgtkfns.c @@ -549,7 +549,6 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) static void x_set_internal_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { -#if 0 int old_width = FRAME_INTERNAL_BORDER_WIDTH (f); CHECK_TYPE_RANGED_INTEGER (int, arg); @@ -564,7 +563,6 @@ x_set_internal_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldva adjust_frame_size (f, -1, -1, 3, 0, Qinternal_border_width); SET_FRAME_GARBAGED (f); -#endif } diff --git a/src/pgtkterm.c b/src/pgtkterm.c index 1c2f0c96487..56a05dac9b8 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c @@ -4734,19 +4734,32 @@ pgtk_clear_under_internal_border (struct frame *f) block_input (); + struct { + int x, y, w, h; + } rects[] = { + { 0, margin, width, border }, + { 0, 0, border, height }, + { width - border, 0, border, height }, + { 0, height - border, width, border }, + }; + if (face) { - pgtk_fill_rectangle (f, color, 0, margin, width, border); - pgtk_fill_rectangle (f, color, 0, 0, border, height); - pgtk_fill_rectangle (f, color, width - border, 0, border, height); - pgtk_fill_rectangle (f, color, 0, height - border, width, border); + for (int i = 0; i < 4; i++) { + int x = rects[i].x; + int y = rects[i].y; + int w = rects[i].w; + int h = rects[i].h; + cairo_surface_t *bg = create_background_surface_by_face (f, face, x, y, w, h); + cairo_set_source_surface (cr, bg, x, y); + cairo_rectangle (cr, x, y, w, h); + cairo_fill (cr); + } } else { - pgtk_clear_area (f, 0, 0, border, height); - pgtk_clear_area (f, 0, margin, width, border); - pgtk_clear_area (f, width - border, 0, border, height); - pgtk_clear_area (f, 0, height - border, width, border); + for (int i = 0; i < 4; i++) + pgtk_clear_area (f, rects[i].x, rects[i].y, rects[i].w, rects[i].h); } unblock_input ();