all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Bar Cursor Still To Narrow on Mac OS X
@ 2011-03-05 23:41 Ben Key
  2011-03-05 23:55 ` Chong Yidong
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Key @ 2011-03-05 23:41 UTC (permalink / raw)
  To: Emacs-devel

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

Hello,

Some time ago I reported a bug in Emacs that caused the bar cursor to be too
narrow in the Mac OS X version of Emacs.  I also submitted a patch to fix
the problem.  This problem was supposedly fixed in revision 103406 by Chong
Yidong.  The problem is that this change did not fix the problem.  In fact
it made it worse.

The original problem was based on a line of code that effectively caused the
user selected value for the Bar Cursor to be completely ignored.  This line
was as follows.
     s.size.width = min (cursor_width, 2); //FIXME(see above)

This line caused the cursor width to be set to 2 even if the user requested
cursor width was a value higher than 2.

The problem is that in the change made by Chong Yidong, there is a similar
line that has the same effect of causing the user specified value for the
cursor width to be ignored.  This line is as follows.
      cursor_width = min (cursor_width, 1);

The end result of this line is that now the user specified value for cursor
width is still ignored and instead the value 1 is used as the cursor width.
So now when the user requests that Emacs use a 4 pixel wide bar cursor, they
get a 1 pixel wide bar cursor.  Personally I preferred the 2 pixel wide
cursor that was displayed before the change made in revision 103406.  What I
would prefer even more would be for Emacs to NOT ignore the user requested
value for cursor width.

I am once again submitting a patch that fixes this problem.  This patch
simply removes the offending line from nsterm.m.

<patch>
=== modified file 'src/nsterm.m'
--- src/nsterm.m    2011-03-03 08:03:01 +0000
+++ src/nsterm.m    2011-03-05 23:32:39 +0000
@@ -2284,7 +2284,6 @@
     {
       if (cursor_width < 0)
     cursor_width = FRAME_CURSOR_WIDTH (f);
-      cursor_width = min (cursor_width, 1);
       w->phys_cursor_width = cursor_width;
     }


</patch>

Please commit this patch.

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

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

* Re: Bar Cursor Still To Narrow on Mac OS X
  2011-03-05 23:41 Bar Cursor Still To Narrow on Mac OS X Ben Key
@ 2011-03-05 23:55 ` Chong Yidong
  2011-03-06  2:45   ` Ben Key
  0 siblings, 1 reply; 4+ messages in thread
From: Chong Yidong @ 2011-03-05 23:55 UTC (permalink / raw)
  To: Ben Key; +Cc: Emacs-devel

Ben Key <bkey76@gmail.com> writes:

> Some time ago I reported a bug in Emacs that caused the bar cursor to
> be too narrow in the Mac OS X version of Emacs.  I also submitted a
> patch to fix the problem.  This problem was supposedly fixed in
> revision 103406 by Chong Yidong.  The problem is that this change did
> not fix the problem.

Sorry, I made a typo.  Should be fixed now.



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

* Re: Bar Cursor Still To Narrow on Mac OS X
  2011-03-05 23:55 ` Chong Yidong
@ 2011-03-06  2:45   ` Ben Key
  2011-03-06 20:24     ` Chong Yidong
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Key @ 2011-03-06  2:45 UTC (permalink / raw)
  To: Chong Yidong, Emacs-devel

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

Thanks.

I tested the latest change with cursor-type set to (bar . 4) and everything
works as expected.  I can now actually see the bar cursor without straining.

Note that with the most recent changes, the cursor is not drawn correctly
when the user sets the cursor-type variable to (hbar . HEIGHT).  According
to the documentation for the cursor-type variable, when this form is used,
the number after the . is supposed to specify the "height" of the cursor,
not the "width."

The function get_specified_cursor_type processes this form by setting the
width output parameter to the user specified width.  The value assigned to
the width output parameter in get_specified_cursor_type is eventually used
to set the value of the cursor_width parameter when ns_draw_window_cursor is
called.

The expectation is that a horizontal bar cursor will be used whose height is
set to the user specified height and width is set to be equal to the width
of the current glyph at point.  This is what happens in Emacs 23.

The problem with the latest code in ns_draw_window_cursor is that the user
specified value for the cursor "height" is currently also being used for the
cursor "width."  As a result, when cursor-type is set to (hbar . 4) the
result is a 4 pixel by 4 pixel block, not a block that is 4 pixels tall and
as wide as the current glyph at point.

I am working on a patch that fixes this problem.

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

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

* Re: Bar Cursor Still To Narrow on Mac OS X
  2011-03-06  2:45   ` Ben Key
@ 2011-03-06 20:24     ` Chong Yidong
  0 siblings, 0 replies; 4+ messages in thread
From: Chong Yidong @ 2011-03-06 20:24 UTC (permalink / raw)
  To: Ben Key; +Cc: Emacs-devel

Ben Key <bkey76@gmail.com> writes:

> Note that with the most recent changes, the cursor is not drawn
> correctly when the user sets the cursor-type variable to (hbar .
> HEIGHT).  According to the documentation for the cursor-type variable,
> when this form is used, the number after the . is supposed to specify
> the "height" of the cursor, not the "width."
>
> I am working on a patch that fixes this problem.

Thanks.



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

end of thread, other threads:[~2011-03-06 20:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-05 23:41 Bar Cursor Still To Narrow on Mac OS X Ben Key
2011-03-05 23:55 ` Chong Yidong
2011-03-06  2:45   ` Ben Key
2011-03-06 20:24     ` Chong Yidong

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.