From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: Cursor in non-selected windows is 1 pixel too small Date: Sat, 04 Mar 2006 23:19:40 +0100 Message-ID: References: <44081767.4010004@iue.tuwien.ac.at> <44096641.8080505@iue.tuwien.ac.at> <44096CE7.9050202@iue.tuwien.ac.at> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1141530642 13205 80.91.229.2 (5 Mar 2006 03:50:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 5 Mar 2006 03:50:42 +0000 (UTC) Cc: Markus Gritsch , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 05 04:50:41 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FFkGU-0004gE-TT for ged-emacs-devel@m.gmane.org; Sun, 05 Mar 2006 04:50:39 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FFkGa-0003Tl-7w for ged-emacs-devel@m.gmane.org; Sat, 04 Mar 2006 22:50:44 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FFgOa-00083y-Ks for emacs-devel@gnu.org; Sat, 04 Mar 2006 18:42:44 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FFgOU-0007t9-EW for emacs-devel@gnu.org; Sat, 04 Mar 2006 18:42:41 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FFgOP-0007sg-Nr for emacs-devel@gnu.org; Sat, 04 Mar 2006 18:42:33 -0500 Original-Received: from [193.162.153.9] (helo=pqueuea.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FFgQJ-00073V-7x; Sat, 04 Mar 2006 18:44:31 -0500 Original-Received: from pfepb.post.tele.dk (pfepb.post.tele.dk [195.41.46.236]) by pqueuea.post.tele.dk (Postfix) with ESMTP id 9524A376F4D; Sat, 4 Mar 2006 23:21:49 +0100 (CET) Original-Received: from kfs-l.imdomain.dk.cua.dk (0x503e2644.bynxx3.adsl-dhcp.tele.dk [80.62.38.68]) by pfepb.post.tele.dk (Postfix) with SMTP id CB8EBA50022; Sat, 4 Mar 2006 23:21:21 +0100 (CET) Original-To: Eli Zaretskii In-Reply-To: (Eli Zaretskii's message of "Sat, 04 Mar 2006 16:16:03 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:51212 Archived-At: Eli Zaretskii writes: >> Date: Sat, 04 Mar 2006 11:33:11 +0100 >> From: Markus Gritsch >> CC: emacs-devel@gnu.org >> >> I am also using WinXP. The attached screenshot shows an Emacs started >> with -q. The cursor seen there in the lower window is clearly one pixel >> smaller in vertical direction. > > Well, I wouldn't say it's ``clearly one pixel smaller''. Perhaps I'm > too blind. > > Anyway, I eventually convinced myself you were right. Does the > following patch give good results? > >> You are of course running a recent CVS Emacs, arn't you? > > Yes. > > Btw, I'm not sure I understand why xdisp.c:get_phys_cursor_geometry > decrements by one the value of height it computes: > > *heightp = h - 1; > > Kim, can you comment on that? The code in xdisp.c:get_phys_cursor_geometry is simply based on the code in xterm.c, w32term.c and macterm.c when I merged the X, W32, and MAC codes for cursor display. I didn't validate that the functionality was sensible -- only that the code on all three cases was identical. > Is it possible that this problem is not > specific to MS-Windows? I believe it works for X, fails for w32, and ... MAC? However, it does seem to make sense to fix the height returned by get_phys_cursor_geometry (don't subtract 1), and then fix the use in xterm.c and macterm.c(?) to subtract 1 from the returned height. (and leave w32termc. as is). Will you make those changes? > > > Index: src/w32term.c > =================================================================== > RCS file: /cvsroot/emacs/emacs/src/w32term.c,v > retrieving revision 1.238 > diff -u -p -r1.238 w32term.c > --- src/w32term.c 6 Feb 2006 15:23:22 -0000 1.238 > +++ src/w32term.c 4 Mar 2006 14:11:40 -0000 > @@ -4946,7 +4946,7 @@ x_draw_hollow_cursor (w, row) > /* Compute frame-relative coordinates for phys cursor. */ > rect.left = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x); > rect.top = get_phys_cursor_geometry (w, row, cursor_glyph, &h); > - rect.bottom = rect.top + h; > + rect.bottom = rect.top + h + 1; > rect.right = rect.left + w->phys_cursor_width; > > hdc = get_frame_dc (f); > > > _______________________________________________ > Emacs-devel mailing list > Emacs-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-devel > > -- Kim F. Storm http://www.cua.dk