1. 03 Sep, 2017 1 commit
  2. 29 Aug, 2017 1 commit
  3. 23 Aug, 2017 1 commit
    • Alan Third's avatar
      Add ability to change macOS WM theme (bug#27973) · 7baa50ec
      Alan Third authored
      * src/frame.c (make_frame, frame_parms, syms_of_frame)
      [NS_IMPL_COCOA]: Add ns-appearance and ns-transparent-titlebar
      * src/frame.h (ns_appearance_type) [NS_IMPL_COCOA]: Add enum to
      represent NSAppearance options.
      (struct frame) [NS_IMPL_COCOA]: Add ns_appearance and
      ns_transparent_titlebar frame parameters.
      * src/nsfns.m (ns_frame_parm_handlers) [NS_IMPL_COCOA]: Add
      ns_set_appearance and ns_set_transparent_titlebar handlers.
      (Sx_create_frame): Handle ns-appearance and ns-transparent-titlebar
      frame parameters.
      (Qdark): Add new symbol for use with ns-appearance.
      * src/nsterm.h (ns_set_appearance, ns_set_transparent_titlebar)
      [NS_IMPL_COCOA]: Add prototypes.
      * src/nsterm.m (ns_set_appearance, ns_set_transparent_titlebar)
      [NS_IMPL_COCOA]: New functions.
      (initFrameFromEmacs) [NS_IMPL_COCOA]: Handle ns-appearance and
      ns-transparent-titlebar frame parameters.
      * doc/lispref/frames.texi (Window Management Parameters): Document
      ns-apperance and ns-transparent-titlebar.
  4. 16 Aug, 2017 1 commit
    • Alan Third's avatar
      Allow use of run-time OS version checks on macOS (bug#27810) · 69f2b755
      Alan Third authored
      * src/nsterm.h (NSWindowTabbingMode): Define in pre-Sierra macOS.
      NSApplicationPresentationAutoHideToolbar): Define in macOS 10.6.
      * src/nsterm.m (colorForEmacsRed, colorUsingDefaultColorSpace,
      check_native_fs, ns_read_socket, ns_select, runAlertPanel,
      initFrameFromEmacs, windowDidMiniaturize, windowDidEnterFullScreen,
      windowDidExitFullScreen, isFullscreen, updateCollectionBehavior,
      toggleFullScreen, constrainFrameRect, scrollerWidth, syms_of_nsterm):
      Allow use of run-time checks and replace version check macros.
      * src/nsfns.m (ns_screen_name): Use run-time OS version checks.
      * src/macfont.m (macfont_draw): Use run-time OS version checks.
      * src/nsmenu.m (menuWillOpen): Use run-time OS version checks.
      Co-authored-by: default avatarCharles A. Roelli <charles@aurox.ch>
  5. 23 Jul, 2017 1 commit
    • Charles A. Roelli's avatar
      Enable GUI Emacs without 'make install' on macOS (Bug #27645) · 2c87aab5
      Charles A. Roelli authored
      * nextstep/INSTALL: Correct it, and mention that Emacs can be run
      from 'src/emacs'.
      * src/nsterm.m (applicationDidFinishLaunching:): When Emacs is
      launched outside of a macOS application bundle, change its
      activation policy from the default 'prohibited' to 'regular'.
      ; * etc/NEWS: Mention the change on macOS.
  6. 15 Jul, 2017 1 commit
    • Alan Third's avatar
      Fix some frame handling issues on NS · 30444c69
      Alan Third authored
      * lisp/frame.el (mouse-absolute-pixel-position): Use new NS function.
      * src/nsfns.m (Sns_mouse_absolute_pixel_position): New function.
      * src/nsterm.m (x_make_frame_visible): Re-establish parent-child
      relationship if it's broken.
  7. 01 Jul, 2017 1 commit
    • Alan Third's avatar
      Fix threads on NS (bug#25265) · 0ad5fd4b
      Alan Third authored
      src/nsterm.h (ns_select): Compiler doesn't like sigmask being const.
      (ns_run_loop_break) [HAVE_PTHREAD]: New function.
      src/nsterm.m (ns_select): Call thread_select from within ns_select.
      (ns_run_loop_break) [HAVE_PTHREAD]: New function.
      (ns_send_appdefined): Don't wait for main thread when sending app
      defined event.
      src/process.c (wait_reading_process_output): Call thread_select from
      within ns_select.
      src/systhread.c (sys_cond_broadcast) [HAVE_NS]: Break ns_select out of
      its event loop using ns_run_loop_break.
  8. 12 Jun, 2017 1 commit
    • Alan Third's avatar
      Add no-focus-on-map to NS build (bug#25408) · 0f24ad7b
      Alan Third authored
      * src/nsfns.m (ns_frame_parm_handlers): Add x_set_no_focus_on_map.
      (x-create-frame): Check for no-focus-on-map.
      * src/nsterm.h (x_set_no_focus_on_map): New function.
      * src/nsterm.m (x_set_no_focus_on_map): New function.
      (ns_raise_frame): Add parameter for specifying whether to focus the
      (x_make_frame_visible): Handle new parameter for ns_raise_frame.
  9. 10 Jun, 2017 1 commit
  10. 21 May, 2017 6 commits
    • Philipp Stephani's avatar
      Avoid uninitialized read · 6f1f8822
      Philipp Stephani authored
      * src/nsterm.m (ns_read_socket): Don't read uninitialized variable 'nevents'.
    • Philipp Stephani's avatar
      Fix call of registerServicesMenuSendTypes · fa389f5b
      Philipp Stephani authored
      * src/nsterm.m (initFrameFromEmacs:): nil is not allowed for
      returnTypes; pass an empty array instead.
    • Philipp Stephani's avatar
      Remove unused automatic variables · 2d8215ae
      Philipp Stephani authored
      * nsterm.m (ns_read_socket):
      * macfont.m (macfont_open): Remove unused automatic variables.
    • Philipp Stephani's avatar
      Nextstep: remove some deprecated method calls · 762be778
      Philipp Stephani authored
      * src/nsterm.m (mouseDown:):
      * src/nsmenu.m (runMenuAt:forFrame:keymaps:): Remove call to
      deprecated method.  The return value is always nil.
      * src/macfont.m (mac_font_shape_1): Replace call to deprecated method.
    • Philipp Stephani's avatar
      Remove trailing semicolons in method definitions · f04e3d6e
      Philipp Stephani authored
      These semicolons are ignored and cause compiler warnings.
      * src/nsimage.m (setPixelAtX:Y:toRed:green:blue:alpha:):
      * src/nsterm.m (init, updateFrameSize:):
      (setFrame:): Remove trailing semicolon.
    • Philipp Stephani's avatar
      Nextstep: Use instancetype explicit return type · 84b28ec7
      Philipp Stephani authored
      This removes compiler warnings on macOS and improves type safety.
      * nsterm.m (initFrameFromEmacs:):
      (condemn, reprieve, setPosition:portion:whole:):
      * nsmenu.m (initWithTitle:):
      (init, initWithContentRect:styleMask:backing:defer:):
      * nsimage.m (allocInitFromFile:):
      (initForXPMWithDepth:width:height:): Use instancetype as return
      type instead of implicit id.
  11. 20 May, 2017 1 commit
    • Charles A. Roelli's avatar
      Fix macOS mouse movement · 7e5a8cdc
      Charles A. Roelli authored
      * lisp/frame.el (ns-set-mouse-absolute-pixel-position): New
      function (Lisp).
      (set-mouse-absolute-pixel-position): Change it to call
      `ns-set-mouse-absolute-pixel-position' on macOS.
      * src/nsfns.m (Fns_set_mouse_absolute_pixel_position): New
      * src/nsterm.h (NS_PARENT_WINDOW_TOP_POS): Use the primary
      screen's height as a base for calculating global coordinates.
      * src/nsterm.m (frame_set_mouse_pixel_position): Fix it in macOS.
      * test/lisp/mouse-tests.el (bug26816-mouse-frame-movement): Test
      movement of mouse relative to frame.
  12. 02 May, 2017 1 commit
  13. 26 Apr, 2017 1 commit
  14. 25 Apr, 2017 2 commits
    • Alan Third's avatar
      Fix define for GNUstep builds · f0424b13
      Alan Third authored
      * src/nsterm.m (initFrameFromEmacs): Fix the ifdef so that GNUstep
      doesn't see the code.
    • Alan Third's avatar
      Fix some NS frame handling issues · 603f634c
      Alan Third authored
      defines intended to make things tidier.
      (x_set_undecorated): Use the new defines.
      (windowWillResize): Don't use new macOS 12+ only feature.
      (initFrameFromEmacs): Use the new defines, and disable automatic
      window tabbing feature in macOS 12.
      (x_set_undecorated, x_set_parent_frame, x_set_no_accept_focus,
      x_set_z_group): Add NSTRACE notices.
  15. 22 Apr, 2017 1 commit
  16. 21 Apr, 2017 1 commit
    • Alan Third's avatar
      Add no-accept-focus and frame-list-z-order to NS port · d812d20f
      Alan Third authored
      * lisp/frame.el (frame-list-z-order): Add NS.
      * src/nsfns.m: Add x_set_no_accept_focus to handler struct.
      (Fx_create_frame): Handle no-accept-focus parameter.
      (Fns_frame_list_z_order): New functions.
      * src/nsterm.m (x_set_no_accept_focus): New function.
      (initFrameFromEmacs): Use EmacsWindow instead of EmacsFSWindow for
      non-fullscreen windows.
      (EmacsWindow:canBecomeKeyWindow): New function.
  17. 19 Apr, 2017 2 commits
    • Alan Third's avatar
      Fix bug introduced by my last commit · 21fa90b0
      Alan Third authored
      * src/nsterm.m (ns_draw_fringe_bitmap): Revert key-mashing accident.
    • Alan Third's avatar
      Add new frame functionality to NS port · aca21d42
      Alan Third authored
      * lisp/frame.el (frame-restack): Call ns-frame-restack.
      * src/keyboard.c (kbd_buffer_get_event) [HAVE_NS]: Enable
      MOVE_FRAME_EVENT handling.
      * src/frame.h:
      * src/frame.c: Enable 'z-group', 'undecorated' and 'parent' frame
      * src/nsfns.m: Add x_set_z_group, x_set_parent_frame and
      x_set_undecorated (Cocoa only) to handler struct.
      (Fx_create_frame): Handle 'z-group', 'parent-frame' and 'undecorated'
      frame parameter.
      (Fns_frame_restack): New function.
      * src/nsmenu.m (free_frame_tool_bar, update_frame_tool_bar):
      FRAME_TOOLBAR_HEIGHT is no longer a variable.
      Add #defines to find the screen position of the parent frame.
      (NS_TOP_POS): Remove defun.
      (EmacsView): Remove redundant toolbar variables and add createToolbar
      values instead of storing them in a variable.
      * src/nsterm.m (x_set_offset, windowDidMove): Take parent frame
      position into account when positioning frames.
      (initFrameFromEmacs): Remove toolbar creation code and handle new
      frame parameters.
      (x_set_window_size): Remove toolbar height calculation.
      (x_set_undecorated) [NS_IMPL_COCOA]: New function.
      (x_destroy_window): Detach parent if child closes.
      (updateFrameSize): Change NSTRACE message to reflect new reality and
      no longer reset frame size.
      (windowWillResize): Don’t change NS window name when the titlebar
      is invisible.
      (createToolbar): Move toolbar creation code into it’s own method.
      are no longer variables.
      (windowDidMove): Fire MOVE_FRAME_EVENT Emacs event.
  18. 17 Apr, 2017 1 commit
  19. 12 Apr, 2017 1 commit
    • Martin Rudalics's avatar
      Add new frame parameters and associated functions · 3fdd3bb5
      Martin Rudalics authored
      Add new frame parameters `undecorated', `override-redirect',
      `parent-frame', `skip-taskbar', `no-focus-on-map',
      `no-accept-focus', `z-group', `delete-before', `no-other-frame',
      `mouse-wheel-frame', `min-width', `min-height'.  Add new
      functions `frame-restack' and `frame-list-z-order'.
      * lisp/cus-start.el (focus-follows-mouse): Adapt customization
      * lisp/frame.el (handle-delete-frame): Handle child and
      `delete-before' frames.
      (other-frame): Stop looking for other frame after one round.
      (frame-list-z-order, frame-restack): New functions.
      (delete-other-frames): Handle child frames.
      * lisp/frameset.el (frameset-persistent-filter-alist)
      (frameset--record-relationships): Handle `delete-before',
      `parent-frame' and `mouse-wheel-frame' parameters.  Rename
      latter from `frameset--record-minibuffer-relationships'.
      (frameset--restore-frame): Handle ‘parent-frame’ parameter
      (frameset-restore): Handle `delete-before', `parent-frame' and
      `mouse-wheel-frame' parameters.
      * lisp/mwheel.el (mwheel-scroll): Handle `mouse-wheel-frame'
      * lisp/window.el (window--min-size-ignore-p): Fix doc-string.
      (mouse-autoselect-window-select, handle-select-window): Major
      rewrite.  Try to not ignore errors.  Handle auto-selection of
      child frames and different values of `focus-follows-mouse'.
      * src/frame.c (frame_windows_min_size): Handle new `min-width'
      and `min-height' frame parameters.
      (make_frame): Initialize new frame structure members.
      (do_switch_frame): Don't reset internal_last_event_frame for
      descendant frames.
      (Fframe_parent, frame_ancestor_p, Fframe_ancestor_p): New
      (candidate_frame): Don't return `no-other-frame' frame.
      (other_frames): New function replacing other_visible_frames.
      (delete_frame): Rewrite.  Handle child and `delete-before' frames.
      (Fmake_frame_invisible): Call other_frames.
      (store_frame_param): Check `delete-before' and `parent-frame'
      parameters for circular dependencies.
      (frame_parms, syms_of_frame): Add entries for and define new
      frame parameters.
      (focus_follows_mouse): New meaningful value `auto-raise'.
      * src/frame.h (z_group): New enumeration type.
      (frame): New slots parent_frame, undecorated, override_redirect,
      skip_taskbar, no_focus_on_map, no_accept_focus, z_group.
      (fset_parent_frame): New inlined function.
      (FRAME_Z_GROUP_BELOW): New macros.
      (frame_ancestor_p): Add declaration.
      * src/gtkutil.c (xg_create_frame_widgets): Handle
      `undecorated' and `override-redirect' frame parameters.
      (x_wm_set_size_hint): None for child frames.
      (xg_set_undecorated, xg_frame_restack, xg_set_skip_taskbar)
      (xg_set_no_focus_on_map, xg_set_no_accept_focus)
      (xg_set_override_redirect): New functions.
      (xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos):
      Don't let scrollbars obscure child frames.
      * src/gtkutil.h: (xg_set_undecorated, xg_frame_restack)
      (xg_set_skip_taskbar, xg_set_no_focus_on_map)
      (xg_set_no_accept_focus, xg_set_override_redirect): Add extern
      * src/nsfns.m (ns_frame_parm_handlers): Add entries for new
      frame parameters.
      (Fx_create_frame): Install `min-width' and `min-height' frame
      * src/nsterm.m (mouseMoved:): Handle focus_follows_mouse change.
      * src/w32fns.c (WS_EX_NOACTIVATE): Define if necessary.
      (x_real_positions): Handle child frames.
      (x_set_menu_bar_lines): Don't for child frames.
      (x_set_undecorated, x_set_parent_frame, x_set_skip_taskbar)
      (x_set_no_focus_on_map, x_set_no_accept_focus)
      (x_set_z_group): New functions.
      (w32_createvscrollbar, w32_createhscrollbar): Don't draw
      scroll bars over child frames.
      (w32_createwindow): Handle new frame parameters and child frames.
      (w32_wnd_proc): Let mouse clicks into a child frame activate
      the frame.  Try to handle the `no-accept-focus' parameter.  Do
      SetFocus when our window is brought to top or becomes the
      foreground window.
      (w32_window): Don't initialize menu bar for child frames.
      (Fx_create_frame): Handle new frame parameters.
      (x_create_tip_frame): Set explicit_parent slot.
      (w32_dialog_in_progress): New function.
      (Fx_file_dialog): Handle `z-group-above' frames.
      (w32_frame_list_z_order, Fw32_frame_list_z_order)
      (w32_frame_restack, Fw32_frame_restack): New functions.
      (w32_frame_parm_handlers): Add entries for new frame
      * src/w32font.c (Fx_select_font): Handle `z-group-above'
      frames during font selection dialogue.
      * src/w32term.c (construct_mouse_wheel): Construct mouse wheel
      event from F's w32 window.
      (w32_mouse_position): Handle child frames.
      (w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar):
      Don't draw scroll bars over child frames.
      (w32_read_socket): Always erase background of child frames.
      When generating SELECT_WINDOW_EVENTs handle new value of
      `focus-follows-mouse' and handle `no-accept-focus' parameter.
      Handle `mouse-wheel-frame' parameter.
      (x_calc_absolute_position, x_set_offset, x_set_window_size):
      Handle child frames.
      (x_make_frame_visible): Handle child frames specially.  Handle
      `no-focus-on-map' parameter.
      * src/w32term.h (w32_dialog_in_progress): Add external
      * src/xdisp.c (x_consider_frame_title, prepare_menu_bars): Not
      for child frames.
      * src/xfns.c (Xm/MwmUtil.h): Include for WM hints.
      (PropMotifWmHints, PROP_MOTIF_WM_HINTS_ELEMENTS): Define for
      non-Motif, non-GTK case.
      (x_real_pos_and_offsets): Handle child frames.
      (x_set_undecorated, x_set_parent_frame)
      (x_set_no_focus_on_map, x_set_no_accept_focus)
      (x_set_override_redirect): New functions.
      (x_set_menu_bar_lines): Not for child frames.
      (x_window): Handle `undecorated' and `override_redirect' cases.
      (Fx_create_frame): Handle new frame parameters.
      (frame_geometry): Handle child frames and outer border.
      (x_frame_list_z_order, Fx_frame_list_z_order)
      (x_frame_restack, Fx_frame_restack): New functions.
      (Fx_file_dialog, Fx_select_font): Set x_menu_set_in_use.
      (x_frame_parm_handlers): Add entries for new frame parameters.
      * src/xmenu.c (x_menu_set_in_use): Handle `z-group-above'
      * src/xterm.c (x_set_frame_alpha): Don't set alpha of parent
      for child frames.
      (XTmouse_position): Handle child frames.
      (x_scroll_bar_create, x_scroll_bar_expose): Don't let scroll
      bars obscure child frames.
      (handle_one_xevent): Handle child frame positions.  If necessary
      set `skip-taskbar' and reassign proper `z-group' when we are
      mapped.  When generating SELECT_WINDOW_EVENTs handle new value
      of `focus-follows-mouse'.  Handle `mouse-wheel-frame' parameter.
      Let mouse clicks into a child frame activate the frame.
      (x_calc_absolute_position, x_set_offset): Handle child frames
      (x_set_skip_taskbar, x_set_z_group): New functions.
      (x_make_frame_visible): Handle child frames.
      (ATOM_REFS_INIT): Add entries for
      Xatom_net_wm_state_skip_taskbar, Xatom_net_wm_state_above,
      * src/xterm.h (top-level): Declare Xatom_net_wm_state_above,
      Xatom_net_wm_state_below and Xatom_net_wm_state_skip_taskbar.
      (x_set_skip_taskbar, x_set_z_group): Add extern declarations.
  20. 14 Mar, 2017 3 commits
  21. 08 Mar, 2017 1 commit
  22. 06 Mar, 2017 2 commits
    • Alan Third's avatar
      Remove NSEvent loop from ns_select (bug#25265) · 3bd2e9e9
      Alan Third authored
      * src/nsterm.m (ns_select): Remove event processing loop and replace
      with simple test for a new event.
    • Eli Zaretskii's avatar
      A better fix for bug#25845 · eae5dcd5
      Eli Zaretskii authored
      * src/xdisp.c (font_for_underline_metrics): New function.
      * src/dispextern.h: Add its prototype.
      * src/xterm.c (x_draw_glyph_string):
      * src/w32term.c (x_draw_glyph_string):
      * src/nsterm.m (ns_draw_text_decoration): Call it.  This avoids
      having identical code 3 times in 3 different files.
  23. 05 Mar, 2017 1 commit
    • Eli Zaretskii's avatar
      Fix display of cursor on underlined text · 8e1ae12c
      Eli Zaretskii authored
      * src/nsterm.m (ns_draw_text_decoration):
      * src/xterm.c (x_draw_glyph_string):
      * src/w32term.c (x_draw_glyph_string): Compute the position and
      thickness of the underline by looking for the first glyph of the
      run of underlined glyphs that includes the glyph string we are
      drawing.  (Bug#25845)
  24. 02 Mar, 2017 2 commits
    • Paul Eggert's avatar
      Remove XFLOATINT · d0d26c13
      Paul Eggert authored
      * src/lisp.h (XFLOATINT): Remove this alias for extract_float.
      All callers changed to use extract_float.
      * src/frame.h (NUMVAL): Now an inline function, not a macro.
    • Eli Zaretskii's avatar
      Fix display of strike-through text in variable-height lines · 511a3c3b
      Eli Zaretskii authored
      * src/nsterm.m (ns_draw_text_decoration):
      * src/xterm.c (x_draw_glyph_string):
      * src/w32term.c (x_draw_glyph_string): Fix calculation of the
      strike-through y-coordinate for a glyph row which is taller than
      the strike-through text.  (Bug#25907)
  25. 19 Feb, 2017 1 commit
  26. 14 Jan, 2017 1 commit
  27. 08 Jan, 2017 1 commit
    • Alan Third's avatar
      Remove apploopnr · 88a501b3
      Alan Third authored
      * src/nsterm.m (ns_select, ns_read_socket): Remove apploopnr and only
      allow app loop to run in main thread.
  28. 04 Jan, 2017 1 commit
  29. 01 Jan, 2017 1 commit