unofficial mirror of emacs-devel@gnu.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

* Re: [PATCH] Fix display box cursor under image with margins
  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
  0 siblings, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2020-04-18 17:44 UTC (permalink / raw)
  To: Evgeny Zajcev; +Cc: emacs-devel

> From: Evgeny Zajcev <lg.zevlg@gmail.com>
> Date: Sat, 18 Apr 2020 20:28:26 +0300
> 
> 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.

Could you please give an example of such an image and what the results
look like, before and after the patch?  It's hard to understand the
details of this otherwise.

Thanks.



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

* Re: [PATCH] Fix display box cursor under image with margins
  2020-04-18 17:44 ` Eli Zaretskii
@ 2020-04-18 18:05   ` Evgeny Zajcev
  2020-04-25 10:35     ` Eli Zaretskii
  2020-04-25 12:09     ` Stefan Monnier
  0 siblings, 2 replies; 21+ messages in thread
From: Evgeny Zajcev @ 2020-04-18 18:05 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 836 bytes --]

сб, 18 апр. 2020 г. в 20:44, Eli Zaretskii <eliz@gnu.org>:

> > From: Evgeny Zajcev <lg.zevlg@gmail.com>
> > Date: Sat, 18 Apr 2020 20:28:26 +0300
> >
> > 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.
>
> Could you please give an example of such an image and what the results
> look like, before and after the patch?  It's hard to understand the
> details of this otherwise.
>

Here is first screenshot how hollow cursor looks on image with margin -
http://lgarc.narod.ru/pics/emacs-hollow-cursor.png

And here is how it looks with patch applied -
http://lgarc.narod.ru/pics/emacs-box-cursor.png

Without patch, look of the cursor won't change, it will remain being hollow

-- 
lg

