all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Evgeny Zajcev <lg.zevlg@gmail.com>
To: emacs-devel <emacs-devel@gnu.org>
Subject: [PATCH] Fix display box cursor under image with margins
Date: Sat, 18 Apr 2020 20:28:26 +0300	[thread overview]
Message-ID: <CAO=W_Zq=LRzRtWszXC=mEf_MTd9uVw+m3up3Q2_7DjuROrQ9VA@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 180 bytes --]

Here is the patch to fix issue making cursor hollow under non-mask image,
but containing margins.  This patch keeps box cursor to be box in case
image has margins.

Thanks

-- 
lg

[-- Attachment #1.2: Type: text/html, Size: 336 bytes --]

[-- Attachment #2: 0001-Fix-display-box-cursor-under-image-with-margins.patch --]
[-- Type: text/x-patch, Size: 1336 bytes --]

From f63be59b0be41d0a96eb83e1ba2926d332311bca Mon Sep 17 00:00:00 2001
From: Zajcev Evgeny <zevlg@yandex.ru>
Date: Sat, 18 Apr 2020 20:22:40 +0300
Subject: [PATCH] Fix display box cursor under image with margins

* src/xdisp.c (get_window_cursor_type): Do not make box cursor hollow
if cursor is under image with any margin.
---
 src/xdisp.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/xdisp.c b/src/xdisp.c
index 193cc372b0..d3294e1e99 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -30896,10 +30896,11 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width,
 		     font size.  So, setting cursor-type to (box . 32)
 		     should cover most of the "tiny" icons people may
 		     use.  */
-		  if (!img->mask
-		      || (CONSP (BVAR (b, cursor_type))
-			  && img->width > max (*width, WINDOW_FRAME_COLUMN_WIDTH (w))
-			  && img->height > max (*width, WINDOW_FRAME_LINE_HEIGHT (w))))
+		  if (!img->hmargin && !img->vmargin
+                      && (!img->mask
+                          || (CONSP (BVAR (b, cursor_type))
+                              && img->width > max (*width, WINDOW_FRAME_COLUMN_WIDTH (w))
+                              && img->height > max (*width, WINDOW_FRAME_LINE_HEIGHT (w)))))
 		    cursor_type = HOLLOW_BOX_CURSOR;
 		}
 	    }
-- 
2.17.1


             reply	other threads:[~2020-04-18 17:28 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-18 17:28 Evgeny Zajcev [this message]
2020-04-18 17:44 ` [PATCH] Fix display box cursor under image with margins Eli Zaretskii
2020-04-18 18:05   ` Evgeny Zajcev
2020-04-25 10:35     ` Eli Zaretskii
2020-04-25 10:48       ` Evgeny Zajcev
2020-04-25 10:55       ` Evgeny Zajcev
2020-04-25 11:22       ` Basil L. Contovounesios
2020-04-25 13:19       ` Clément Pit-Claudel
2020-04-25 12:09     ` Stefan Monnier
2020-04-25 12:44       ` Evgeny Zajcev
2020-04-25 13:57       ` Evgeny Zajcev
2020-05-10 12:14         ` Evgeny Zajcev
2020-05-10 14:09           ` Eli Zaretskii
2020-06-13 15:55             ` Basil L. Contovounesios
2020-07-24 11:45               ` Stefan Kangas
2020-05-10 12:52         ` Stefan Kangas
2020-05-10 14:08           ` Evgeny Zajcev
2020-05-10 15:38             ` Michael Welsh Duggan
2020-05-10 16:48               ` Stefan Monnier
2020-05-11 15:51             ` Stefan Kangas
2020-05-11 16:34               ` andres.ramirez

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='CAO=W_Zq=LRzRtWszXC=mEf_MTd9uVw+m3up3Q2_7DjuROrQ9VA@mail.gmail.com' \
    --to=lg.zevlg@gmail.com \
    --cc=emacs-devel@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.