all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] Fix display box cursor under image with margins
@ 2020-04-18 17:28 Evgeny Zajcev
  2020-04-18 17:44 ` Eli Zaretskii
  0 siblings, 1 reply; 21+ messages in thread
From: Evgeny Zajcev @ 2020-04-18 17:28 UTC (permalink / raw)
  To: emacs-devel


[-- 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


^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2020-07-24 11:45 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-18 17:28 [PATCH] Fix display box cursor under image with margins Evgeny Zajcev
2020-04-18 17:44 ` 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

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.