Re: [Emacs.app dev]: ghost cursor problem is still there

2008-08-23 Thread David Reitter

On 23 Aug 2008, at 13:30, Dan Nicolaescu wrote:


+   drawGlyph = 1; // just draw the Glyph
[FRAME_BACKGROUND_COLOR (f) set];
!
!   NSDisableScreenUpdates ();



Unfortunately this breaks GNUStep:


Not a problem; I have checked in a fix.
Can you let us know how well this works on GNUStep?
Is there a lot of flicker when moving the cursor or in blink-cursor- 
mode?



 Also please make sure that your log entries are properly formatted:

Like ChangeLog, it should contain the changed function name,


OK, I can do that.  I modeled my earlier comments after others in that  
file, e.g. from 2008-08-01.


Could you explain to me how the ChangeLog and the CVS comments should  
differ semantically?

smime.p7s
Description: S/MIME cryptographic signature
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/___
Emacs-app-dev- mailing list
Emacs-app-dev-@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emacs-app-dev-


Re: [Emacs.app dev]: ghost cursor problem is still there

2008-08-21 Thread Adrian Robert

On Aug 21, 2008, at 5:08 AM, David Reitter wrote:

 On 21 Aug 2008, at 03:33, Nick Roberts wrote:

 There were problems with this patch, e.g., ns-cursor-blink-rate not  
 defined
 which appears to have been corrected

 Thanks Adrian for catching the missing checkin.

 but I still get grey strips which are
 opaque to the text until the cursor moves over them or I select the  
 region
 with the mouse.

 Can you reproduce starting with Emacs -Q?

I can. After startup, select a row of text, click onto another  
application, then back.  I don't know if this was there before the  
patch.

As far as the (possibly separate) ghost cursor problem, I narrowed  
down that it appeared between rc2a and rc3.  I'm studying the source  
code diffs to determine the problem.


Adrian


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Emacs-app-dev- mailing list
Emacs-app-dev-@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emacs-app-dev-


Re: [Emacs.app dev]: ghost cursor problem is still there

2008-08-21 Thread Adrian Robert

On Aug 21, 2008, at 8:07 AM, Adrian Robert wrote:


 On Aug 21, 2008, at 5:08 AM, David Reitter wrote:

 On 21 Aug 2008, at 03:33, Nick Roberts wrote:

 but I still get grey strips which are
 opaque to the text until the cursor moves over them or I select  
 the region
 with the mouse.

 Can you reproduce starting with Emacs -Q?

 I can. After startup, select a row of text, click onto another  
 application, then back.  I don't know if this was there before the  
 patch.

I checked, it was not.  In addition the patch introduces the following  
bug: the cursor is not changed to hollow box from block when focus on  
the frame is taken away.  And when multiple frames are present, things  
get very messy.  If these problems cannot be resolved quickly we  
should probably revert the patch, or at least the non blink-related  
parts of it.



-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Emacs-app-dev- mailing list
Emacs-app-dev-@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emacs-app-dev-


Re: [Emacs.app dev]: ghost cursor problem is still there

2008-08-21 Thread David Reitter

On 21 Aug 2008, at 12:07, Adrian Robert wrote:


As stated before on the list, the defaults are a replacement for X  
resources.  The latter ARE read on X systems when -q/Q is given.  I  
think the reason the behavior is unexpected under NS is that unlike  
other systems, NS emacs will WRITE into the defaults database (to  
save user options).  The attached patch will therefore cause these  
resources not to be read, only under NS, if -q/Q  is given.


Why save the preferences at all?

There is a strong group of people who want Emacs to behave in the same  
way across systems.  Would it really be a good idea if the base Emacs  
started, from version 23, saving the options at the end, especially  
since they don't go into `custom-file'.


D

smime.p7s
Description: S/MIME cryptographic signature
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/___
Emacs-app-dev- mailing list
Emacs-app-dev-@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emacs-app-dev-


Re: [Emacs.app dev]: ghost cursor problem is still there

2008-08-21 Thread Adrian Robert

On Aug 21, 2008, at 12:27 PM, David Reitter wrote:

 On 21 Aug 2008, at 12:07, Adrian Robert wrote:

 As stated before on the list, the defaults are a replacement for X  
 resources.  The latter ARE read on X systems when -q/Q is given.  I  
 think the reason the behavior is unexpected under NS is that unlike  
 other systems, NS emacs will WRITE into the defaults database (to  
 save user options).  The attached patch will therefore cause these  
 resources not to be read, only under NS, if -q/Q  is given.

 Why save the preferences at all?

 There is a strong group of people who want Emacs to behave in the  
 same way across systems.  Would it really be a good idea if the base  
 Emacs started, from version 23, saving the options at the end,  
 especially since they don't go into `custom-file'.

