* 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. Fixes: debbugs:12479
This commit is contained in:
parent
31bcb42062
commit
3bc0a2f7e9
3 changed files with 15 additions and 143 deletions
|
@ -1,3 +1,15 @@
|
|||
2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
|
||||
|
||||
* 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 <eggert@cs.ucla.edu>
|
||||
|
||||
Improve sys_siglist detection.
|
||||
|
|
10
src/nsfns.m
10
src/nsfns.m
|
@ -93,8 +93,6 @@ Updated by Christian Limpach (chris@nice.ch)
|
|||
/* 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 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
|
|||
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 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
|
|||
{
|
||||
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 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
|
|||
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 ();
|
||||
|
|
136
src/nsterm.m
136
src/nsterm.m
|
@ -183,7 +183,6 @@ Updated by Christian Limpach (chris@nice.ch)
|
|||
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 @@ Free a pool and temporary objects it refers to (callable from C)
|
|||
|
||||
========================================================================== */
|
||||
|
||||
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 @@ Free a pool and temporary objects it refers to (callable from C)
|
|||
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 @@ Free a pool and temporary objects it refers to (callable from C)
|
|||
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 @@ Free a pool and temporary objects it refers to (callable from C)
|
|||
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 @@ - (void)sendEvent: (NSEvent *)theEvent
|
|||
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 @@ - (void)windowDidResize: (NSNotification *)notification
|
|||
|
||||
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 @@ - (void)drawRect: (NSRect)rect
|
|||
|
||||
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 @@ - (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen
|
|||
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 */
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue