emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs Mac port


From: YAMAMOTO Mitsuharu
Subject: Re: Emacs Mac port
Date: Sun, 14 Apr 2013 15:31:05 +0900
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On Thu, 11 Apr 2013 18:22:54 +0900, YAMAMOTO Mitsuharu <address@hidden> 
>>>>> said:

> The first update of Emacs 24.3 Mac port 4.x is available from
> ftp://ftp.math.s.chiba-u.ac.jp/emacs/emacs-24.3-mac-4.1.tar.gz

> ** Improvements

> *** Round frame bottom corners on OS X 10.7 and later, even when
> internal-border-width is 0.

This change seems to trigger a *platform-independent* display bug.
The symptom is that the upper part of the cursor in the echo area is
sometimes unerased, especially during isearch in a large buffer.

It is due to inconsistency of the values of `cursor_in_echo_area'
between the update-time (i.e., drawing accompanied by the current
matrix construction) and the expose-time (drawing in response to the
Expose event).  Both cases may call the function
`get_window_cursor_type', which refers to the global variable
`cursor_in_echo_area'.  But its value might have been changed between
the two timings by a typical let-binding of the Lisp variable
`cursor-in-echo-area'.

The fix should be done in the platform-independent part of course, but
unfortunately that seems to become a nontrivial change.  For the
moment, please use the following workaround that is specific to the
Mac port if this bug is annoying for you.

                                     YAMAMOTO Mitsuharu
                                address@hidden

=== modified file 'src/macappkit.h'
*** src/macappkit.h     2013-04-11 09:28:06 +0000
--- src/macappkit.h     2013-04-14 05:52:02 +0000
***************
*** 358,363 ****
--- 358,367 ----
    /* Whether scrollRect:by: has copied rounded bottom corner area.  */
    BOOL roundedBottomCornersCopied;
  
+   /* XXX: workaround for inconsistency of cursor_in_echo_area values
+      between update-time and expose-time.  */
+   BOOL cursorInEchoAreaSaved, savedCursorInEchoArea;
+ 
    /* Raw key event that is interpreted by intepretKeyEvents:.  */
    NSEvent *rawKeyEvent;
  
***************
*** 380,385 ****
--- 384,390 ----
  - (NSRect)firstRectForCharacterRange:(NSRange)aRange
                         actualRange:(NSRangePointer)actualRange;
  - (void)viewFrameDidChange:(NSNotification *)notification;
+ - (void)saveCursorInEchoArea;
  @end
  
  /* Class for view in the overlay window of an Emacs frame window.  */

=== modified file 'src/macappkit.m'
*** src/macappkit.m     2013-04-11 09:28:06 +0000
--- src/macappkit.m     2013-04-14 05:52:02 +0000
***************
*** 2784,2789 ****
--- 2784,2791 ----
            {
              rect = [emacsView convertRect:rect fromView:nil];
              [emacsView setNeedsDisplayInRect:rect];
+             if ([emacsView isKindOfClass:[EmacsMainView class]])
+               [(EmacsMainView *)emacsView saveCursorInEchoArea];
            }
        }
      }
***************
*** 3864,3870 ****
--- 3866,3884 ----
  
  - (void)drawRect:(NSRect)aRect
  {
+   BOOL origCursorInEchoArea;
+ 
+   if (cursorInEchoAreaSaved)
+     {
+       origCursorInEchoArea = cursor_in_echo_area;
+       cursor_in_echo_area = savedCursorInEchoArea;
+     }
    [super drawRect:aRect];
+   if (cursorInEchoAreaSaved)
+     {
+       cursor_in_echo_area = origCursorInEchoArea;
+       cursorInEchoAreaSaved = NO;
+     }
    roundedBottomCornersCopied = NO;
  }
  
***************
*** 3894,3899 ****
--- 3908,3919 ----
      }
  }
  
+ - (void)saveCursorInEchoArea
+ {
+   cursorInEchoAreaSaved = YES;
+   savedCursorInEchoArea = cursor_in_echo_area;
+ }
+ 
  - (void)setMarkedText:(id)aString
  {
    if (markedText == aString)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]