source: trunk/dports/aqua/emacs-app/files/patch-lion-fullscreen.diff @ 94319

Last change on this file since 94319 was 94319, checked in by hum@…, 8 years ago

emacs-app: update to 24.1; update patches for inline, fullscreen; remove patches for clang, jpfont, title-bar.

File size: 6.9 KB
  • lisp/term/ns-win.el

    === modified file 'lisp/term/ns-win.el'
     
    928928(add-to-list 'frame-creation-function-alist '(ns . x-create-frame-with-faces))
    929929(add-to-list 'window-system-initialization-alist '(ns . ns-initialize-window-system))
    930930
     931(declare-function ns-toggle-fullscreen-internal "nsfns.m" ())
     932(defun ns-toggle-fullscreen ()
     933  (interactive)
     934  (ns-toggle-fullscreen-internal))
    931935
    932936(provide 'ns-win)
    933937
  • src/nsfns.m

    === modified file 'src/nsfns.m'
     
    25672567}
    25682568
    25692569
     2570DEFUN ("ns-toggle-fullscreen-internal", Fns_toggle_fullscreen_internal, Sns_toggle_fullscreen_internal,
     2571        0, 0, 0,
     2572        doc: /* Toggle fulscreen mode */)
     2573()
     2574{
     2575  struct frame *f = SELECTED_FRAME();
     2576  EmacsWindow *window = ns_get_window(f);
     2577
     2578#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
     2579  [window toggleFullScreen:nil];
     2580#endif
     2581
     2582  return Qnil;
     2583}
     2584
     2585
    25702586/* ==========================================================================
    25712587
    25722588    Class implementations
     
    27242740  defsubr (&Sx_show_tip);
    27252741  defsubr (&Sx_hide_tip);
    27262742
     2743  defsubr (&Sns_toggle_fullscreen_internal);
     2744
    27272745  /* used only in fontset.c */
    27282746  check_window_system_func = check_ns;
    27292747
  • src/nsmenu.m

    === modified file 'src/nsmenu.m'
     
    986986   -------------------------------------------------------------------------- */
    987987{
    988988  BLOCK_INPUT;
    989   [[FRAME_NS_VIEW (f) toolbar] setVisible: NO];
     989  [[FRAME_NS_VIEW (f) window] setToolbar: nil];
    990990  FRAME_TOOLBAR_HEIGHT (f) = 0;
    991991  UNBLOCK_INPUT;
    992992}
     
    10031003  EmacsToolbar *toolbar = [view toolbar];
    10041004
    10051005  BLOCK_INPUT;
     1006  [window setToolbar: toolbar];
     1007
    10061008  [toolbar clearActive];
    10071009
    10081010  /* update EmacsToolbar as in GtkUtils, build items list */
  • src/nsterm.h

    === modified file 'src/nsterm.h'
     
    3838#ifndef MAC_OS_X_VERSION_10_6
    3939#define MAC_OS_X_VERSION_10_6 1060
    4040#endif
     41#ifndef MAC_OS_X_VERSION_10_7
     42#define MAC_OS_X_VERSION_10_7 1070
     43#endif
    4144#endif /* NS_IMPL_COCOA */
    4245
    4346#ifdef __OBJC__
  • src/nsterm.m

    === modified file 'src/nsterm.m'
     
    52995299#endif
    53005300  if (rows < MINHEIGHT)
    53015301    rows = MINHEIGHT;
    5302 #ifdef NS_IMPL_COCOA
    5303   {
    5304     /* this sets window title to have size in it; the wm does this under GS */
    5305     NSRect r = [[self window] frame];
    5306     if (r.size.height == frameSize.height && r.size.width == frameSize.width)
    5307       {
    5308         if (old_title != 0)
    5309           {
    5310             xfree (old_title);
    5311             old_title = 0;
    5312           }
    5313       }
    5314     else
    5315       {
    5316         char *size_title;
    5317         NSWindow *window = [self window];
    5318         if (old_title == 0)
    5319           {
    5320             const char *t = [[[self window] title] UTF8String];
    5321             char *pos = strstr (t, "  —  ");
    5322             if (pos)
    5323               *pos = '\0';
    5324             old_title = (char *) xmalloc (strlen (t) + 1);
    5325             strcpy (old_title, t);
    5326           }
    5327         size_title = xmalloc (strlen (old_title) + 40);
    5328         esprintf (size_title, "%s  —  (%d x %d)", old_title, cols, rows);
    5329         [window setTitle: [NSString stringWithUTF8String: size_title]];
    5330         [window display];
    5331         xfree (size_title);
    5332       }
    5333   }
    5334 #endif /* NS_IMPL_COCOA */
     5302
    53355303/*fprintf (stderr,"    ...size became %.0f x %.0f  (%d x %d)\n",frameSize.width,frameSize.height,cols,rows); */
    53365304
    53375305  return frameSize;
     
    53535321  NSTRACE (windowDidResize);
    53545322/*fprintf (stderr,"windowDidResize: %.0f\n",[theWindow frame].size.height); */
    53555323
    5356 #ifdef NS_IMPL_COCOA
    5357   if (old_title != 0)
    5358     {
    5359       xfree (old_title);
    5360       old_title = 0;
    5361     }
    5362 #endif /* NS_IMPL_COCOA */
    5363 
    53645324  /* Avoid loop under GNUstep due to call at beginning of this function.
    53655325     (x_set_window_size causes a resize which causes
    53665326     a "windowDidResize" which calls x_set_window_size).  */
     
    53885348  ns_send_appdefined (-1);
    53895349}
    53905350
     5351#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
     5352- (void)windowDidEnterFullScreen:(NSNotification *)notification
     5353{
     5354    NSTRACE (windowDidEnterFullScreen);
     5355    /* NSLog(@"Calling windowDidEnterFullScreen"); */
     5356   
     5357    NSWindow *window = [self window];
     5358    NSRect wr = [window frame];
     5359    int w = (int)wr.size.width - emacsframe->border_width;
     5360    int h = (int)wr.size.height;
     5361    cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS(emacsframe, w);
     5362    rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES(emacsframe, h);
     5363    /* NSLog(@"window_size=%dx%d (%dx%d)", w, h, cols, rows); */
     5364    FRAME_PIXEL_WIDTH (emacsframe) = w;
     5365    FRAME_PIXEL_HEIGHT (emacsframe) = h;
     5366    change_frame_size (emacsframe, rows, cols, 0, 1, 0);
     5367    SET_FRAME_GARBAGED (emacsframe);
     5368    cancel_mouse_face (emacsframe);
     5369    ns_send_appdefined (-1);
     5370}
     5371#endif
     5372
     5373#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
     5374- (void)windowDidExitFullScreen:(NSNotification *)notification
     5375{
     5376    NSTRACE (windowDidExitFullScreen);
     5377    /* NSLog(@"Calling windowDidExitFullScreen"); */
     5378   
     5379    NSWindow *window = [self window];
     5380    NSRect wr = [window frame];
     5381    int w = (int)wr.size.width - emacsframe->border_width;
     5382    int h = (int)wr.size.height
     5383    - FRAME_NS_TITLEBAR_HEIGHT (emacsframe)
     5384    - FRAME_TOOLBAR_HEIGHT (emacsframe);
     5385    cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS(emacsframe, w);
     5386    rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES(emacsframe, h);
     5387    /* NSLog(@"window_size=%dx%d (%dx%d)", w, h, cols, rows); */
     5388    FRAME_PIXEL_WIDTH (emacsframe) = w;
     5389    FRAME_PIXEL_HEIGHT (emacsframe) = h;
     5390    change_frame_size (emacsframe, rows, cols, 0, 1, 0);
     5391    SET_FRAME_GARBAGED (emacsframe);
     5392    cancel_mouse_face (emacsframe);
     5393    ns_send_appdefined (-1);
     5394}
     5395#endif
     5396
     5397#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
     5398- (NSApplicationPresentationOptions)window:(NSWindow *)window willUseFullScreenPresentationOptions:(NSApplicationPresentationOptions)proposedOptions
     5399{
     5400    /* NSLog(@"Calling window:willUseFullScreenPresentationOptions: %d", proposedOptions); */
     5401    return proposedOptions | NSApplicationPresentationAutoHideToolbar;
     5402}
     5403#endif
     5404
    53915405
    53925406- (void)windowDidBecomeKey: (NSNotification *)notification
    53935407/* cf. x_detect_focus_change(), x_focus_changed(), x_new_focus_frame() */
     
    55595573  [NSApp registerServicesMenuSendTypes: ns_send_types
    55605574                           returnTypes: nil];
    55615575
     5576#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
     5577  if (NSApp != nil)
     5578  {
     5579    [NSApp setPresentationOptions: NSApplicationPresentationFullScreen | [NSApp presentationOptions] ];
     5580    [win setCollectionBehavior: NSWindowCollectionBehaviorFullScreenPrimary | [win collectionBehavior] ];
     5581  }
     5582#endif
     5583
    55625584  ns_window_num++;
    55635585  return self;
    55645586}
Note: See TracBrowser for help on using the repository browser.