From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
To: rms@gnu.org
Cc: emacs-devel@gnu.org
Subject: Re: Extending fringe backgrounds to scroll bar gaps
Date: Fri, 15 Jun 2007 18:28:13 +0900 [thread overview]
Message-ID: <wlk5u5d0sy.wl%mituharu@math.s.chiba-u.ac.jp> (raw)
In-Reply-To: <E1Hz7Tm-0002QV-RO@fencepost.gnu.org>
>>>>> On Fri, 15 Jun 2007 04:48:26 -0400, Richard Stallman <rms@gnu.org> said:
> I've just installed this change only for Mac Carbon, to the
> trunk. Let's see if it works.
> Thank you. In a month from now, if it works well, could you make it
> apply to all systems?
Yes. But as I can't test it with W32, could Windows users try the
following patch?
YAMAMOTO Mitsuharu
mituharu@math.s.chiba-u.ac.jp
Index: src/w32term.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/w32term.c,v
retrieving revision 1.259
diff -c -p -r1.259 w32term.c
*** src/w32term.c 19 Feb 2007 14:45:39 -0000 1.259
--- src/w32term.c 15 Jun 2007 09:22:53 -0000
*************** w32_draw_fringe_bitmap (w, row, p)
*** 702,709 ****
if (p->bx >= 0 && !p->overlay_p)
{
! w32_fill_area (f, hdc, face->background,
! p->bx, p->by, p->nx, p->ny);
}
if (p->which && p->which < max_fringe_bmp)
--- 702,735 ----
if (p->bx >= 0 && !p->overlay_p)
{
! int bx = p->bx, nx = p->nx;
!
! /* If the fringe is adjacent to the left (right) scroll bar of a
! leftmost (rightmost, respectively) window, then extend its
! background to the gap between the fringe and the bar. */
! if ((WINDOW_LEFTMOST_P (w)
! && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
! || (WINDOW_RIGHTMOST_P (w)
! && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w)))
! {
! int sb_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w);
!
! if (sb_width > 0)
! {
! int left = WINDOW_SCROLL_BAR_AREA_X (w);
! int width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w)
! * FRAME_COLUMN_WIDTH (f));
!
! if (left + width == bx)
! {
! bx = left + sb_width;
! nx += width - sb_width;
! }
! else if (bx + nx == left)
! nx += width - sb_width;
! }
! }
! w32_fill_area (f, hdc, face->background, bx, p->by, nx, p->ny);
}
if (p->which && p->which < max_fringe_bmp)
*************** x_scroll_bar_create (w, top, left, width
*** 3638,3643 ****
--- 3664,3670 ----
XSETINT (bar->start, 0);
XSETINT (bar->end, 0);
bar->dragging = Qnil;
+ bar->fringe_extended_p = Qnil;
/* Requires geometry to be set before call to create the real window */
*************** w32_set_vertical_scroll_bar (w, portion,
*** 3701,3706 ****
--- 3728,3734 ----
struct scroll_bar *bar;
int top, height, left, sb_left, width, sb_width;
int window_y, window_height;
+ int fringe_extended_p;
/* Get window dimensions. */
window_box (w, -1, 0, &window_y, 0, &window_height);
*************** w32_set_vertical_scroll_bar (w, portion,
*** 3720,3728 ****
/* Compute the left edge of the scroll bar. */
if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))
! sb_left = left + width - sb_width - (width - sb_width) / 2;
else
! sb_left = left + (width - sb_width) / 2;
/* Does the scroll bar exist yet? */
if (NILP (w->vertical_scroll_bar))
--- 3748,3767 ----
/* Compute the left edge of the scroll bar. */
if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))
! sb_left = left + (WINDOW_RIGHTMOST_P (w) ? width - sb_width : 0);
else
! sb_left = left + (WINDOW_LEFTMOST_P (w) ? 0 : width - sb_width);
!
! if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
! fringe_extended_p = (WINDOW_LEFTMOST_P (w)
! && WINDOW_LEFT_FRINGE_WIDTH (w)
! && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
! || WINDOW_LEFT_MARGIN_COLS (w) == 0));
! else
! fringe_extended_p = (WINDOW_RIGHTMOST_P (w)
! && WINDOW_RIGHT_FRINGE_WIDTH (w)
! && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
! || WINDOW_RIGHT_MARGIN_COLS (w) == 0));
/* Does the scroll bar exist yet? */
if (NILP (w->vertical_scroll_bar))
*************** w32_set_vertical_scroll_bar (w, portion,
*** 3732,3738 ****
if (width > 0 && height > 0)
{
hdc = get_frame_dc (f);
! w32_clear_area (f, hdc, left, top, width, height);
release_frame_dc (f, hdc);
}
UNBLOCK_INPUT;
--- 3771,3780 ----
if (width > 0 && height > 0)
{
hdc = get_frame_dc (f);
! if (fringe_extended_p)
! w32_clear_area (f, hdc, sb_left, top, sb_width, height);
! else
! w32_clear_area (f, hdc, left, top, width, height);
release_frame_dc (f, hdc);
}
UNBLOCK_INPUT;
*************** w32_set_vertical_scroll_bar (w, portion,
*** 3751,3757 ****
if ( XINT (bar->left) == sb_left
&& XINT (bar->top) == top
&& XINT (bar->width) == sb_width
! && XINT (bar->height) == height )
{
/* Redraw after clear_frame. */
if (!my_show_window (f, hwnd, SW_NORMAL))
--- 3793,3800 ----
if ( XINT (bar->left) == sb_left
&& XINT (bar->top) == top
&& XINT (bar->width) == sb_width
! && XINT (bar->height) == height
! && !NILP (bar->fringe_extended_p) == fringe_extended_p )
{
/* Redraw after clear_frame. */
if (!my_show_window (f, hwnd, SW_NORMAL))
*************** w32_set_vertical_scroll_bar (w, portion,
*** 3768,3778 ****
hdc = get_frame_dc (f);
/* Since Windows scroll bars are smaller than the space reserved
for them on the frame, we have to clear "under" them. */
! w32_clear_area (f, hdc,
! left,
! top,
! width,
! height);
release_frame_dc (f, hdc);
}
/* Make sure scroll bar is "visible" before moving, to ensure the
--- 3811,3820 ----
hdc = get_frame_dc (f);
/* Since Windows scroll bars are smaller than the space reserved
for them on the frame, we have to clear "under" them. */
! if (fringe_extended_p)
! w32_clear_area (f, hdc, sb_left, top, sb_width, height);
! else
! w32_clear_area (f, hdc, left, top, width, height);
release_frame_dc (f, hdc);
}
/* Make sure scroll bar is "visible" before moving, to ensure the
*************** w32_set_vertical_scroll_bar (w, portion,
*** 3802,3807 ****
--- 3844,3851 ----
UNBLOCK_INPUT;
}
}
+ bar->fringe_extended_p = fringe_extended_p ? Qt : Qnil;
+
w32_set_scroll_bar_thumb (bar, portion, position, whole);
XSETVECTOR (w->vertical_scroll_bar, bar);
Index: src/w32term.h
===================================================================
RCS file: /cvsroot/emacs/emacs/src/w32term.h,v
retrieving revision 1.68
diff -c -p -r1.68 w32term.h
*** src/w32term.h 22 Feb 2007 22:50:15 -0000 1.68
--- src/w32term.h 15 Jun 2007 09:22:53 -0000
*************** struct scroll_bar {
*** 487,492 ****
--- 487,496 ----
place where the user grabbed it. If the handle isn't currently
being dragged, this is Qnil. */
Lisp_Object dragging;
+
+ /* t if the background of the fringe that is adjacent to a scroll
+ bar is extended to the gap between the fringe and the bar. */
+ Lisp_Object fringe_extended_p;
};
/* The number of elements a vector holding a struct scroll_bar needs. */
next prev parent reply other threads:[~2007-06-15 9:28 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-06 3:17 Extending fringe backgrounds to scroll bar gaps YAMAMOTO Mitsuharu
2007-03-06 6:39 ` Jan Djärv
2007-03-06 7:02 ` YAMAMOTO Mitsuharu
2007-03-06 8:10 ` Jan Djärv
2007-03-06 22:36 ` Richard Stallman
2007-06-08 10:05 ` YAMAMOTO Mitsuharu
2007-06-10 13:19 ` Richard Stallman
2007-06-14 8:53 ` YAMAMOTO Mitsuharu
2007-06-15 8:48 ` Richard Stallman
2007-06-15 9:28 ` YAMAMOTO Mitsuharu [this message]
2007-06-20 22:42 ` Juanma Barranquero
2007-06-21 2:18 ` YAMAMOTO Mitsuharu
2007-06-21 8:54 ` Juanma Barranquero
2007-06-21 11:30 ` YAMAMOTO Mitsuharu
2007-06-21 11:47 ` Juanma Barranquero
2007-06-21 22:17 ` Juanma Barranquero
2007-06-22 2:14 ` YAMAMOTO Mitsuharu
2007-06-22 8:19 ` Juanma Barranquero
2007-06-23 2:05 ` YAMAMOTO Mitsuharu
2007-06-25 9:45 ` Juanma Barranquero
2007-07-27 8:49 ` YAMAMOTO Mitsuharu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=wlk5u5d0sy.wl%mituharu@math.s.chiba-u.ac.jp \
--to=mituharu@math.s.chiba-u.ac.jp \
--cc=emacs-devel@gnu.org \
--cc=rms@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.