+2013-08-02 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsterm.m (windowWillResize:toSize:): Only change title if
+ ! maximizing_resize && FULLSCREEN_NONE (Bug#15005). strdup title before
+ modifying it.
+ (viewDidEndLiveResize): New method.
+
+ * nsterm.h (EmacsView): Add maximizing_resize, put it and old_title
+ inside NS_IMPL_COCOA.
+
2013-08-02 Dmitry Antipov <dmantipov@yandex.ru>
* insdel.c (adjust_after_replace, replace_range, del_range_2):
old_title = 0;
}
}
- else
+ else if (fs_state == FULLSCREEN_NONE && ! maximizing_resize)
{
char *size_title;
NSWindow *window = [self window];
if (old_title == 0)
{
- const char *t = [[[self window] title] UTF8String];
+ char *t = strdup ([[[self window] title] UTF8String]);
char *pos = strstr (t, " — ");
if (pos)
*pos = '\0';
- old_title = xstrdup (t);
+ old_title = t;
}
size_title = xmalloc (strlen (old_title) + 40);
esprintf (size_title, "%s — (%d x %d)", old_title, cols, rows);
NSTRACE (windowDidResize);
/*fprintf (stderr,"windowDidResize: %.0f\n",[theWindow frame].size.height); */
+if (cols > 0 && rows > 0)
+ {
+ [self updateFrameSize: YES];
+ }
+
+ ns_send_appdefined (-1);
+}
+
#ifdef NS_IMPL_COCOA
+- (void)viewDidEndLiveResize
+{
+ [super viewDidEndLiveResize];
if (old_title != 0)
{
+ [[self window] setTitle: [NSString stringWithUTF8String: old_title]];
xfree (old_title);
old_title = 0;
}
-#endif /* NS_IMPL_COCOA */
-
- if (cols > 0 && rows > 0)
- {
- [self updateFrameSize: YES];
- }
-
- ns_send_appdefined (-1);
+ maximizing_resize = NO;
}
+#endif /* NS_IMPL_COCOA */
- (void)windowDidBecomeKey: (NSNotification *)notification
FRAME_NS_VIEW (f) = self;
emacsframe = f;
+#ifdef NS_IMPL_COCOA
old_title = 0;
+ maximizing_resize = NO;
+#endif
win = [[EmacsWindow alloc]
initWithContentRect: r
maximized_width = -1;
result.origin.y = defaultFrame.origin.y;
[self setFSValue: FULLSCREEN_HEIGHT];
+#ifdef NS_IMPL_COCOA
+ maximizing_resize = YES;
+#endif
}
else if (next_maximized == FULLSCREEN_WIDTH)
{
maximized_width = result.size.width;
maximized_height = result.size.height;
[self setFSValue: FULLSCREEN_MAXIMIZED];
+#ifdef NS_IMPL_COCOA
+ maximizing_resize = YES;
+#endif
}
else
{
/* restore */
result = ns_userRect.size.height ? ns_userRect : result;
ns_userRect = NSMakeRect (0, 0, 0, 0);
+#ifdef NS_IMPL_COCOA
+ maximizing_resize = fs_state != FULLSCREEN_NONE;
+#endif
[self setFSValue: FULLSCREEN_NONE];
maximized_width = maximized_height = -1;
}