]> code.delx.au - gnu-emacs/commitdiff
Merge branch 'master' of /Volumes/HD2/build/emacs-git-ssh
authorAnders Lindgren <andlind@gmail.com>
Wed, 28 Oct 2015 11:13:18 +0000 (12:13 +0100)
committerAnders Lindgren <andlind@gmail.com>
Wed, 28 Oct 2015 11:13:18 +0000 (12:13 +0100)
1  2 
src/nsterm.m

diff --combined src/nsterm.m
index be860610b47495def343b2cfa0815ef32828dfcf,ba205f53f4b75e5abe4da4d2b80cfc40d6bec5a4..925e9af30a73c63fdfb5d544072e78441935b8e9
@@@ -844,8 -844,6 +844,8 @@@ ns_constrain_all_frames (void
  
    NSTRACE ("ns_constrain_all_frames");
  
 +  block_input ();
 +
    FOR_EACH_FRAME (tail, frame)
      {
        struct frame *f = XFRAME (frame);
                            display:NO];
          }
      }
 +
 +  unblock_input ();
  }
  
  
@@@ -1501,7 -1497,7 +1501,7 @@@ x_set_window_size (struct frame *f
    if (view == nil)
      return;
  
-   NSTRACE_RECT ("input", wr);
+   NSTRACE_RECT ("current", wr);
  
  /*fprintf (stderr, "\tsetWindowSize: %d x %d, pixelwise %d, font size %d x %d\n", width, height, pixelwise, FRAME_COLUMN_WIDTH (f), FRAME_LINE_HEIGHT (f));*/
  
           make_number (FRAME_NS_TITLEBAR_HEIGHT (f)),
           make_number (FRAME_TOOLBAR_HEIGHT (f))));
  
-   [view setRows: rows andColumns: cols];
    NSTRACE_RECT ("setFrame", wr);
    [window setFrame: wr display: YES];
  
