aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Allow resizing undecorated frames on macOS (bug#28512, bug#31795)scratch/ns/testingAlan Third2021-11-141-11/+10
| | | | | | | | | * src/nsterm.m (FRAME_DECORATED_FLAGS, FRAME_UNDECORATED_FLAGS): Remove unused defines. * src/nsterm.m ([EmacsWindow initWithEmacsFrame:fullscreen:screen:]): Since this is now the only place these defines are used just put them inline and add NSWindowStyleMaskResizable for undecorated frames on Cocoa.
* Make NS toolbar item ID more unique (bug#50160)Alan Third2021-11-141-2/+2
| | | | | | | * src/nsmenu.m ([EmacsToolbar addDisplayItemWithImage:idx:tag:labelText:helpText:enabled:]): Add the label to the identifier to avoid collisions between toolbar items that use the same image.
* Make NS toolbar use NSString instead of C stringsAlan Third2021-11-143-12/+11
| | | | | | | | | * src/nsfns.m ([NSString stringWithLispString:]): Ensure that the lisp object is actually a string. * src/nsmenu.m (update_frame_tool_bar): Convert to NSString instead of C strings. ([EmacsToolbar addDisplayItemWithImage:idx:tag:labelText:helpText:enabled:]): No need to convert to NSString here anymore.
* Fix macfont backend color handlingAlan Third2021-11-141-11/+11
| | | | | | | | * src/macfont.m (get_cgcolor): Replace use of ns_lookup_indexed_color. (CG_SET_FILL_COLOR_WITH_FACE_FOREGROUND): (CG_SET_FILL_COLOR_WITH_FACE_BACKGROUND): (CG_SET_STROKE_COLOR_WITH_FACE_FOREGROUND): Fix call to get_cgcolor and fix all callers.
* Further cleanup of NS color codeAlan Third2021-11-148-125/+52
| | | | | | | | | | | | | | | | | | * src/dispextern.h (FACE_COLOR_TO_PIXEL): Remove define and fix all callers. * src/nsterm.h (struct nsfont_info): Remove color_table. * src/nsterm.m ([NSColor colorWithUnsignedLong:]): Always assume the input contains the correct alpha value. (ns_lookup_indexed_color): (ns_index_color): (ns_color_index_to_rgba): Remove functions and fix all callers. (ns_query_color): No longer set pixel to the lookup table index, always just set it to the ARGB integer value. (ns_defined_color): Ignore makeindex as we no longer set pixel to the lookup table index. (ns_initialize_display_info): (ns_redisplay_interface): Remove lookup table. (ns_term_init): Fix the alpha setting.
* Simplify NS color handlingAlan Third2021-11-144-107/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/image.c (RGB_TO_ULONG): (ARGB_TO_ULONG): (RED_FROM_ULONG): (RED16_FROM_ULONG): (GREEN16_FROM_ULONG): (BLUE16_FROM_ULONG): Define these here for NS too. * src/nsfns.m (ns_set_foreground_color): (ns_set_background_color): Use new EmacsColor methods. * src/nsterm.h (struct ns_color_table): Replace this struct with a built-in Objective C type. (RGB_TO_ULONG): (ARGB_TO_ULONG): (ALPHA_FROM_ULONG): (RED_FROM_ULONG): (GREEN_FROM_ULONG): (BLUE_FROM_ULONG): (RED16_FROM_ULONG): (GREEN16_FROM_ULONG): (BLUE16_FROM_ULONG): These are no longer needed in the NS specific code. (struct ns_display_info): Use an NSMutableArray instead of a custom struct. * src/nsterm.m ([NSColor colorWithUnsignedLong:hasAlpha:]): ([NSColor unsignedLong]): New methods. (ns_lookup_indexed_color): (ns_index_color): Use the NSMutableArray lookup table. (ns_term_init): (ns_color_index_to_rgba): (ns_query_color): Use the new EmacsColor methods. (ns_initialize_display_info): (ns_delete_display): Initialize and release the NSMutableArray lookup table.
* Only set LANG if the ID is validAlan Third2021-11-141-7/+10
| | | | | * src/nsterm.m (ns_init_locale): Check the provided locale identifier is available before trying to use it.
* Expose xwidget navigation history to Lisp codePo Lu2021-11-141-0/+95
| | | | | | | | * doc/lispref/display.texi (Xwidgets): Document changes. * etc/NEWS: Announce new function. * src/xwidget.c (Fxwidget_webkit_back_forward_list): New function. (syms_of_xwidget): Define new subr.
* Add `kill-xwidget'Po Lu2021-11-141-24/+57
| | | | | | | * doc/lispref/display.texi (Xwidgets): Document 'kill-xwidget'. * src/xwidget.c (kill_xwidget, Fkill_xwidget): New function. (syms_of_xwidget): Define new subr. (kill_buffer_xwidgets): Use `kill_xwidget' instead.
* Fix crash in xwidget_end_redisplayPo Lu2021-11-141-10/+7
| | | | | * src/xwidget.c (xwidget_end_redisplay): Always test if xv is NULL.
* Fix scroll event test in handle_one_xeventPo Lu2021-11-131-4/+2
| | | | | * src/xterm.c (handle_one_xevent): Test for scroll wheel button correctly in xwidget code.
* Fix font selection via :family on MS-WindowsEli Zaretskii2021-11-131-4/+25
| | | | | * src/font.c (font_delete_unmatched) [HAVE_NTGUI]: Allow non-exact matches of :weight when looking for a suitable font. (Bug#51768)
* Correct patch from 2021-11-12 on src/fileio.cAlan Mackenzie2021-11-131-7/+4
| | | | | | | * src/fileio.c (restore_window_points): Reverse commit 974192413f8a81171b8fd28dfd5c081ce06d3dec and instead replace a < by a <=. This ensures that if w->mpoint is at the top of the middle region being replaced, it gets adjusted and stays at the top after the reinsertion.
* Don't emit SELECT_WINDOW_EVENT when an xwidget is scrolledPo Lu2021-11-131-1/+3
| | | | | | * src/xterm.c (handle_one_event): Don't select xwidget window on button event if the button pressed actually represents the scroll wheel.
* Use GTK native file choosers in xwidget callbackPo Lu2021-11-131-12/+8
| | | | | * src/xwidget.c (run_file_chooser_cb): Use GtkFileChooserNative instead.
* Merge from origin/emacs-28Stefan Kangas2021-11-132-6/+7
|\ | | | | | | | | 42d4e24ff3 ; Fix typos 0d0125daae Improve documentation of 'decode-coding-region'
| * ; Fix typosStefan Kangas2021-11-121-2/+2
| |
| * Improve documentation of 'decode-coding-region'Eli Zaretskii2021-11-121-4/+5
| | | | | | | | | | | | | | | | * src/coding.c (Fdecode_coding_region): Doc fix. * doc/lispref/nonascii.texi (Coding System Basics) (Explicit Encoding): Explain the significance of using 'undecided' in 'decode-coding-*' functions.
* | Prevent NULL-pointer dereference on xwidget callback errorPo Lu2021-11-131-2/+2
| | | | | | | | | | * src/xwidget.c (webkit_javascript_finished_cb): Check if `error' is NULL before freeing it.
* | Fix file chooser hangs inside xwidget-webkitPo Lu2021-11-131-0/+71
| | | | | | | | | | | | * src/xwidget.c (run_file_chooser_cb): New function that runs a nested event loop instead of acting asynchronously. (Fmake_xwidget): Attach file chooser signal.
* | Remove unused xwidget code in EmacsFixed GTK widget classPo Lu2021-11-131-89/+0
| | | | | | | | | | | | | | | | | | | | | | This is no longer required, as we rely on X to position xwidgets now. It also makes resizing Emacs frames slightly slower. * src/emacsgtkfixed.c (EMACS_FIXED_GET_CLASS) (struct GtkFixedPrivateL) (emacs_fixed_gtk_widget_size_allocate) (emacs_fixed_class_init) [HAVE_XWIDGETS]: Remove unused code.
* | Don't start both timerfd and alarms on CygwinKen Brown2021-11-121-0/+7
| | | | | | | | | | * src/atimer.c (set_alarm) [CYGWIN]: Don't start both timerfd and alarms; this causes a slowdown. (Bug#51734)
* | In insert_file_contents, always set windows' point markers.Alan Mackenzie2021-11-121-3/+6
| | | | | | | | | | | | | | | | | | This fixes bug #51776. * src/fileio.c (restore_window_points): Restore a w->mpoint even when that marker originally pointed into the unchanged area near BOB or EOB. This prevents that window's point being moved a long way from its starting place due to the removal of the central part of the buffer by insert_file_contents.
* | ; * src/lread.c (safe_to_load_version, Fload): Fix coding style.Eli Zaretskii2021-11-121-6/+3
| |
* | Remove unused xlfd_ enumsLars Ingebrigtsen2021-11-121-46/+0
| | | | | | | | | | * src/xfaces.c: Remove xlfd_weight, xlfd_swidth and xlfd_slant enums. These seem to be unused in the Emacs sources.
* | Remove obsolete commentPo Lu2021-11-121-1/+0
| | | | | | | | | | | | | | | | | | The comment probably dated back to when xwidgets supported many other GTK+ widgets with other data. In the current implementation of xwidgets, everything that should be freed is already freed in `kill_buffer_xwidgets'. * src/xwidget.c (kill_buffer_xwidgets): Remove outdated TODO.
* | Allow choosing regular-weighted fonts when medium-weighted existLars Ingebrigtsen2021-11-121-2/+0
| | | | | | | | | | * src/ftfont.c (ftfont_pattern_entity): Allow using both regular and medium-weighted fonts.
* | Merge from origin/emacs-28Stefan Kangas2021-11-121-5/+7
|\ \ | |/ | | | | | | | | a6905e90cc Fix problem with temp buffer killing in package-install-file 144ad77fda Fix Lisp Intro markup error 24b86cb4f7 Fix ACL errors with WebDAV volumes on MS-Windows
| * Fix ACL errors with WebDAV volumes on MS-WindowsEli Zaretskii2021-11-111-5/+7
| | | | | | | | | | | | * src/w32.c (acl_get_file): Handle ERROR_INVALID_FUNCTION from WebDAV. Patch from Ioannis Kappas <ioannis.kappas@gmail.com>. (Bug#51773)
* | Fix doc string for xwidget-webkit-load-htmlPo Lu2021-11-121-1/+1
| | | | | | | | * src/xwidget.c (Fxwidget_webkit_load_html): Fix doc string.
* | Make "emacs --script /dev/stdin work again when that's a pipeBryan C. Mills2021-11-121-4/+12
| | | | | | | | | | | | | | | | | | * src/lread.c (Fload): Adjust callers. * src/lread.c (safe_to_load_version): Check lseek errors (Bug#48940). Copyright-paperwork-exempt: yes
* | Fix potential NULL dereference in xwidget-webkit-uriPo Lu2021-11-121-1/+4
| | | | | | | | | | * src/xwidget.c (Fxwidget_webkit_uri): Don't assume webkit_web_view_get_uri will always return a valid string.
* | Check for WebKit xwidgets inside all xwidget-webkit functionsPo Lu2021-11-121-15/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is done in preparation for the introduction of other xwidgets, such as media xwidgets, even though there are only WebKit widgets at present. * src/xwidget.c (CHECK_WEBKIT_XWIDGET): New macro. (WEBKIT_FN_INIT): Use CHECK_WEBKIT_XWIDGET. (Fxwidget_webkit_search, Fxwidget_webkit_next_result) (Fxwidget_webkit_previous_result) (Fxwidget_webkit_finish_search) (Fxwidget_webkit_load_html): Check that xwidget is a WebKit widget.
* | Prevent crashes from Lisp code modifying xwidget-listPo Lu2021-11-121-15/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/xwidget.c (internal_xwidget_view_list) (internal_xwidget_list): New variable. (find_xwidget_for_offscreen_window) (define_cursors, offscreen_damage_event) (webkit_ready_to_show, xwidget_init_view) (Fxwidget_resize, Fdelete_xwidget_view) (Fxwidget_view_lookup, xwidget_spec_value) (lookup_xwidget, xwidget_end_redisplay) (kill_frame_xwidget_views, kill_buffer_xwidgets) (Fmake_xwidget, Fget_buffer_xwidgets): Use internal list. (syms_of_xwidget): Initialize internal xwidget lists.
* | Prevent crashes in xwidgets whose buffers have been killedPo Lu2021-11-122-35/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/display.texi (Xwidgets): Explain meaning of killed xwidgets. * src/xwidget.c (Fxwidget_live_p): New function. (Fxwidget_perform_lispy_event, WEBKIT_FN_INIT) (Fxwidget_resize, Fxwidget_size_request) (Fxwidget_info, Fxwidget_plist) (Fset_xwidget_buffer, Fset_xwidget_plist) (Fset_xwidget_query_on_exit_flag) (Fxwidget_query_on_exit_flag) (Fxwidget_webkit_search) (Fxwidget_webkit_next_result) (Fxwidget_webkit_previous_result) (Fxwidget_webkit_finish_search) (Fxwidget_webkit_load_html): Check for live xwidgets instead of just xwidgets. (xwidget_button, xwidget_motion_or_crossing) (xv_do_draw, x_draw_xwidget_glyph_string) (Fdelete_xwidget_view): Ignore killed xwidgets. (syms_of_xwidget): Define new symbols and subrs and define appropriate weakness of id_to_xwidget map. (kill_buffer_xwidgets): Check live xwidgets instead of killed xwidgets, set xwidget buffer to nil, and rely on GC to free the hash table for us instead. * src/xwidget.h (XWIDGET_LIVE_P, CHECK_LIVE_XWIDGET): New macros.
* | Fix compilation on MS-WindowsEli Zaretskii2021-11-111-0/+2
| | | | | | | | | | * src/callproc.c (emacs_spawn) <fork_done>: Define the label only if USABLE_POSIX_SPAWN is defined, to avoid a compiler warning.
* | Use posix_spawn if possible.Philipp Stephani2021-11-111-1/+188
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | posix_spawn is less error-prone than vfork + execve, and can make better use of system-specific enhancements like 'clone' on Linux. Use it if we don't need to configure a pseudoterminal. * configure.ac (HAVE_SPAWN_H, HAVE_POSIX_SPAWN) (HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR) (HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR_NP) (HAVE_POSIX_SPAWNATTR_SETFLAGS, HAVE_DECL_POSIX_SPAWN_SETSID): New configuration variables. * src/callproc.c (USABLE_POSIX_SPAWN): New configuration macro. (emacs_posix_spawn_init_actions) (emacs_posix_spawn_init_attributes, emacs_posix_spawn_init): New helper functions. (emacs_spawn): Use posix_spawn if possible.
* | ; * src/term.c (init_tty): Fix last change.Eli Zaretskii2021-11-111-1/+1
| |
* | ; * src/term.c (init_tty): Fix style of parentheses.Eli Zaretskii2021-11-111-3/+3
| |
* | Fix 8-color PuTTY -nw sessions broken by a recent commitEli Zaretskii2021-11-111-1/+1
| | | | | | | | | | | | | | | | | | | | * src/term.c (init_tty): Fix the change which introduced support for the terminfo Tc flag. The code as installed broke colors in PuTTY -nw sessions, because 'tigetflag' returned -1, which is non-zero, so it was treated as the sign that true color is supported. But if the value returned by 'tigetflag' is -1, it means the capability is not a boolean one, so that's not to be used as a valid support for 24-bit color. (Bug#44950)
* | Support Tc terminfo flag for 24-bit color support in terminalTim Ruffing2021-11-111-4/+6
| | | | | | | | | | | | * src/term.c (init_tty): Use the Tc flag (bug#44950). Copyright-paperwork-exempt: yes
* | Add `xwidget-webkit-load-html'Po Lu2021-11-111-0/+41
| | | | | | | | | | | | | | * doc/lispref/display.texi (Xwidgets): Document new function. * etc/NEWS: Announce new function. * src/xwidget.c (Fxwidget_webkit_load_html): New function. (syms_of_xwidget): Define new subr.
* | Fix font weights on MS-WindowsEli Zaretskii2021-11-101-15/+18
| | | | | | | | | | | | * src/w32font.c (w32_decode_weight, w32_encode_weight) (w32_to_fc_weight): Adjust weight translations to match those in font.c and gtkutil.c:xg_weight_to_symbol. (Bug#51704)
* | Prevent GDK warning about missing event devices in most casesPo Lu2021-11-101-0/+5
| | | | | | | | | | * src/xwidget.c (synthesize_focus_in_event): Set event device to selected frame's pointer if it's an X frame.
* | Merge from origin/emacs-28Stefan Kangas2021-11-101-3/+1
|\ \ | |/ | | | | 2782bc113e Revert "Fix localized display of date and time in the NS p...
| * Revert "Fix localized display of date and time in the NS port"Stefan Kangas2021-11-091-3/+1
| | | | | | | | | | | | | | This reverts commit 5e05be566b0e13ce0b4e75da663fb051039f0751. This was discussed in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51321#93
* | Remove obsolete limitationPo Lu2021-11-101-3/+1
| | | | | | | | | | * src/xwidget.c (Fxwidget_webkit_goto_history): Accept any fixnum as REL-POS, to be consistent with docstring.
* | Fix incorrect offset calculation for clipped xwidget viewsPo Lu2021-11-101-4/+4
| | | | | | | | | | * src/xwidget.c (from_embedder, to_embedder): Remove incorrect adjustment of position by view clipping.
* | Fix invisible content in WebKit dialogsPo Lu2021-11-101-4/+15
| | | | | | | | | | * src/xwidget.c (webkit_script_dialog_cb): Use custom label instead of dialog box title to display message.
* | Set embedder correctly to fix menus appearing in the wrong locationPo Lu2021-11-102-0/+127
| | | | | | | | | | | | | | | | | | | | | | | | * src/xwidget.c (record_osr_embedder, from_embedder, to_embedder): New functions. (Fmake_xwidget): Attach from-embedder and to-embedder signals. (find_widget_for_offscreen_window): New function. (xwidget_button, xwidget_motion_or_crossing): Set embedder on event. (Fdelete_xwidget_view): Remove embedder status if applicable. * src/xwidget.h (struct xwidget): New fields `embedder' and `embedder-view'.