I'd rather energies were focused on fixing bugs for now.  But if the  
defaults are disruptive to that endeavor, what would be the easiest  
way to stop the problem?  The patch I posted is one way.  Another way  
would be to switch ns-save-options to use the customize system  
(customize-save-variable), which should write it into the .emacs  
file.  The defaults become read-only like X resources, and the prefs  
window can be removed later with minimal disruption, since the  
features would be accessible through customize.  One would need to be  
careful with the face-related attributes here, I suspect.



-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Emacs-app-dev- mailing list
Emacs-app-dev-@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emacs-app-dev-


Re: [Emacs.app dev]: ghost cursor problem is still there

2008-08-20 Thread Adrian Robert

On Aug 20, 2008, at 1:22 AM, David Reitter wrote:

 Adrian et al,

 On 22 Jul 2008, at 09:41, David Reitter wrote:

 The main changes are that we check cursor_type instead of  
 cursorType and draw the text glyph rather than the cursor when  
 erasing anything (`hl' variable).  There's a range of steps that we  
 do to ensure that the cursor area is actually visible; I'm not sure  
 if they are really needed, but the corresponding X code does it, too.
 There is a good bit of guess-work involved, but I'm sure that  
 testing will take care of any problems.

 OK, in my latest build, things work a lot better and the original  
 blink-cursor-mode appears to work fine now.  (I don't quite  
 understand which change made the event mechanisms work better.)

This is great news.


 To repeat, these changes address the following issues:

 - frame background rather than the right glyph in the white-out  
 phases during blinking
 - `cursor-type' variable as in core Emacs, rather than NS specific  
 solution
 - with it, support for things like (box . 2)
 - box/hollow cursors too narrow

OK, these were from before.


 - standard blink-cursor-mode with all its bells and whistles  
 (whether one needs them or not)

This is new, and good.


 I would also take the blink rate stuff out of the preferences (a  
 patch to the nib) - it doesn't work with the generic blinking code  
 and I believe it's there for historic reasons (because the NS port  
 implemented blinking separately) rather than because it would be  
 very important to have for users (one could think of much more  
 important settings that could be there).

This is a matter of opinion and at least I personally find blink and  
other cursor attributes I like to change easily and frequently.  It  
should be an extremely simple matter to update the prefs controller  
code to set the core emacs blink rate, and I will do so once you've  
checked your changes in.  The prefs window may be removed completely  
before 23.1 as it faces hostility from many quarters so I'd rather  
keep it fully functional until then.


 The occasional ghost cursors seem to remain.

I've been occasionally looking at this when I've had the chance.  It  
has not been easy to track down.  I get it (Leopard) in latest source  
and for a while back to around the merge, but not in rc2a.  I think  
the best chance will be to try to find the first date/version when the  
problem appeared and then diff the source code (xdisp.c, dispnew.c,  
and xterm.c will probably tell the story).  If anyone has information  
on this, please post it.


 Any objections?

I'm fine with this being committed.


thanks,
Adrian


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Emacs-app-dev- mailing list
Emacs-app-dev-@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emacs-app-dev-


Re: [Emacs.app dev]: ghost cursor problem is still there

2008-08-20 Thread David Reitter

On 20 Aug 2008, at 08:27, Adrian Robert wrote:


I'm fine with this being committed.


done.

- D

smime.p7s
Description: S/MIME cryptographic signature
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/___
Emacs-app-dev- mailing list
Emacs-app-dev-@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emacs-app-dev-


Re: [Emacs.app dev]: ghost cursor problem is still there

2008-08-19 Thread David Reitter

Adrian et al,

On 22 Jul 2008, at 09:41, David Reitter wrote:


