emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r113653: * nsterm.h (EmacsView): Add maximizing_resi


From: Jan D.
Subject: [Emacs-diffs] trunk r113653: * nsterm.h (EmacsView): Add maximizing_resize, put it and old_title
Date: Fri, 02 Aug 2013 09:42:27 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113653
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/15005
committer: Jan D. <address@hidden>
branch nick: trunk
timestamp: Fri 2013-08-02 11:42:23 +0200
message:
  * nsterm.h (EmacsView): Add maximizing_resize, put it and old_title
  inside NS_IMPL_COCOA.
  
  * nsterm.m (windowWillResize:toSize:): Only change title if
  ! maximizing_resize && FULLSCREEN_NONE.  strdup title before
  modifying it.
  (viewDidEndLiveResize): New method.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/nsterm.h                   nsterm.h-20091113204419-o5vbwnq5f7feedwu-8746
  src/nsterm.m                   nsterm.m-20091113204419-o5vbwnq5f7feedwu-8747
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-08-02 07:07:08 +0000
+++ b/src/ChangeLog     2013-08-02 09:42:23 +0000
@@ -1,3 +1,13 @@
+2013-08-02  Jan Djärv  <address@hidden>
+
+       * 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  <address@hidden>
 
        * insdel.c (adjust_after_replace, replace_range, del_range_2):

=== modified file 'src/nsterm.h'
--- a/src/nsterm.h      2013-07-06 17:58:41 +0000
+++ b/src/nsterm.h      2013-08-02 09:42:23 +0000
@@ -109,7 +109,10 @@
 @interface EmacsView : NSView <NSTextInput>
 #endif
    {
+#ifdef NS_IMPL_COCOA
    char *old_title;
+   BOOL maximizing_resize;
+#endif
    BOOL windowClosing;
    NSString *workingText;
    BOOL processingCompose;

=== modified file 'src/nsterm.m'
--- a/src/nsterm.m      2013-08-01 14:54:29 +0000
+++ b/src/nsterm.m      2013-08-02 09:42:23 +0000
@@ -5663,17 +5663,17 @@
             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);
@@ -5712,22 +5712,28 @@
   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;
     }
+  maximizing_resize = NO;
+}
 #endif /* NS_IMPL_COCOA */
 
-  if (cols > 0 && rows > 0)
-    {
-      [self updateFrameSize: YES];
-    }
-
-  ns_send_appdefined (-1);
-}
-
 
 - (void)windowDidBecomeKey: (NSNotification *)notification
 /* cf. x_detect_focus_change(), x_focus_changed(), x_new_focus_frame() */
@@ -5831,7 +5837,10 @@
 
   FRAME_NS_VIEW (f) = self;
   emacsframe = f;
+#ifdef NS_IMPL_COCOA
   old_title = 0;
+  maximizing_resize = NO;
+#endif
 
   win = [[EmacsWindow alloc]
             initWithContentRect: r
@@ -5974,6 +5983,9 @@
       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)
     {
@@ -5992,12 +6004,18 @@
       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;
     }


reply via email to

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