From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.devel Subject: Re: visible-bell patch for Mac OS X Date: Tue, 02 Feb 2010 10:40:46 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: <87ljffx7zr.fsf@stupidchicken.com> <87bpg90x1s.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1265074869 18979 80.91.229.12 (2 Feb 2010 01:41:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 2 Feb 2010 01:41:09 +0000 (UTC) Cc: Filipe Cabecinhas , emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 02 02:41:06 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Nc7lJ-0002If-MP for ged-emacs-devel@m.gmane.org; Tue, 02 Feb 2010 02:41:06 +0100 Original-Received: from localhost ([127.0.0.1]:44054 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nc7lJ-0005Kr-5X for ged-emacs-devel@m.gmane.org; Mon, 01 Feb 2010 20:41:05 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nc7lC-0005KK-At for emacs-devel@gnu.org; Mon, 01 Feb 2010 20:40:58 -0500 Original-Received: from [199.232.76.173] (port=39366 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nc7lB-0005K6-Nt for emacs-devel@gnu.org; Mon, 01 Feb 2010 20:40:57 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nc7l7-0004Cu-9e for emacs-devel@gnu.org; Mon, 01 Feb 2010 20:40:55 -0500 Original-Received: from ntp.math.s.chiba-u.ac.jp ([133.82.132.2]:61641 helo=mathmail.math.s.chiba-u.ac.jp) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nc7l4-0004Bx-Sw for emacs-devel@gnu.org; Mon, 01 Feb 2010 20:40:51 -0500 Original-Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id DFA5AC0561; Tue, 2 Feb 2010 10:40:46 +0900 (JST) In-Reply-To: User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-detected-operating-system: by monty-python.gnu.org: NetBSD 3.0 (DF) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:120807 Archived-At: >>>>> On Tue, 02 Feb 2010 08:33:22 +0900, YAMAMOTO Mitsuharu said: >>> The patch consists of ~80 lines. Is it considered a "tiny >>> change"? >> I have started the copyright assignment process with Filipe. > Besides that, I'd suggest reverting the patch for now for several > reasons: it does not work on the second frame, it gives inconsistent > flashed area when the scroll bars are placed on the left side, and > it breaks GNUstep builds. And it is also inconsistent when there is a header line at the top, as I pointed out before in the previous proposal for a similar patch by another person: http://lists.gnu.org/archive/html/emacs-devel/2009-03/msg00412.html I tried to do more consistent exclusion of the scroll bars from the flashed area. The patch below is against the Mac port: http://lists.gnu.org/archive/html/emacs-devel/2010-01/msg01487.html YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp === modified file 'src/macterm.c' *** src/macterm.c 2010-01-13 09:32:45 +0000 --- src/macterm.c 2010-02-02 01:19:04 +0000 *************** *** 737,742 **** --- 737,776 ---- } + static void + mac_invert_rectangles (f, rectangles, n) + struct frame *f; + const Rect *rectangles; + int n; + { + int i; + + for (i = 0; i < n; i++) + mac_invert_rectangle (f, rectangles[i].left, rectangles[i].top, + rectangles[i].right - rectangles[i].left, + rectangles[i].bottom - rectangles[i].top); + if (FRAME_HAS_VERTICAL_SCROLL_BARS (f)) + { + Lisp_Object bar; + + if (FRAME_HAS_VERTICAL_SCROLL_BARS (f)) + for (bar = FRAME_SCROLL_BARS (f); !NILP (bar); + bar = XSCROLL_BAR (bar)->next) + { + struct scroll_bar *b = XSCROLL_BAR (bar); + Rect bar_rect, r; + + SetRect (&bar_rect, b->left, b->top, + b->left + b->width, b->top + b->height); + for (i = 0; i < n; i++) + if (SectRect (rectangles + i, &bar_rect, &r)) + mac_invert_rectangle (f, r.left, r.top, + r.right - r.left, r.bottom - r.top); + } + } + } + + /* Mac replacement for XCopyArea: used only for scrolling. */ /* Defined in either mactoolbox.c or macappkit.m. */ *************** *** 2866,2873 **** /* These will be the left and right margins of the rectangles. */ int flash_left = FRAME_INTERNAL_BORDER_WIDTH (f); int flash_right = FRAME_PIXEL_WIDTH (f) - FRAME_INTERNAL_BORDER_WIDTH (f); - int width; /* Don't flash the area between a scroll bar and the frame edge it is next to. */ --- 2900,2908 ---- /* These will be the left and right margins of the rectangles. */ int flash_left = FRAME_INTERNAL_BORDER_WIDTH (f); int flash_right = FRAME_PIXEL_WIDTH (f) - FRAME_INTERNAL_BORDER_WIDTH (f); int width; + Rect rects[2]; + int nrects; /* Don't flash the area between a scroll bar and the frame edge it is next to. */ *************** *** 2887,2910 **** width = flash_right - flash_left; - BLOCK_INPUT; - - /* If window is tall, flash top and bottom line. */ if (height > 3 * FRAME_LINE_HEIGHT (f)) { ! mac_invert_rectangle (f, flash_left, ! (FRAME_INTERNAL_BORDER_WIDTH (f) ! + FRAME_TOOL_BAR_LINES (f) * FRAME_LINE_HEIGHT (f)), ! width, flash_height); ! mac_invert_rectangle (f, flash_left, ! (height - flash_height ! - FRAME_INTERNAL_BORDER_WIDTH (f)), ! width, flash_height); } else ! /* If it is short, flash it all. */ ! mac_invert_rectangle (f, flash_left, FRAME_INTERNAL_BORDER_WIDTH (f), ! width, height - 2 * FRAME_INTERNAL_BORDER_WIDTH (f)); x_flush (f); --- 2922,2953 ---- width = flash_right - flash_left; if (height > 3 * FRAME_LINE_HEIGHT (f)) { ! /* If window is tall, flash top and bottom line. */ ! rects[0].left = rects[1].left = flash_left; ! rects[0].top = (FRAME_INTERNAL_BORDER_WIDTH (f) ! + FRAME_TOP_MARGIN_HEIGHT (f)); ! rects[0].right = rects[1].right = flash_left + width; ! rects[0].bottom = rects[0].top + flash_height; ! rects[1].top = height - flash_height - FRAME_INTERNAL_BORDER_WIDTH (f); ! rects[1].bottom = rects[1].top + flash_height; ! nrects = 2; } else ! { ! /* If it is short, flash it all. */ ! rects[0].left = flash_left; ! rects[0].top = FRAME_INTERNAL_BORDER_WIDTH (f); ! rects[0].right = rects[0].left + width; ! rects[0].bottom = rects[0].top + (height ! - 2 * FRAME_INTERNAL_BORDER_WIDTH (f)); ! nrects = 1; ! } ! ! BLOCK_INPUT; ! ! mac_invert_rectangles (f, rects, nrects); x_flush (f); *************** *** 2940,2961 **** } } ! /* If window is tall, flash top and bottom line. */ ! if (height > 3 * FRAME_LINE_HEIGHT (f)) ! { ! mac_invert_rectangle (f, flash_left, ! (FRAME_INTERNAL_BORDER_WIDTH (f) ! + FRAME_TOOL_BAR_LINES (f) * FRAME_LINE_HEIGHT (f)), ! width, flash_height); ! mac_invert_rectangle (f, flash_left, ! (height - flash_height ! - FRAME_INTERNAL_BORDER_WIDTH (f)), ! width, flash_height); ! } ! else ! /* If it is short, flash it all. */ ! mac_invert_rectangle (f, flash_left, FRAME_INTERNAL_BORDER_WIDTH (f), ! width, height - 2 * FRAME_INTERNAL_BORDER_WIDTH (f)); x_flush (f); --- 2983,2989 ---- } } ! mac_invert_rectangles (f, rects, nrects); x_flush (f);