From 19da22ed25753d0e90b9cbc2c79b37d0aae67712 Mon Sep 17 00:00:00 2001 From: Yuuki Harano Date: Sun, 7 Jul 2019 03:15:20 +0900 Subject: [PATCH] Add support for handing the internal border MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 対応。 --- src/pgtkfns.c | 2 -- src/pgtkterm.c | 29 +++++++++++++++++++++-------- 2 files changed, 21 insertions(+), 10 deletions(-) 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 (); -- 2.39.5