The main changes are that we check cursor_type instead of cursorType  
and draw the text glyph rather than the cursor when erasing anything  
(`hl' variable).  There's a range of steps that we do to ensure that  
the cursor area is actually visible; I'm not sure if they are really  
needed, but the corresponding X code does it, too.
There is a good bit of guess-work involved, but I'm sure that  
testing will take care of any problems.


OK, in my latest build, things work a lot better and the original  
blink-cursor-mode appears to work fine now.  (I don't quite understand  
which change made the event mechanisms work better.)


To repeat, these changes address the following issues:

- frame background rather than the right glyph in the white-out phases  
during blinking
- `cursor-type' variable as in core Emacs, rather than NS specific  
solution

- with it, support for things like (box . 2)
- box/hollow cursors too narrow
- standard blink-cursor-mode with all its bells and whistles (whether  
one needs them or not)


I would also take the blink rate stuff out of the preferences (a patch  
to the nib) - it doesn't work with the generic blinking code and I  
believe it's there for historic reasons (because the NS port  
implemented blinking separately) rather than because it would be very  
important to have for users (one could think of much more important  
settings that could be there).


ns_set_cursor_type is now equivalent to the x_set_cursor_type (quasi)  
generic.  I left ns_set_cursor_color for you or someone else.


The occasional ghost cursors seem to remain.

Any objections?

D



Index: nsterm.m
===
RCS file: /sources/emacs/emacs/src/nsterm.m,v
retrieving revision 1.23
diff -c -r1.23 nsterm.m
*** nsterm.m5 Aug 2008 03:05:14 -   1.23
--- nsterm.m20 Aug 2008 05:18:41 -
***
*** 168,180 
 the Function modifer (laptops).  May be any of the modifier lisp  
symbols. */

  Lisp_Object ns_function_modifier;

- /* A floating point value specifying the rate at which to blink the  
cursor.

-YES indicates 0.5, NO indicates no blinking. */
- Lisp_Object ns_cursor_blink_rate;
-
- /* Used for liason with core emacs cursor-blink-mode. */
- Lisp_Object ns_cursor_blink_mode;
-
  /* A floating point value specifying vertical stretch (positive) or  
shrink

(negative) of text line spacing.  Zero means default spacing.
YES indicates 0.5, NO indicates 0.0. */
--- 168,173 
***
*** 235,241 
  static NSEvent *last_appdefined_event = 0;
  static NSTimer *timed_entry = 0;
  static NSTimer *fd_entry = nil;
- static NSTimer *cursor_blink_entry = nil;
  static NSTimer *scroll_repeat_entry = nil;
  static fd_set select_readfds, t_readfds;
  static struct timeval select_timeout;
