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: Emacs Mac port Date: Tue, 16 Apr 2013 11:11:40 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: <83ip3p72mz.fsf@gnu.org> <83d2tw73h7.fsf@gnu.org> <8361zo6um1.fsf@gnu.org> <8338us6oz9.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/mixed; boundary="Multipart_Tue_Apr_16_11:11:40_2013-1" X-Trace: ger.gmane.org 1366078316 4659 80.91.229.3 (16 Apr 2013 02:11:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Apr 2013 02:11:56 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 16 04:11:57 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1URvNB-0003rh-CC for ged-emacs-devel@m.gmane.org; Tue, 16 Apr 2013 04:11:53 +0200 Original-Received: from localhost ([::1]:59677 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URvNA-0003Fn-G0 for ged-emacs-devel@m.gmane.org; Mon, 15 Apr 2013 22:11:52 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51803) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URvN6-0003Ff-QO for emacs-devel@gnu.org; Mon, 15 Apr 2013 22:11:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1URvN5-0007aC-Ir for emacs-devel@gnu.org; Mon, 15 Apr 2013 22:11:48 -0400 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:53128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URvN3-0007ZR-AX; Mon, 15 Apr 2013 22:11:45 -0400 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 047FDC055D; Tue, 16 Apr 2013 11:11:40 +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 eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 133.82.132.2 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:158938 Archived-At: --Multipart_Tue_Apr_16_11:11:40_2013-1 Content-Type: text/plain; charset=US-ASCII >>>>> On Tue, 16 Apr 2013 09:17:33 +0900, YAMAMOTO Mitsuharu said: >> Sorry, I don't understand. I was asking why the code that makes >> the corners of the window round cannot be run directly from the GUI >> drawing code of the Mac display back-end, e.g., from the update_end >> method. Why does it _have_ to be run from the expose handler? > I actually tried to round the bottom corners by calling some > undocumented API from update_end_hook in the very first trial. > Repeated rounding made the corner shaper because of anti-aliasing > there. s/shaper/sharper/ The attached images shows the difference. --Multipart_Tue_Apr_16_11:11:40_2013-1 Content-Type: image/png Content-Disposition: inline; filename="normal.png" Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAD7GlDQ1BpY20AAHjajZTPbxRlGMc/ u/POrAk4B1MBi8GJP4CQQrZgk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EQCSZx7Imn3IDvent/ea/72dWHS+asCSSSQRAJJvgBH3ba99rnwZwAA AABJRU5ErkJggg== --Multipart_Tue_Apr_16_11:11:40_2013-1 Content-Type: image/png Content-Disposition: inline; filename="sharper.png" Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAAFwAAABQCAYAAACULRIjAAAD7GlDQ1BpY20AAHjajZTPbxRlGMc/ u/POrAk4B1MBi8GJP4CQQrZgkAZBd7vLtlDLZtti25iY7ezb3bHT2fGd2fIjPXHRG6h/gIocPJh4 MsFfES7AQQMJQUNsSEw4lPgjRBIuhtTDTHcHaMX39Mzzfp/v9/s875OBzOdV33fTFsx6oaqU8tb4 xKSVuUGaZ1hDN2uqduDnyuUhgKrvuzxy7v1MCuDa9pXv//OsqcnAhtQTQLMW2LOQOga6a/sqBOMW sOdo6IeQeRboUuMTk5DJAl31KC4AXVNRPA50qdFKP2RcwLQb1Rpk5oGeqUS+nogjDwB0laQnlWNb lVLeKqvmtOPKhN3HXP/PM+u2lvU2AWuDmZFDwFZIHWuogUocf2JXiyPAi5C67If5CrAZUn+0ZsZy wDZIPzWtDoxF+PSrJxqjbwLrIF1zwsHROH/Cmxo+HNWmz8w0D1VizGU76J8Enof0zYYcHIr8aNRk oQj0gLap0RqI+bWDwdxIcZnnRKN/OOLR1DvVg2WgG7T3VbNyOPKsnZFuqRLxaxf9sBx70BY9d3go 4hSmDIojy/mwMToQ1YrdoRqNa8XktHNgMMbP+255KPImzqpWZSzGXK2qYiniEX9Lbyzm1DfUqoVD wA7Q93MkVUXSZAqJjcd9LCqUyGPho2gyjYNLCYmHROGknmQGZxVcGYmK4w6ijsRjEYWDvQomUrgd Y5pivciKXSIr9oohsU/sEX1Y4jXxutgvCiIr+sTedm05oW9R53ab511aSCwqHCF/uru1taN3Ur3t 2FdO3XmguvmIZ7nsJzkBAmbayO3J/i/Nf7ehw3FdnHvr2tpL8xx+3Hz1W/qifl2/pd/QFzoI/Vd9 QV/Qb5DDxaWOZBa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fa7H72vl8DrnX60EeDAZlOyoUVTgZCScj4WQe7MNP Pb9uNBqQV6sV5PV6Dbnb7WZ+n9FoRFJVDKpwMhJORsLJxNPpFObh2+0WTrDz7dB83Ht+kiSQFwt8 73G5XEK2s5fQ59njaZpmHg+t573enq8KJyPhZCScTHAfnpfQvr5er0PudDqQ2+02ZG/PzpuL7vmq cDISTkbCyVRD8+ui38u069se513/1Nl+P4v7/iNBRcLJSDgZ9z48b08M4f189m9C6DcueNxlQ+RG wslIOJngcynsffWD2YNZ384q2Pty7/3b46pwMhJORsLJ/AfXsex/zo6beAAAAABJRU5ErkJggg== --Multipart_Tue_Apr_16_11:11:40_2013-1 Content-Type: text/plain; charset=US-ASCII Below is the patch of the first trial that I finally rejected myself, against the previous version (emacs-24.3-mac-4.0) of the Mac port. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp === modified file 'src/macappkit.h' *** src/macappkit.h 2013-03-19 06:08:36 +0000 --- src/macappkit.h 2013-04-03 00:24:59 +0000 *************** *** 807,812 **** --- 807,816 ---- @end #endif + @interface NSWindow (Undocumented) + - (void)_maskRoundedBottomCorners:(NSRect)clipRect; + @end + #if MAC_OS_X_VERSION_MAX_ALLOWED < 1060 @interface NSMenu (AvailableOn1060AndLater) - (BOOL)popUpMenuPositioningItem:(NSMenuItem *)item === modified file 'src/macappkit.m' *** src/macappkit.m 2013-04-03 00:08:55 +0000 --- src/macappkit.m 2013-04-03 00:24:59 +0000 *************** *** 3610,3615 **** --- 3610,3616 ---- unset_global_focus_view_frame (); [frameController unlockFocusOnEmacsView]; + mac_mask_rounded_bottom_corners (f); [window enableFlushWindow]; } *************** *** 3715,3720 **** --- 3716,3736 ---- [frameController invalidateCursorRectsForEmacsView]; } + void + mac_mask_rounded_bottom_corners (struct frame *f) + { + NSWindow *window = FRAME_MAC_WINDOW_OBJECT (f); + + if ([window respondsToSelector:@selector(_maskRoundedBottomCorners:)]) + { + NSView *contentView = [window contentView]; + NSRect rect = [contentView visibleRect]; + + rect = [contentView convertRect:rect toView:nil]; + [window _maskRoundedBottomCorners:rect]; + } + } + /************************************************************************ View and Drawing === modified file 'src/macterm.c' *** src/macterm.c 2013-01-12 05:16:32 +0000 --- src/macterm.c 2013-04-03 00:24:59 +0000 *************** *** 2836,2841 **** --- 2836,2842 ---- block_input (); mac_invert_rectangles (f, rects, nrects); + mac_mask_rounded_bottom_corners (f); x_flush (f); *************** *** 2863,2868 **** --- 2864,2870 ---- } mac_invert_rectangles (f, rects, nrects); + mac_mask_rounded_bottom_corners (f); x_flush (f); === modified file 'src/macterm.h' *** src/macterm.h 2013-03-18 02:33:51 +0000 --- src/macterm.h 2013-04-03 00:24:59 +0000 *************** *** 651,656 **** --- 651,657 ---- extern int mac_tracking_area_works_with_cursor_rects_invalidation_p (void); extern void mac_invalidate_frame_cursor_rects (struct frame *f); + extern void mac_mask_rounded_bottom_corners (struct frame *); extern int mac_webkit_supports_svg_p (void); extern CFTypeRef mac_sound_create (Lisp_Object, Lisp_Object); --Multipart_Tue_Apr_16_11:11:40_2013-1--