daily pastebin goal
4%
SHARE
TWEET

Untitled

a guest Oct 20th, 2018 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ---
  2.  src/nsterm.m | 41 +++++++++++++++--------------------------
  3.  1 file changed, 15 insertions(+), 26 deletions(-)
  4.  
  5. diff --git a/src/nsterm.m b/src/nsterm.m
  6. index 1ef7f5ab51..f910d606a6 100644
  7. --- a/src/nsterm.m
  8. +++ b/src/nsterm.m
  9. @@ -279,7 +279,6 @@ - (NSColor *)colorUsingDefaultColorSpace
  10.  
  11.  /* display update */
  12.  static int ns_window_num = 0;
  13. -static BOOL gsaved = NO;
  14.  static BOOL ns_fake_keydown = NO;
  15.  #ifdef NS_IMPL_COCOA
  16.  static BOOL ns_menu_bar_is_hidden = NO;
  17. @@ -1234,7 +1233,6 @@ static NSRect constrain_frame_rect(NSRect frameRect, bool isFullscreen)
  18.              NSRectClipList (r, 2);
  19.            else
  20.              NSRectClip (*r);
  21. -          gsaved = YES;
  22.  
  23.            return YES;
  24.          }
  25. @@ -1258,11 +1256,7 @@ static NSRect constrain_frame_rect(NSRect frameRect, bool isFullscreen)
  26.  {
  27.    NSTRACE_WHEN (NSTRACE_GROUP_FOCUS, "ns_reset_clipping");
  28.  
  29. -  if (gsaved)
  30. -    {
  31. -      [[NSGraphicsContext currentContext] restoreGraphicsState];
  32. -      gsaved = NO;
  33. -    }
  34. +  [[NSGraphicsContext currentContext] restoreGraphicsState];
  35.  }
  36.  
  37.  
  38. @@ -1288,19 +1282,6 @@ static NSRect constrain_frame_rect(NSRect frameRect, bool isFullscreen)
  39.    return ns_clip_to_rect (f, &clip_rect, 1);
  40.  }
  41.  
  42. -
  43. -static void
  44. -ns_flush_display (struct frame *f)
  45. -/* Force the frame to redisplay.  If areas have previously been marked
  46. -   dirty by setNeedsDisplayInRect (in ns_clip_to_rect), then this will call
  47. -   draw_rect: which will "expose" those areas.  */
  48. -{
  49. -  block_input ();
  50. -  [FRAME_NS_VIEW (f) displayIfNeeded];
  51. -  unblock_input ();
  52. -}
  53. -
  54. -
  55.  /* ==========================================================================
  56.  
  57.      Visible bell and beep.
  58. @@ -2837,6 +2818,8 @@ so some key presses (TAB) are swallowed by the system.  */
  59.  static void
  60.  ns_copy_bits (struct frame *f, NSRect src, NSRect dest)
  61.  {
  62. +  NSSize delta = NSMakeSize (dest.origin.x - src.origin.x,
  63. +                             dest.origin.y - src.origin.y)
  64.    NSTRACE ("ns_copy_bits");
  65.  
  66.    if (FRAME_NS_VIEW (f))
  67. @@ -2845,10 +2828,17 @@ so some key presses (TAB) are swallowed by the system.  */
  68.  
  69.        /* FIXME: scrollRect:by: is deprecated in macOS 10.14.  There is
  70.           no obvious replacement so we may have to come up with our own.  */
  71. -      [FRAME_NS_VIEW (f) scrollRect: src
  72. -                                 by: NSMakeSize (dest.origin.x - src.origin.x,
  73. -                                                 dest.origin.y - src.origin.y)];
  74. -      [FRAME_NS_VIEW (f) setNeedsDisplay:YES];
  75. +      [FRAME_NS_VIEW (f) scrollRect: src by: delta];
  76. +
  77. +      /* As far as I can tell from the documentation, scrollRect:by:,
  78. +         above, should copy the dirty rectangles from our source
  79. +         rectangle to our destination, however it appears it clips the
  80. +         operation to src.  As a result we need to use
  81. +         translateRectsNeedingDisplayInRect:by: below, and we have to
  82. +         union src and dest so it can pick up the dirty rectangles,
  83. +         and place them, as it also clips to the rectangle.  */
  84. +      [FRAME_NS_VIEW (f) translateRectsNeedingDisplayInRect:NSUnionRect (src, dest)
  85. +                                                         by:delta];
  86.      }
  87.  }
  88.  
  89. @@ -5119,7 +5109,7 @@ static Lisp_Object ns_string_to_lispmod (const char *s)
  90.    ns_after_update_window_line,
  91.    ns_update_window_begin,
  92.    ns_update_window_end,
  93. -  ns_flush_display, /* flush_display */
  94. +  0, /* flush_display */
  95.    x_clear_window_mouse_face,
  96.    x_get_glyph_overhangs,
  97.    x_fix_overlapping_area,
  98. @@ -7114,7 +7104,6 @@ - (NSSize)windowWillResize: (NSWindow *)sender toSize: (NSSize)frameSize
  99.          size_title = xmalloc (strlen (old_title) + 40);
  100.     esprintf (size_title, "%s  —  (%d x %d)", old_title, cols, rows);
  101.          [window setTitle: [NSString stringWithUTF8String: size_title]];
  102. -        [window display];
  103.          xfree (size_title);
  104.        }
  105.    }
  106. --
  107. 2.19.0
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top