@@@ -3639,7 -3634,7 +3638,7 @@@ ns_send_appdefined (int value
                recognize and take as a command to halt the event loop.
     -------------------------------------------------------------------------- */
  {
 -  /*NSTRACE ("ns_send_appdefined"); */
 +  NSTRACE ("ns_send_appdefined");
  
  #ifdef NS_IMPL_GNUSTEP
    // GNUstep needs postEvent to happen on the main thread.
@@@ -4533,8 -4528,6 +4532,8 @@@ ns_term_init (Lisp_Object display_name
    if (ns_initialized) return x_display_list;
    ns_initialized = 1;
  
 +  block_input ();
 +
    NSTRACE ("ns_term_init");
  
    [outerpool release];
  
    NSTRACE_MSG ("ns_term_init done");
  
 +  unblock_input ();
 +
    return dpyinfo;
  }
  
@@@ -4811,8 -4802,6 +4810,8 @@@ ns_term_shutdown (int sig
  
  - (id)init
  {
 +  NSTRACE ("[EmacsApp init]");
 +
    if ((self = [super init]))
      {
  #ifdef NS_IMPL_COCOA
  #ifdef NS_IMPL_COCOA
  - (void)run
  {
 +  NSTRACE ("[EmacsApp run]");
 +
  #ifndef NSAppKitVersionNumber10_9
  #define NSAppKitVersionNumber10_9 1265
  #endif
  
  - (void)stop: (id)sender
  {
 +  NSTRACE ("[EmacsApp stop]");
 +
      shouldKeepRunning = NO;
      // Stop possible dialog also.  Noop if no dialog present.
      // The file dialog still leaks 7k - 10k on 10.9 though.
  
  - (void)logNotification: (NSNotification *)notification
  {
 +  NSTRACE ("[EmacsApp logNotification]");
 +
    const char *name = [[notification name] UTF8String];
    if (!strstr (name, "Update") && !strstr (name, "NSMenu")
        && !strstr (name, "WindowNumber"))
    int type = [theEvent type];
    NSWindow *window = [theEvent window];
  
 -/*  NSTRACE ("sendEvent"); */
 +  NSTRACE ("[EmacsApp sendEvent]");
  /*fprintf (stderr, "received event of type %d\t%d\n", type);*/
  
  #ifdef NS_IMPL_GNUSTEP
  
  - (void)newFrame: (id)sender
  {
 +  NSTRACE ("[EmacsApp newFrame]");
 +
    struct frame *emacsframe = SELECTED_FRAME ();
    NSEvent *theEvent = [NSApp currentEvent];
  
  /* Open a file (used by below, after going into queue read by ns_read_socket) */
  - (BOOL) openFile: (NSString *)fileName
  {
 +  NSTRACE ("[EmacsApp openFile]");
 +
    struct frame *emacsframe = SELECTED_FRAME ();
    NSEvent *theEvent = [NSApp currentEvent];
  
       When application is loaded, terminate event loop in ns_term_init
     -------------------------------------------------------------------------- */
  {
 -  NSTRACE ("applicationDidFinishLaunching");
 +  NSTRACE ("[EmacsApp applicationDidFinishLaunching]");
 +
  #ifdef NS_IMPL_GNUSTEP
    ((EmacsApp *)self)->applicationDidFinishLaunchingCalled = YES;
  #endif
  
  - (void) terminate: (id)sender
  {
 +  NSTRACE ("[EmacsApp terminate]");
 +
    struct frame *emacsframe = SELECTED_FRAME ();
  
    if (!emacs_event)
@@@ -5138,8 -5114,6 +5137,8 @@@ runAlertPanel(NSString *title
  
  - (NSApplicationTerminateReply)applicationShouldTerminate: (id)sender
  {
 +  NSTRACE ("[EmacsApp applicationShouldTerminate]");
 +
    bool ret;
  
    if (NILP (ns_confirm_quit)) //   || ns_shutdown_properly  --> TO DO
@@@ -5219,13 -5193,11 +5218,13 @@@ not_in_argv (NSString *arg
  /* TODO: these may help w/IO switching btwn terminal and NSApp */
  - (void)applicationWillBecomeActive: (NSNotification *)notification
  {
 +  NSTRACE ("[EmacsApp applicationWillBecomeActive]");
    //ns_app_active=YES;
  }
 +
  - (void)applicationDidBecomeActive: (NSNotification *)notification
  {
 -  NSTRACE ("applicationDidBecomeActive");
 +  NSTRACE ("[EmacsApp applicationDidBecomeActive]");
  
  #ifdef NS_IMPL_GNUSTEP
    if (! applicationDidFinishLaunchingCalled)
  }
  - (void)applicationDidResignActive: (NSNotification *)notification
  {
 +  NSTRACE ("[EmacsApp applicationDidResignActive]");
 +
    //ns_app_active=NO;
    ns_send_appdefined (-1);
  }
    NSTRACE ("updateFrameSize");
    NSTRACE_SIZE ("Original size", NSMakeSize (oldw, oldh));
    NSTRACE_RECT ("Original frame", wr);
+   NSTRACE_MSG  ("Original columns: %d", cols);
+   NSTRACE_MSG  ("Original rows: %d", rows);
  
    if (! [self isFullscreen])
      {
    if (wait_for_tool_bar)
      {
        if (FRAME_TOOLBAR_HEIGHT (emacsframe) == 0)
-         return;
+         {
+           NSTRACE_MSG ("Waiting for toolbar");
+           return;
+         }
        wait_for_tool_bar = NO;
      }
  
    neww = (int)wr.size.width - emacsframe->border_width;
    newh = (int)wr.size.height - extra;
  
+   NSTRACE_SIZE ("New size", NSMakeSize (neww, newh));
+   NSTRACE_MSG ("tool_bar_height: %d", emacsframe->tool_bar_height);
    cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (emacsframe, neww);
    rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (emacsframe, newh);
  
    if (rows < MINHEIGHT)
      rows = MINHEIGHT;
  
+   NSTRACE_MSG  ("New columns: %d", cols);
+   NSTRACE_MSG  ("New rows: %d", rows);
    if (oldr != rows || oldc != cols || neww != oldw || newh != oldh)
      {
        NSView *view = FRAME_NS_VIEW (emacsframe);
        [view setFrame: wr];
        [self windowDidMove:nil];   // Update top/left.
      }
+   else
+     {
+       NSTRACE_MSG ("No change");
+     }
  }
  
  - (NSSize)windowWillResize: (NSWindow *)sender toSize: (NSSize)frameSize
  {
    NSTRACE ("windowDidResize");
  
+   if (emacsframe->output_data.ns->in_animation)
+     {
+       NSTRACE_MSG ("Ignored (in animation)");
+       return;
+     }
    if (! [self fsIsNative])
      {
        NSWindow *theWindow = [notification object];
  
  - (void) setRows: (int) r andColumns: (int) c
  {
+   NSTRACE ("[EmacsView setRows:%d andColumns:%d]", r, c);
    rows = r;
    cols = c;
  }