[-- Attachment #2: Type: text/html, Size: 1476 bytes --]

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

* Re: [PATCH] Fix display box cursor under image with margins
  2020-04-18 18:05   ` Evgeny Zajcev
@ 2020-04-25 10:35     ` Eli Zaretskii
  2020-04-25 10:48       ` Evgeny Zajcev
                         ` (3 more replies)
  2020-04-25 12:09     ` Stefan Monnier
  1 sibling, 4 replies; 21+ messages in thread
From: Eli Zaretskii @ 2020-04-25 10:35 UTC (permalink / raw)
  To: Evgeny Zajcev; +Cc: emacs-devel

> From: Evgeny Zajcev <lg.zevlg@gmail.com>
> Date: Sat, 18 Apr 2020 21:05:16 +0300
> Cc: emacs-devel <emacs-devel@gnu.org>
> 
>  > 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.
> 
>  Could you please give an example of such an image and what the results
>  look like, before and after the patch?  It's hard to understand the
>  details of this otherwise.
> 
> Here is first screenshot how hollow cursor looks on image with margin -
> http://lgarc.narod.ru/pics/emacs-hollow-cursor.png
> 
> And here is how it looks with patch applied - http://lgarc.narod.ru/pics/emacs-box-cursor.png
> 
> Without patch, look of the cursor won't change, it will remain being hollow

Thanks.  Frankly, I'm not sure the change is for the better.

Does anyone else have an opinion?



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

* Re: [PATCH] Fix display box cursor under image with margins
  2020-04-25 10:35     ` Eli Zaretskii
@ 2020-04-25 10:48       ` Evgeny Zajcev
  2020-04-25 10:55       ` Evgeny Zajcev
                         ` (2 subsequent siblings)
  3 siblings, 0 replies; 21+ messages in thread
From: Evgeny Zajcev @ 2020-04-25 10:48 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1274 bytes --]

сб, 25 апр. 2020 г. в 13:35, Eli Zaretskii <eliz@gnu.org>:

> > From: Evgeny Zajcev <lg.zevlg@gmail.com>
> > Date: Sat, 18 Apr 2020 21:05:16 +0300
> > Cc: emacs-devel <emacs-devel@gnu.org>
> >
> >  > 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.
> >
> >  Could you please give an example of such an image and what the results
> >  look like, before and after the patch?  It's hard to understand the
> >  details of this otherwise.
> >
> > Here is first screenshot how hollow cursor looks on image with margin -
> > http://lgarc.narod.ru/pics/emacs-hollow-cursor.png
> >
> > And here is how it looks with patch applied -
> http://lgarc.narod.ru/pics/emacs-box-cursor.png
> >
> > Without patch, look of the cursor won't change, it will remain being
> hollow
>
> Thanks.  Frankly, I'm not sure the change is for the better.
>
> Probably, the best we can do is to have box-outline cursor type to make
box cursor have that one-line outline box as hollow cursor has.  And change
cursor type to box-outline when cursor is under the image.  It will combine
all the prons from box and hollow cursor type

-- 
lg

[-- Attachment #2: Type: text/html, Size: 2017 bytes --]

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

* Re: [PATCH] Fix display box cursor under image with margins
  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
  3 siblings, 0 replies; 21+ messages in thread
From: Evgeny Zajcev @ 2020-04-25 10:55 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1269 bytes --]

сб, 25 апр. 2020 г. в 13:35, Eli Zaretskii <eliz@gnu.org>:

> > From: Evgeny Zajcev <lg.zevlg@gmail.com>
> > Date: Sat, 18 Apr 2020 21:05:16 +0300
> > Cc: emacs-devel <emacs-devel@gnu.org>
> >
> >  > 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.
> >
> >  Could you please give an example of such an image and what the results
> >  look like, before and after the patch?  It's hard to understand the
> >  details of this otherwise.
> >
> > Here is first screenshot how hollow cursor looks on image with margin -
> > http://lgarc.narod.ru/pics/emacs-hollow-cursor.png
> >
> > And here is how it looks with patch applied -
> http://lgarc.narod.ru/pics/emacs-box-cursor.png
> >
> > Without patch, look of the cursor won't change, it will remain being
> hollow
>
> Thanks.  Frankly, I'm not sure the change is for the better.
>
> Does anyone else have an opinion?
>

For me there is two problems with the hollow cursor under images:
1) You can't distinguish which window is active, since cursor is also
hollow in other window
2) Hollow cursor is barely visible on small screens with high ppi

-- 
lg

[-- Attachment #2: Type: text/html, Size: 2128 bytes --]

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

* Re: [PATCH] Fix display box cursor under image with margins
  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
  3 siblings, 0 replies; 21+ messages in thread
From: Basil L. Contovounesios @ 2020-04-25 11:22 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Evgeny Zajcev, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Evgeny Zajcev <lg.zevlg@gmail.com>
>> Date: Sat, 18 Apr 2020 21:05:16 +0300
>> Cc: emacs-devel <emacs-devel@gnu.org>
>> 
>>  > 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.
>> 
>>  Could you please give an example of such an image and what the results
>>  look like, before and after the patch?  It's hard to understand the
>>  details of this otherwise.
>> 
>> Here is first screenshot how hollow cursor looks on image with margin -
>> http://lgarc.narod.ru/pics/emacs-hollow-cursor.png
>> 
>> And here is how it looks with patch applied - http://lgarc.narod.ru/pics/emacs-box-cursor.png
>> 
>> Without patch, look of the cursor won't change, it will remain being hollow
>
> Thanks.  Frankly, I'm not sure the change is for the better.
>
> Does anyone else have an opinion?

I think the existing hollow cursor makes it more obvious that the cursor
is over an image; the latter doesn't really betray the fact that it's a
cursor, at least to my eyes.  That said, I wouldn't be opposed to new
cursor types.

-- 
Basil



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

* Re: [PATCH] Fix display box cursor under image with margins
  2020-04-18 18:05   ` Evgeny Zajcev
  2020-04-25 10:35     ` Eli Zaretskii
@ 2020-04-25 12:09     ` Stefan Monnier
  2020-04-25 12:44       ` Evgeny Zajcev
  2020-04-25 13:57       ` Evgeny Zajcev
  1 sibling, 2 replies; 21+ messages in thread
From: Stefan Monnier @ 2020-04-25 12:09 UTC (permalink / raw)
  To: Evgeny Zajcev; +Cc: Eli Zaretskii, emacs-devel

> Here is first screenshot how hollow cursor looks on image with margin -
> http://lgarc.narod.ru/pics/emacs-hollow-cursor.png
>
> And here is how it looks with patch applied -
> http://lgarc.narod.ru/pics/emacs-box-cursor.png

Would it be possible to keep the two thin horizontal lines when the
window is active?

> Without patch, look of the cursor won't change, it will remain being hollow

Did you mean "without margin" instead of "without patch"?


        Stefan




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

* Re: [PATCH] Fix display box cursor under image with margins
  2020-04-25 12:09     ` Stefan Monnier
@ 2020-04-25 12:44       ` Evgeny Zajcev
  2020-04-25 13:57       ` Evgeny Zajcev
  1 sibling, 0 replies; 21+ messages in thread
From: Evgeny Zajcev @ 2020-04-25 12:44 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Eli Zaretskii, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 827 bytes --]

сб, 25 апр. 2020 г. в 15:09, Stefan Monnier <monnier@iro.umontreal.ca>:

> > Here is first screenshot how hollow cursor looks on image with margin -
> > http://lgarc.narod.ru/pics/emacs-hollow-cursor.png
> >
> > And here is how it looks with patch applied -
> > http://lgarc.narod.ru/pics/emacs-box-cursor.png
>
> Would it be possible to keep the two thin horizontal lines when the
> window is active?
>

Yes, creating those outlines as for hollow cursor (but keeping box cursor)
would be the best solution.  However it is harder to implement, I'll look
into

> Without patch, look of the cursor won't change, it will remain being
> hollow
>

Did you mean "without margin" instead of "without patch"
>

I mean if patch is not applied, then cursor will look as on the first
screenshot

-- 
lg

[-- Attachment #2: Type: text/html, Size: 1758 bytes --]

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

* Re: [PATCH] Fix display box cursor under image with margins
  2020-04-25 10:35     ` Eli Zaretskii
                         ` (2 preceding siblings ...)
  2020-04-25 11:22       ` Basil L. Contovounesios
@ 2020-04-25 13:19       ` Clément Pit-Claudel
  3 siblings, 0 replies; 21+ messages in thread
From: Clément Pit-Claudel @ 2020-04-25 13:19 UTC (permalink / raw)
  To: emacs-devel

On 25/04/2020 06.35, Eli Zaretskii wrote:
>> From: Evgeny Zajcev <lg.zevlg@gmail.com>
>> Date: Sat, 18 Apr 2020 21:05:16 +0300
>> Cc: emacs-devel <emacs-devel@gnu.org>
>>
>>  > 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.
>>
>>  Could you please give an example of such an image and what the results
>>  look like, before and after the patch?  It's hard to understand the
>>  details of this otherwise.
>>
>> Here is first screenshot how hollow cursor looks on image with margin -
>> http://lgarc.narod.ru/pics/emacs-hollow-cursor.png
>>
>> And here is how it looks with patch applied - http://lgarc.narod.ru/pics/emacs-box-cursor.png
>>
>> Without patch, look of the cursor won't change, it will remain being hollow
> 
> Thanks.  Frankly, I'm not sure the change is for the better.
> 
> Does anyone else have an opinion?

I'm not sure I understood the patch fully; it seems to be about displaying two lines instead of a box?  If so, I think I prefer the box (but generally speaking, respecting the cursor shape would be ideal (using a bar when the cursor is a bar, and replacing the background of the image when the cursor is a box)



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

* Re: [PATCH] Fix display box cursor under image with margins
  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 12:52         ` Stefan Kangas
  1 sibling, 2 replies; 21+ messages in thread
From: Evgeny Zajcev @ 2020-04-25 13:57 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Eli Zaretskii, emacs-devel


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

сб, 25 апр. 2020 г. в 15:09, Stefan Monnier <monnier@iro.umontreal.ca>:

> > Here is first screenshot how hollow cursor looks on image with margin -
> > http://lgarc.narod.ru/pics/emacs-hollow-cursor.png
> >
> > And here is how it looks with patch applied -
> > http://lgarc.narod.ru/pics/emacs-box-cursor.png
>
> Would it be possible to keep the two thin horizontal lines when the
> window is active?
>
>
I figured out, how to do this in "easy" way.  Here is patches update

And screenshots: http://lgarc.narod.ru/pics/emacs-box-margin1.png
http://lgarc.narod.ru/pics/emacs-box-margin2.png

This patch introduces new cursor type - COMBINED_BOX_CURSOR (used only
internally for box cursor under images with mask or margins)

Thanks

-- 
lg

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

[-- Attachment #2: 0001-Fix-display-box-cursor-under-image-with-margins.patch --]
[-- Type: text/x-patch, Size: 1340 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 1/2] 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


[-- Attachment #3: 0002-New-COMBINED_BOX_CURSOR-cursor-type-introduced-for-i.patch --]
[-- Type: text/x-patch, Size: 3123 bytes --]

From d95e7c992b62d17a01637165cc5530fe435ab3a7 Mon Sep 17 00:00:00 2001
From: Zajcev Evgeny <zevlg@yandex.ru>
Date: Sat, 25 Apr 2020 16:51:04 +0300
Subject: [PATCH 2/2] New COMBINED_BOX_CURSOR cursor type introduced for
 internal use

* src/dispextern.h (text_cursor_kinds): COMBINED_BOX_CURSOR added

* src/w32term.c, src/xterm.c: Support for COMBINED_BOX_CURSOR cursor
  type

* src/xdisp.c (get_window_cursor_type): Use COMBINED_BOX_CURSOR for
  box cursor under images with mask or any margin
---
 src/dispextern.h |  7 ++++++-
 src/w32term.c    |  3 +++
 src/xdisp.c      | 10 +++++-----
 src/xterm.c      |  3 +++
 4 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/src/dispextern.h b/src/dispextern.h
index ae994d7f9b..a1a0922e92 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -156,7 +156,12 @@ #define NativeRectangle int
   FILLED_BOX_CURSOR,
   HOLLOW_BOX_CURSOR,
   BAR_CURSOR,
-  HBAR_CURSOR
+  HBAR_CURSOR,
+
+  /* box cursor combining FILLED_BOX_CURSOR and HOLLOW_BOX_CURSOR
+   * For internal use only
+   */
+  COMBINED_BOX_CURSOR
 };
 
 /* Values returned from coordinates_in_window.  */
diff --git a/src/w32term.c b/src/w32term.c
index 5fa77d58e1..49cd3e4a8c 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -6069,6 +6069,9 @@ w32_draw_window_cursor (struct window *w, struct glyph_row *glyph_row,
 
       switch (cursor_type)
 	{
+	case COMBINED_BOX_CURSOR:
+	  draw_phys_cursor_glyph (w, glyph_row, DRAW_CURSOR);
+          /* FALLTHROUGH */
 	case HOLLOW_BOX_CURSOR:
 	  w32_draw_hollow_cursor (w, glyph_row);
 	  break;
diff --git a/src/xdisp.c b/src/xdisp.c
index d3294e1e99..7fc07f4691 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -30896,11 +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->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)))))
+                  if (img->mask || img->hmargin || img->vmargin)
+                    cursor_type = COMBINED_BOX_CURSOR;
+                  else if (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;
 		}
 	    }
