emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r110414: * nsfns.m (ns_in_resize): Re


From: Jan D.
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110414: * nsfns.m (ns_in_resize): Remove.
Date: Sun, 07 Oct 2012 11:17:17 +0200
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110414
fixes bug: http://debbugs.gnu.org/12479
committer: Jan D. <address@hidden>
branch nick: trunk
timestamp: Sun 2012-10-07 11:17:17 +0200
message:
  * nsfns.m (ns_in_resize): Remove.
  (x_set_icon_name, ns_set_name, ns_set_name_as_filename):  Remove ns_in_resize
  check.
  
  * nsterm.m (ns_in_resize): Remove.
  (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
  (ns_clear_frame, sendEvent, windowDidResize, drawRect:): Remove ns_in_resize
  check.
  (ns_clear_frame_area): Remove resize handle code.
modified:
  src/ChangeLog
  src/nsfns.m
  src/nsterm.m
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-10-07 02:26:03 +0000
+++ b/src/ChangeLog     2012-10-07 09:17:17 +0000
@@ -1,3 +1,15 @@
+2012-10-07  Jan Djärv  <address@hidden>
+
+       * nsterm.m (ns_in_resize): Remove (Bug#12479).
+       (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
+       (ns_clear_frame, sendEvent, windowDidResize, drawRect:): Remove 
ns_in_resize
+       check.
+       (ns_clear_frame_area): Remove resize handle code.
+
+       * nsfns.m (ns_in_resize): Remove.
+       (x_set_icon_name, ns_set_name, ns_set_name_as_filename):  Remove 
ns_in_resize
+       check.
+
 2012-10-07  Paul Eggert  <address@hidden>
 
        Improve sys_siglist detection.

=== modified file 'src/nsfns.m'
--- a/src/nsfns.m       2012-10-06 17:31:11 +0000
+++ b/src/nsfns.m       2012-10-07 09:17:17 +0000
@@ -93,8 +93,6 @@
 /* Need forward declaration here to preserve organizational integrity of file 
*/
 Lisp_Object Fx_open_connection (Lisp_Object, Lisp_Object, Lisp_Object);
 
-extern BOOL ns_in_resize;
-
 /* Static variables to handle applescript execution.  */
 static Lisp_Object as_script, *as_result;
 static int as_status;
@@ -433,9 +431,6 @@
   NSView *view = FRAME_NS_VIEW (f);
   NSTRACE (x_set_icon_name);
 
-  if (ns_in_resize)
-    return;
-
   /* see if it's changed */
   if (STRINGP (arg))
     {
@@ -511,9 +506,6 @@
 {
   NSTRACE (ns_set_name);
 
-  if (ns_in_resize)
-    return;
-
   /* Make sure that requests from lisp code override requests from
      Emacs redisplay code.  */
   if (explicit)
@@ -612,7 +604,7 @@
   NSString *str;
   NSTRACE (ns_set_name_as_filename);
 
-  if (f->explicit_name || ! NILP (f->title) || ns_in_resize)
+  if (f->explicit_name || ! NILP (f->title))
     return;
 
   block_input ();

=== modified file 'src/nsterm.m'
--- a/src/nsterm.m      2012-10-06 17:31:11 +0000
+++ b/src/nsterm.m      2012-10-07 09:17:17 +0000
@@ -183,7 +183,6 @@
 static NSRect uRect;
 #endif
 static BOOL gsaved = NO;
-BOOL ns_in_resize = NO;
 static BOOL ns_fake_keydown = NO;
 int ns_tmp_flags; /* FIXME */
 struct nsfont_info *ns_tmp_font; /* FIXME */
@@ -493,17 +492,6 @@
 
    ========================================================================== 
*/
 
-static NSRect
-ns_resize_handle_rect (NSWindow *window)
-{
-  NSRect r = [window frame];
-  r.origin.x = r.size.width - RESIZE_HANDLE_SIZE;
-  r.origin.y = 0;
-  r.size.width = r.size.height = RESIZE_HANDLE_SIZE;
-  return r;
-}
-
-
 //
 // Window constraining
 // -------------------
@@ -1983,8 +1971,6 @@
   NSRect r;
 
   NSTRACE (ns_clear_frame);
-  if (ns_in_resize)
-    return;
 
  /* comes on initial frame because we have
     after-make-frame-functions = select-frame */
@@ -2004,10 +1990,6 @@
   NSRectFill (r);
   ns_unfocus (f);
 
-#ifdef NS_IMPL_COCOA
-  [[view window] display];  /* redraw resize handle */
-#endif
-
   /* as of 2006/11 or so this is now needed */
   ns_redraw_scroll_bars (f);
   unblock_input ();
@@ -2033,35 +2015,8 @@
   ns_focus (f, &r, 1);
   [ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), f) set];
 
-#ifdef NS_IMPL_COCOA
-  {
-    /* clip out the resize handle */
-    NSWindow *window = [FRAME_NS_VIEW (f) window];
-    NSRect ir
-      = [view convertRect: ns_resize_handle_rect (window) fromView: nil];
-
-    ir = NSIntersectionRect (r, ir);
-    if (NSIsEmptyRect (ir))
-      {
-#endif
-
   NSRectFill (r);
 
-#ifdef NS_IMPL_COCOA
-      }
-    else
-      {
-        NSRect r1 = r, r2 = r; /* upper and lower non-intersecting */
-        r1.size.height -= ir.size.height;
-        r2.origin.y += r1.size.height;
-        r2.size.width -= ir.size.width;
-        r2.size.height = ir.size.height;
-        NSRectFill (r1);
-        NSRectFill (r2);
-      }
-  }
-#endif
-
   ns_unfocus (f);
   return;
 }
@@ -4314,34 +4269,6 @@
       return;
     }
 
-#ifdef NS_IMPL_COCOA
-  /* pass mouse down in resize handle and subsequent drags directly to
-     EmacsWindow so we can generate continuous redisplays */
-  if (ns_in_resize)
-    {
-      if (type == NSLeftMouseDragged)
-        {
-          [window mouseDragged: theEvent];
-          return;
-        }
-      else if (type == NSLeftMouseUp)
-        {
-          [window mouseUp: theEvent];
-          return;
-        }
-    }
-  else if (type == NSLeftMouseDown)
-    {
-      NSRect r = ns_resize_handle_rect (window);
-      if (NSPointInRect ([theEvent locationInWindow], r))
-        {
-          ns_in_resize = YES;
-          [window mouseDown: theEvent];
-          return;
-        }
-    }
-#endif
-
   if (type == NSApplicationDefined)
     {
       /* Events posted by ns_send_appdefined interrupt the run loop here.
@@ -5567,12 +5494,7 @@
 
   if (cols > 0 && rows > 0)
     {
-      if (ns_in_resize)
-        x_set_window_size (emacsframe, 0, cols, rows);
-      else
-        {
-          [self updateFrameSize: YES];
-        }
+      [self updateFrameSize: YES];
     }
 
   ns_send_appdefined (-1);
@@ -6198,7 +6120,7 @@
 
   NSTRACE (drawRect);
 
-  if (!emacsframe || !emacsframe->output_data.ns || ns_in_resize)
+  if (!emacsframe || !emacsframe->output_data.ns)
     return;
 
   ns_clear_frame_area (emacsframe, x, y, width, height);
@@ -6535,60 +6457,6 @@
   return [super constrainFrameRect:frameRect toScreen:screen];
 }
 
-
-/* called only on resize clicks by special case in EmacsApp-sendEvent */
-- (void)mouseDown: (NSEvent *)theEvent
-{
-  if (ns_in_resize)
-    {
-      NSSize size = [[theEvent window] frame].size;
-      grabOffset = [theEvent locationInWindow];
-      grabOffset.x = size.width - grabOffset.x;
-    }
-  else
-    [super mouseDown: theEvent];
-}
-
-
-/* stop resizing */
-- (void)mouseUp: (NSEvent *)theEvent
-{
-  if (ns_in_resize)
-    {
-      struct frame *f = ((EmacsView *)[self delegate])->emacsframe;
-      ns_in_resize = NO;
-      ns_set_name_as_filename (f);
-      [self display];
-      ns_send_appdefined (-1);
-    }
-  else
-    [super mouseUp: theEvent];
-}
-
-
-/* send resize events */
-- (void)mouseDragged: (NSEvent *)theEvent
-{
-  if (ns_in_resize)
-    {
-      NSPoint p = [theEvent locationInWindow];
-      NSSize size, vettedSize, origSize = [self frame].size;
-
-      size.width = p.x + grabOffset.x;
-      size.height = origSize.height - p.y + grabOffset.y;
-
-      if (size.width == origSize.width && size.height == origSize.height)
-        return;
-
-      vettedSize = [[self delegate] windowWillResize: self toSize: size];
-      [[NSNotificationCenter defaultCenter]
-            postNotificationName: NSWindowDidResizeNotification
-                          object: self];
-    }
-  else
-    [super mouseDragged: theEvent];
-}
-
 @end /* EmacsWindow */
 
 


reply via email to

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