--- 228,233 
***
*** 2270,2275 
--- 2262,2271 
 int on_p, int active_p)
  /*  
--

   External call (RIF): draw cursor
+  (modeled after x_draw_window_cursor and erase_phys_cursor.
+  FIXME: erase_phys_cursor is called from display_and_set_cursor,
+  called from update_window_cursor/x_update_window_end/...
+  Why do we have to duplicate this code?
  
-- */

  {
NSRect r, s;
***
*** 2278,2291 
struct glyph *phys_cursor_glyph;
int overspill;
unsigned char drawGlyph = 0, cursorType, oldCursorType;

NSTRACE (dumpcursor);

!   if (!on_p)
return;

w-phys_cursor_type = cursor_type;
!   w-phys_cursor_on_p = 1;

if (cursor_type == NO_CURSOR)
  {
--- 2274,2296 
struct glyph *phys_cursor_glyph;
int overspill;
unsigned char drawGlyph = 0, cursorType, oldCursorType;
+   int new_cursor_type;
+   int new_cursor_width;
+   int active_cursor;
+   enum draw_glyphs_face hl;
+   struct glyph_matrix *active_glyphs = w-current_matrix;
+   Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
+   int hpos = w-phys_cursor.hpos;
+   int vpos = w-phys_cursor.vpos;
+   struct glyph_row *cursor_row;

NSTRACE (dumpcursor);

!   if (!on_p) // check this? !w-phys_cursor_on_p)
return;

w-phys_cursor_type = cursor_type;
!   w-phys_cursor_on_p = on_p;

if (cursor_type == NO_CURSOR)
  {
***
*** 2318,2326 
if (overspill  0)
  r.size.width -= overspill;

-   /* TODO: 23: use emacs stored f-cursor_type instead of ns- 
specific */

oldCursorType = FRAME_CURSOR (f);
cursorType = FRAME_CURSOR (f) = FRAME_NEW_CURSOR (f);
f-output_data.ns-current_cursor_color
  = f-output_data.ns-desired_cursor_color;

--- 2323,2332 
if (overspill  0)
  r.size.width -= overspill;

oldCursorType = FRAME_CURSOR (f);
cursorType = FRAME_CURSOR (f) = 

Re: [Emacs.app dev]: ghost cursor problem is still there

2008-07-22 Thread Adrian Robert

On Jul 21, 2008, at 11:02 PM, David Reitter wrote:

 On 19 Jul 2008, at 19:16, Adrian Robert wrote:

 It's been a longstanding TODO to normalize the cursor handling  
 under NS.  Both for storing the shape, as mentioned, and also the  
 blink handling.  Most of the code that's in there dates from before  
 emacs itself had these features, and since it has been mostly  
 working it's been less pain to keep it working than to rip it out  
 and start afresh with the emacs stuff.  Time for that to change,  
 and I'd definitely welcome help or a patch for all or part of it.


 The code below takes care of

 - frame background rather than the right glyph in the white-out  
 phases during blinking
 - `cursor-type' variable as in core Emacs, rather than NS specific  
 solution
 - with it, support for things like (box . 2)
 - box/hollow cursors too narrow

Thanks, great stuff!  But could you please summarize the changes?  It  
shows like every line was changed (maybe because of indentation?) but  
it doesn't look like that was actually the case.  Could you regenerate  
the patch w/o indentation/tab changes?


 I don't understand why internal-show-cursor  and the w-cursor_off_p  
 (that it sets) do not work in the NS port - they are checked by  
 redisplay_internal.  Is there any commentary regarding stuff like  
 that?

This is the way it is..  ;-/  Usually you just have to get your hands  
dirty and try to trace it back -- where does w-cursor_off_p get set,  
when/how are other terms calling or triggering functions that set it  
or trigger calling of draw_window_cursor(), etc..



 I mean, the original authors of this code went to lengths to replace  
 the blink-cursor-mode with something off their own (which is a lot  
 less configurable).

As I said before, blinking cursor did not exist in core emacs when the  
NS port added this functionality.  (Along with different cursor shapes.)


Did you have any sort of a start on using the emacs common code (even  
though it didn't work)?  Maybe if you post a patch for that others  
could take a stab at moving it further.


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Emacs-app-dev- mailing list
Emacs-app-dev-@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emacs-app-dev-


Re: [Emacs.app dev]: ghost cursor problem is still there

2008-07-22 Thread David Reitter

On 22 Jul 2008, at 08:39, Adrian Robert wrote:


Thanks, great stuff!  But could you please summarize the changes?   
It shows like every line was changed (maybe because of indentation?)  
but it doesn't look like that was actually the case.  Could you  
regenerate the patch w/o indentation/tab changes?


Okay, have a look at what's below.

The main changes are that we check cursor_type instead of cursorType  
and draw the text glyph rather than the cursor when erasing anything  
(`hl' variable).  There's a range of steps that we do to ensure that  
the cursor area is actually visible; I'm not sure if they are really  
needed, but the corresponding X code does it, too.
There is a good bit of guess-work involved, but I'm sure that testing  
will take care of any problems.


I don't understand why internal-show-cursor  and the w- 
cursor_off_p (that it sets) do not work in the NS port - they are  
checked by redisplay_internal.  Is there any commentary regarding  
stuff like that?


This is the way it is..  ;-/  Usually you just have to get your  
hands dirty and try to trace it back -- where does w-cursor_off_p  
get set, when/how are other terms calling or triggering functions  
that set it or trigger calling of draw_window_cursor(), etc..


Yeah, that's how I've been working... it doesn't really feel like  
2008. (And not even like 1999.)


Did you have any sort of a start on using the emacs common code  
(even though it didn't work)?  Maybe if you post a patch for that  
others could take a stab at moving it further.


Well, if someone could explain why redisplay noticed a change in - 
cursor_off_p in Carbon or X, but not in NS, then that would already  
be helpful.  I don't think enabling the original blink-cursor-mode  
will be difficult, and you get a lot of functionality for free that way.


I'm trying again with a few extra TRACE steps enabled.

cc'ing emacs-devel for some advice regarding the patch.

- D



===
RCS file: /sources/emacs/emacs/src/nsterm.m,v
retrieving revision 1.11
diff -c -w -r1.11 nsterm.m
*** nsterm.m21 Jul 2008 17:47:24 -  1.11
--- nsterm.m22 Jul 2008 13:30:21 -
***
*** 2274,2279 
--- 2274,2285 
 int on_p, int active_p)
  /*  
--

   External call (RIF): draw cursor
+  (modeled after x_draw_window_cursor and erase_phys_cursor.
+  FIXME: erase_phys_cursor is called from display_and_set_cursor,
+  called from update_window_cursor/x_update_window_end/...
+  Why do we have to duplicate this code?
+  Also, why doesn't cursor_off_p (internal_show_cursor) work?
+  This prevents the original blink-cursor-mode from working.
  
-- */

  {
NSRect r, s;
***
*** 2282,2295 
struct glyph *phys_cursor_glyph;
int overspill;
unsigned char drawGlyph = 0, cursorType, oldCursorType;

NSTRACE (dumpcursor);

!   if (!on_p)
return;

w-phys_cursor_type = cursor_type;
!   w-phys_cursor_on_p = 1;

if (cursor_type == NO_CURSOR)
  {
--- 2288,2310 
struct glyph *phys_cursor_glyph;
int overspill;
unsigned char drawGlyph = 0, cursorType, oldCursorType;
+   int new_cursor_type;
+   int new_cursor_width;
+   int active_cursor;
+   enum draw_glyphs_face hl;
+   struct glyph_matrix *active_glyphs = w-current_matrix;
+   Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
+   int hpos = w-phys_cursor.hpos;
+   int vpos = w-phys_cursor.vpos;
+   struct glyph_row *cursor_row;

NSTRACE (dumpcursor);

!   if (!on_p) // check this? !w-phys_cursor_on_p)
return;

w-phys_cursor_type = cursor_type;
!   w-phys_cursor_on_p = on_p;

if (cursor_type == NO_CURSOR)
  {
***
*** 2322,2333 
--- 2337,2350 
if (overspill  0)
  r.size.width -= overspill;

+
/* PENDING: 23: use emacs stored f-cursor_type instead of ns- 
specific */

oldCursorType = FRAME_CURSOR (f);
cursorType = FRAME_CURSOR (f) = FRAME_NEW_CURSOR (f);
f-output_data.ns-current_cursor_color
  = f-output_data.ns-desired_cursor_color;

+
/* PENDING: only needed in rare cases with last-resort font in  
HELLO..

   should we do this more efficiently? */
ns_clip_to_row (w, glyph_row, -1, NULL);
***
*** 2346,2357 
if (cursorType == no_highlight || cursor_type == NO_CURSOR)
  {
/* clearing for blink: erase the cursor itself */
[FRAME_BACKGROUND_COLOR (f) set];
!   cursorType = oldCursorType; /* just clear what we had before */
  }
else
[FRAME_CURSOR_COLOR (f) set];

if (!active_p)
  {
/* inactive window: ignore what we just set and use a hollow  
box */

--- 2363,2441 
if (cursorType == no_highlight || cursor_type == NO_CURSOR)
  {
 

Re: [Emacs.app dev]: ghost cursor problem is still there

2008-07-21 Thread David Reitter

On 19 Jul 2008, at 19:16, Adrian Robert wrote:


It's been a longstanding TODO to normalize the cursor handling under  
NS.  Both for storing the shape, as mentioned, and also the blink  
handling.  Most of the code that's in there dates from before emacs  
itself had these features, and since it has been mostly working it's  
been less pain to keep it working than to rip it out and start  
afresh with the emacs stuff.  Time for that to change, and I'd  
definitely welcome help or a patch for all or part of it.



The code below takes care of

- frame background rather than the right glyph in the white-out phases  
during blinking
- `cursor-type' variable as in core Emacs, rather than NS specific  
solution

- with it, support for things like (box . 2)
- box/hollow cursors too narrow

The code clearly needs further revision (see FIXME), but I don't know  
what to do.  If you do, please look into it, otherwise I suggest we  
take this as iterative improvement and get back to it after more  
important things have been dealt with.  The whole redisplay stuff  
appears complicated and not very well documented.


Apart from this: the way the blinking cursor is implemented is half- 
hearted at beast (or rather, a hack).
With this, the cursor blinks even if it is being moved around, which  
is really not good.  I wonder why no-one has complained about this  
yet...


I don't understand why internal-show-cursor  and the w-cursor_off_p  
(that it sets) do not work in the NS port - they are checked by  
redisplay_internal.  Is there any commentary regarding stuff like that?
I mean, the original authors of this code went to lengths to replace  
the blink-cursor-mode with something off their own (which is a lot  
less configurable).



*** nsterm.m21 Jul 2008 20:32:30 -0400  1.11
--- nsterm.m21 Jul 2008 22:57:54 -0400  
***
*** 2274,2279 
--- 2274,2285 
 int on_p, int active_p)
  /*  
--

   External call (RIF): draw cursor
+  (modeled after x_draw_window_cursor and erase_phys_cursor.
+  FIXME: erase_phys_cursor is called from display_and_set_cursor,
+  called from update_window_cursor/x_update_window_end/...
+  Why do we have to duplicate this code?
+  Also, why doesn't cursor_off_p (internal_show_cursor) work?
+  This prevents the original blink-cursor-mode from working.
  
-- */

  {
NSRect r, s;
***
*** 2282,2295 
struct glyph *phys_cursor_glyph;
int overspill;
unsigned char drawGlyph = 0, cursorType, oldCursorType;

NSTRACE (dumpcursor);

!   if (!on_p)
return;

w-phys_cursor_type = cursor_type;
!   w-phys_cursor_on_p = 1;

if (cursor_type == NO_CURSOR)
  {
--- 2288,2310 
struct glyph *phys_cursor_glyph;
int overspill;
unsigned char drawGlyph = 0, cursorType, oldCursorType;
+   int new_cursor_type;
+   int new_cursor_width;
+   int active_cursor;
+   enum draw_glyphs_face hl;
+   struct glyph_matrix *active_glyphs = w-current_matrix;
+   Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
+   int hpos = w-phys_cursor.hpos;
+   int vpos = w-phys_cursor.vpos;
+   struct glyph_row *cursor_row;

NSTRACE (dumpcursor);

!   if (!on_p) // check this? !w-phys_cursor_on_p)
return;

w-phys_cursor_type = cursor_type;
!   w-phys_cursor_on_p = on_p;

if (cursor_type == NO_CURSOR)
  {
***
*** 2322,2333 
--- 2337,2350 
if (overspill  0)
  r.size.width -= overspill;

+
/* PENDING: 23: use emacs stored f-cursor_type instead of ns- 
specific */

oldCursorType = FRAME_CURSOR (f);
cursorType = FRAME_CURSOR (f) = FRAME_NEW_CURSOR (f);
f-output_data.ns-current_cursor_color
  = f-output_data.ns-desired_cursor_color;

+
/* PENDING: only needed in rare cases with last-resort font in  
HELLO..

   should we do this more efficiently? */
ns_clip_to_row (w, glyph_row, -1, NULL);
***
*** 2346,2396 
if (cursorType == no_highlight || cursor_type == NO_CURSOR)
  {
/* clearing for blink: erase the cursor itself */
[FRAME_BACKGROUND_COLOR (f) set];
-   cursorType = oldCursorType; /* just clear what we had before */
  }
else
[FRAME_CURSOR_COLOR (f) set];

!   if (!active_p)
! {
!   /* inactive window: ignore what we just set and use a hollow  
box */

!   cursorType = hollow_box;
!   [FRAME_CURSOR_COLOR (f) set];
! }

!   switch (cursorType)
! {
! case no_highlight:
!   break;
! case filled_box:
!   NSRectFill (r);
!   drawGlyph = 1;
!   break;
! case hollow_box:
!   NSRectFill (r);
!   [FRAME_BACKGROUND_COLOR (f) set];
!   NSRectFill (NSInsetRect (r, 1, 1));
!   [FRAME_CURSOR_COLOR (f) set];
!   drawGlyph = 1;
!   break;
! 

Re: [Emacs.app dev]: ghost cursor problem is still there

2008-07-19 Thread Adrian Robert
 Is there a specific reason why a lot of NS specific code is used to  
 store the cursor as a frame parameter?
 There's this wonderful `get_window_cursor_type' from xdisp.c that  
 could be used to get the right cursor type, which also allows stuff  
 like (bar . 2), which isn't supported right now.

It's been a longstanding TODO to normalize the cursor handling under  
NS.  Both for storing the shape, as mentioned, and also the blink  
handling.  Most of the code that's in there dates from before emacs  
itself had these features, and since it has been mostly working it's  
been less pain to keep it working than to rip it out and start afresh  
with the emacs stuff.  Time for that to change, and I'd definitely  
welcome help or a patch for all or part of it.

-Adrian


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Emacs-app-dev- mailing list
Emacs-app-dev-@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emacs-app-dev-