diff --git a/src/xterm.c b/src/xterm.c
index ae5dad9289..0f1ec4dec3 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -9670,6 +9670,9 @@ x_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, int x,
 	{
 	  switch (cursor_type)
 	    {
+            case COMBINED_BOX_CURSOR:
+	      draw_phys_cursor_glyph (w, glyph_row, DRAW_CURSOR);
+              /* FALLTHROUGH */
 	    case HOLLOW_BOX_CURSOR:
 	      x_draw_hollow_cursor (w, glyph_row);
 	      break;
-- 
2.17.1


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

* Re: [PATCH] Fix display box cursor under image with margins
  2020-04-25 13:57       ` Evgeny Zajcev
@ 2020-05-10 12:14         ` Evgeny Zajcev
  2020-05-10 14:09           ` Eli Zaretskii
  2020-05-10 12:52         ` Stefan Kangas
  1 sibling, 1 reply; 21+ messages in thread
From: Evgeny Zajcev @ 2020-05-10 12:14 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Eli Zaretskii, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1077 bytes --]

сб, 25 апр. 2020 г. в 16:57, Evgeny Zajcev <lg.zevlg@gmail.com>:

>
>
> сб, 25 апр. 2020 г. в 15:09, Stefan Monnier <monnier@iro.umontreal.ca>:
>
>> > Here is first screenshot how hollow cursor looks on image with margin -
>> > http://lgarc.narod.ru/pics/emacs-hollow-cursor.png
>> >
>> > And here is how it looks with patch applied -
>> > http://lgarc.narod.ru/pics/emacs-box-cursor.png
>>
>> Would it be possible to keep the two thin horizontal lines when the
>> window is active?
>>
>>
> I figured out, how to do this in "easy" way.  Here is patches update
>
> And screenshots: http://lgarc.narod.ru/pics/emacs-box-margin1.png
> http://lgarc.narod.ru/pics/emacs-box-margin2.png
>
> This patch introduces new cursor type - COMBINED_BOX_CURSOR (used only
> internally for box cursor under images with mask or margins)
>
> Thanks
>

JFYI: I've been runing Emacs with this patch for two weeks without any
issues

GNU Emacs 28.0.50 (build 7, x86_64-pc-linux-gnu, GTK+ Version 3.22.30,
cairo version 1.15.10) of 2020-04-25

-- 
lg

[-- Attachment #2: Type: text/html, Size: 2247 bytes --]

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

* Re: [PATCH] Fix display box cursor under image with margins
  2020-04-25 13:57       ` Evgeny Zajcev
  2020-05-10 12:14         ` Evgeny Zajcev
@ 2020-05-10 12:52         ` Stefan Kangas
  2020-05-10 14:08           ` Evgeny Zajcev
  1 sibling, 1 reply; 21+ messages in thread
From: Stefan Kangas @ 2020-05-10 12:52 UTC (permalink / raw)
  To: Evgeny Zajcev, Stefan Monnier; +Cc: Eli Zaretskii, emacs-devel

Evgeny Zajcev <lg.zevlg@gmail.com> writes:

> сб, 25 апр. 2020 г. в 15:09, Stefan Monnier <monnier@iro.umontreal.ca>:
>
>> > Here is first screenshot how hollow cursor looks on image with margin -
>> > http://lgarc.narod.ru/pics/emacs-hollow-cursor.png
>> >
>> > And here is how it looks with patch applied -
>> > http://lgarc.narod.ru/pics/emacs-box-cursor.png
>>
>> Would it be possible to keep the two thin horizontal lines when the
>> window is active?
>>
> I figured out, how to do this in "easy" way.  Here is patches update
>
> And screenshots: http://lgarc.narod.ru/pics/emacs-box-margin1.png
> http://lgarc.narod.ru/pics/emacs-box-margin2.png

I think your second set of screenshots looks better.

But the horizontal lines are not thin, right?

What happens when you switch the active window?  Will the cursor change
the size of that line, causing things to move vertically?  And what's
the result when you have many images in a buffer, as in image-dired?

Best regards,
Stefan Kangas



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

* Re: [PATCH] Fix display box cursor under image with margins
  2020-05-10 12:52         ` Stefan Kangas
@ 2020-05-10 14:08           ` Evgeny Zajcev
  2020-05-10 15:38             ` Michael Welsh Duggan
  2020-05-11 15:51             ` Stefan Kangas
  0 siblings, 2 replies; 21+ messages in thread
From: Evgeny Zajcev @ 2020-05-10 14:08 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Eli Zaretskii, Stefan Monnier, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1698 bytes --]

вс, 10 мая 2020 г. в 15:52, Stefan Kangas <stefankangas@gmail.com>:

> Evgeny Zajcev <lg.zevlg@gmail.com> writes:
>
> > сб, 25 апр. 2020 г. в 15:09, Stefan Monnier <monnier@iro.umontreal.ca>:
> >
> >> > Here is first screenshot how hollow cursor looks on image with margin
> -
> >> > http://lgarc.narod.ru/pics/emacs-hollow-cursor.png
> >> >
> >> > And here is how it looks with patch applied -
> >> > http://lgarc.narod.ru/pics/emacs-box-cursor.png
> >>
> >> Would it be possible to keep the two thin horizontal lines when the
> >> window is active?
> >>
> > I figured out, how to do this in "easy" way.  Here is patches update
> >
> > And screenshots: http://lgarc.narod.ru/pics/emacs-box-margin1.png
> > http://lgarc.narod.ru/pics/emacs-box-margin2.png
>
> I think your second set of screenshots looks better.
>

On second screeshot, image has vertical margin as (10 . 4) specifies, that
is why horizontal lines are not thin

On first screenshot, there is only hmargin as (10 . 0) specifies


> But the horizontal lines are not thin, right?
>
> What happens when you switch the active window?  Will the cursor change
> the size of that line, causing things to move vertically?  And what's
> the result when you have many images in a buffer, as in image-dired?
>

No moves, margins are part of the image size displayed in Emacs window.
Cursor just uses that margins to fulfill with cursor color

In both screenshots below window shows how it looks in inactive window.  It
looks unchanged from how they look in current Emacs without patch

I filmed short video how it looks in dynamic -
http://lgarc.narod.ru/pics/IMG_9721.MOV

-- 
lg

[-- Attachment #2: Type: text/html, Size: 3035 bytes --]

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

* Re: [PATCH] Fix display box cursor under image with margins
  2020-05-10 12:14         ` Evgeny Zajcev
@ 2020-05-10 14:09           ` Eli Zaretskii
  2020-06-13 15:55             ` Basil L. Contovounesios
  0 siblings, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2020-05-10 14:09 UTC (permalink / raw)
  To: Evgeny Zajcev; +Cc: monnier, emacs-devel

> From: Evgeny Zajcev <lg.zevlg@gmail.com>
> Date: Sun, 10 May 2020 15:14:54 +0300
> Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel <emacs-devel@gnu.org>
> 
>  And screenshots: http://lgarc.narod.ru/pics/emacs-box-margin1.png
>  http://lgarc.narod.ru/pics/emacs-box-margin2.png
> 
>  This patch introduces new cursor type - COMBINED_BOX_CURSOR (used only internally for box
>  cursor under images with mask or margins)
> 
>  Thanks
> 
> JFYI: I've been runing Emacs with this patch for two weeks without any issues

Thanks, but I didn't get the impression that this change is favored by
people here.  Maybe I'm mistaken, but in that case I'd ask more people
to voice their opinions.



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

* Re: [PATCH] Fix display box cursor under image with margins
  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
  1 sibling, 1 reply; 21+ messages in thread
From: Michael Welsh Duggan @ 2020-05-10 15:38 UTC (permalink / raw)
  To: Evgeny Zajcev; +Cc: Eli Zaretskii, emacs-devel, Stefan Kangas, Stefan Monnier

Evgeny Zajcev <lg.zevlg@gmail.com> writes:

> вс, 10 мая 2020 г. в 15:52, Stefan Kangas <stefankangas@gmail.com>:
>
>> But the horizontal lines are not thin, right?
>>
>> What happens when you switch the active window?  Will the cursor change
>> the size of that line, causing things to move vertically?  And what's
>> the result when you have many images in a buffer, as in image-dired?
>>
>
> No moves, margins are part of the image size displayed in Emacs window.
> Cursor just uses that margins to fulfill with cursor color
>
> In both screenshots below window shows how it looks in inactive window.  It
> looks unchanged from how they look in current Emacs without patch
>
> I filmed short video how it looks in dynamic -
> http://lgarc.narod.ru/pics/IMG_9721.MOV

FWIW, I watched that video and I _do_ like that behavior.

-- 
Michael Welsh Duggan
(md5i@md5i.com)



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

* Re: [PATCH] Fix display box cursor under image with margins
  2020-05-10 15:38             ` Michael Welsh Duggan
@ 2020-05-10 16:48               ` Stefan Monnier
  0 siblings, 0 replies; 21+ messages in thread
From: Stefan Monnier @ 2020-05-10 16:48 UTC (permalink / raw)
  To: Michael Welsh Duggan
  Cc: Eli Zaretskii, Evgeny Zajcev, Stefan Kangas, emacs-devel

> FWIW, I watched that video and I _do_ like that behavior.

LGTM as well,


        Stefan




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

* Re: [PATCH] Fix display box cursor under image with margins
  2020-05-10 14:08           ` Evgeny Zajcev
  2020-05-10 15:38             ` Michael Welsh Duggan
@ 2020-05-11 15:51             ` Stefan Kangas
  2020-05-11 16:34               ` andres.ramirez
  1 sibling, 1 reply; 21+ messages in thread
From: Stefan Kangas @ 2020-05-11 15:51 UTC (permalink / raw)
  To: Evgeny Zajcev; +Cc: Eli Zaretskii, Stefan Monnier, emacs-devel

Evgeny Zajcev <lg.zevlg@gmail.com> writes:

> I filmed short video how it looks in dynamic -
> http://lgarc.narod.ru/pics/IMG_9721.MOV

Thanks, that's helpful.

The suggested new behaviour looks good to me.

Best regards,
Stefan Kangas



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

* Re: [PATCH] Fix display box cursor under image with margins
  2020-05-11 15:51             ` Stefan Kangas
@ 2020-05-11 16:34               ` andres.ramirez
  0 siblings, 0 replies; 21+ messages in thread
From: andres.ramirez @ 2020-05-11 16:34 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Eli Zaretskii, Evgeny Zajcev, Stefan Monnier, emacs-devel

Hi Guys.

It looks good to me too.

Best Regards
>>>>> "Stefan" == Stefan Kangas <stefankangas@gmail.com> writes:

    Stefan> Evgeny Zajcev <lg.zevlg@gmail.com> writes:
    >> I filmed short video how it looks in dynamic -
    >> http://lgarc.narod.ru/pics/IMG_9721.MOV

    Stefan> Thanks, that's helpful.

    Stefan> The suggested new behaviour looks good to me.

    Stefan> Best regards, Stefan Kangas





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

* Re: [PATCH] Fix display box cursor under image with margins
  2020-05-10 14:09           ` Eli Zaretskii
@ 2020-06-13 15:55             ` Basil L. Contovounesios
  2020-07-24 11:45               ` Stefan Kangas
  0 siblings, 1 reply; 21+ messages in thread
From: Basil L. Contovounesios @ 2020-06-13 15:55 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Evgeny Zajcev, monnier, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

> Thanks, but I didn't get the impression that this change is favored by
> people here.  Maybe I'm mistaken, but in that case I'd ask more people
> to voice their opinions.

Seems like Evgeny's demo convinced more people that it's a nice feature
to have.

Thanks,

-- 
Basil



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

* Re: [PATCH] Fix display box cursor under image with margins
  2020-06-13 15:55             ` Basil L. Contovounesios
@ 2020-07-24 11:45               ` Stefan Kangas
  0 siblings, 0 replies; 21+ messages in thread
From: Stefan Kangas @ 2020-07-24 11:45 UTC (permalink / raw)
  To: Basil L. Contovounesios, Eli Zaretskii
  Cc: Evgeny Zajcev, monnier, emacs-devel

"Basil L. Contovounesios" <contovob@tcd.ie> writes:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>> Thanks, but I didn't get the impression that this change is favored by
>> people here.  Maybe I'm mistaken, but in that case I'd ask more people
>> to voice their opinions.
>
> Seems like Evgeny's demo convinced more people that it's a nice feature
> to have.

Right, Eli asked for opinions, and the ones given were positive to the
change AFAICT.

Should we therefore also install the patch?  I personally don't feel
qualified to review the code.

Best regards,
Stefan Kangas



^ permalink raw reply	[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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).