summaryrefslogtreecommitdiff
path: root/src/xwidget.c
AgeCommit message (Collapse)Author
2026-05-23New function memory_full_upPaul Eggert
* src/alloc.c (memory_full_up): New function. Replace all callers of memory_full (SIZE_MAX) with callers to this function. This simplifies callers and should make future changes easier. It also saves a whopping 296 bytes in executable size with gcc 16.1.1 20260515 (Red Hat 16.1.1-2) x86-64.
2026-04-12; * src/xwidget.c (Fmake_xwidget): Fix commentary.Eli Zaretskii
2026-04-12xwidgets: re-enable with newer webkit2gtkDirk-Jan C. Binnema
By disabling hw-acceleration we can re-enable xwidgets with newer webkit2gtk versions (Bug#80728). Newer versions were disallowed (Bug#66068) since they abort when a webkit view is created; however, they work fine as long as we disable hw-acceleration, since the off-screen windows that xwidgets uses do not support that. * configure.ac: Remove upper-bound for webkit2gtk version check. * src/xwidget.c (Fmake_xwidget): Turn off hardware-acceleration. Copyright-paperwork-exempt: yes
2026-01-01; Add 2026 to copyright years.Sean Whitton
2025-12-21; Avoid compilation warnings in xwidget.c on macOSEli Zaretskii
* src/xwidget.c (Fxwidget_perform_lispy_event): Avoid compiler warnings about set but not used variables. (Bug#80044)
2025-01-01Update copyright year to 2025Paul Eggert
Run "TZ=UTC0 admin/update-copyright".
2024-06-19Avoid compilation warningsEli Zaretskii
* src/xwidget.c (Fxwidget_perform_lispy_event): Avoid compiler warnings. (Bug#71638)
2024-05-09Replace calls to intern with a constant string with DEFSYMsPo Lu
* src/alloc.c (display_malloc_warning, syms_of_alloc): * src/buffer.c (Fmake_indirect_buffer, Fbuffer_local_variables) (Frename_buffer, Fkill_buffer, Fset_buffer_major_mode) (Fset_buffer_multibyte, syms_of_buffer): * src/callint.c (read_file_name, Fcall_interactively) (syms_of_callint): * src/callproc.c (call_process, create_temp_file) (syms_of_callproc): * src/charset.c (Fdefine_charset_internal, syms_of_charset): * src/cmds.c (internal_self_insert, syms_of_cmds): * src/coding.c (record_conversion_result) (Fdefine_coding_system_internal, syms_of_coding): * src/dbusbind.c (xd_signature, Fdbus_message_internal) (syms_of_dbusbind): * src/dispnew.c (init_faces_initial): * src/doc.c (Fsnarf_documentation, syms_of_doc): * src/dosfns.c (system_process_attributes, syms_of_dosfns): * src/emacs.c (init_cmdargs, Fdump_emacs, decode_env_path) (syms_of_emacs): * src/eval.c (call_debugger, Fdefvaralias, syms_of_eval): * src/fileio.c (barf_or_query_if_file_exists) (Finsert_file_contents, auto_save_error, Fdo_auto_save) (syms_of_fileio): * src/filelock.c (lock_file_1, syms_of_filelock): * src/fontset.c (fontset_from_font, syms_of_fontset): * src/frame.c (make_frame_without_minibuffer, syms_of_frame): * src/gnutls.c (emacs_gnutls_certificate_details) (Fgnutls_peer_status_warning_describe, Fgnutls_peer_status) (gnutls_verify_boot, syms_of_gnutls): * src/gtkutil.c (style_changed_cb, find_rtl_image): * src/image.c (imagemagick_filename_hint, gs_load) (syms_of_image): * src/keyboard.c (command_loop_1, read_char, timer_start_idle) (read_char_minibuf_menu_prompt, Fsuspend_emacs) (syms_of_keyboard): * src/keymap.c (Fmap_keymap, Flookup_key, Fdescribe_vector) (describe_vector, syms_of_keymap): * src/lread.c (Fread, Fread_positioning_symbols, syms_of_lread): * src/minibuf.c (Fabort_minibuffers, Fread_buffer) (Fcompleting_read, syms_of_minibuf): * src/msdos.c (XMenuActivate, run_msdos_command, syms_of_msdos): * src/nsfns.m (Fx_display_backing_store, Fx_display_visual_class) (Fns_hide_emacs, Fsystem_move_file_to_trash, ns_create_tip_frame) (x_hide_tip, Fx_show_tip, syms_of_nsfns): * src/nsfont.m (ns_spec_to_descriptor, ns_descriptor_to_entity) (syms_of_nsfont): * src/pdumper.c (Fdump_emacs_portable): * src/pgtkfns.c (Fx_display_visual_class, x_create_tip_frame) (Fx_show_tip, syms_of_pgtkfns): * src/pgtkterm.c (syms_of_pgtkterm, pgtk_cr_export_frames): * src/term.c (term_get_fkeys_1, set_tty_color_mode, Fsuspend_tty) (Fresume_tty, tty_menu_activate, syms_of_term): * src/terminal.c (create_terminal, syms_of_terminal): * src/w32fns.c (Fx_display_backing_store) (Fx_display_visual_class, Fset_message_beep, Fx_open_connection) (Fx_show_tip, Fx_file_dialog, Fsystem_move_file_to_trash) (Fw32_toggle_lock_key, syms_of_w32fns): * src/w32font.c (w32_enumfont_pattern_entity, syms_of_w32font): * src/w32term.c (w32_bitmap_icon, syms_of_w32term): * src/xdisp.c (message_dolog, define_frame_cursor1) (syms_of_xdisp): * src/xfaces.c (tty_lookup_color, syms_of_xfaces): * src/xml.c (make_dom, syms_of_xml): * src/xterm.c (syms_of_xterm): * src/xwidget.c (store_xwidget_download_callback_event) (store_xwidget_js_callback_event, syms_of_xwidget): Define symbols for symbols interned with `intern' from a constant string, delete duplicate DEFSYM directives, and substitute them for such calls to intern. This excludes only those symbols which are interned and referenced only once during Emacs's initialization, the timing of whose interning is inconsequential, and symbols in w32.c, which would need to be transferred to a new syms_of_w32 function that I cannot test.
2024-03-15; * src/xwidget.c (xwidget-webkit-disable-javascript): Doc fix.Eli Zaretskii
2024-03-15Fix last changePo Lu
* src/xwidget.c (Fmake_xwidget): Cast boolean value to gboolean. (syms_of_xwidget): Fix coding style and improve doc string.
2024-03-14; Fix last change (bug#68604)Eli Zaretskii
* lisp/xwidget.el (xwidget-webkit-disable-javascript): Move from here... * lisp/cus-start.el (standard): ...to here. * src/xwidget.c (syms_of_xwidget) <xwidget-webkit-disable-javascript>: Doc fix. * doc/emacs/misc.texi (Embedded WebKit Widgets): Fix wording.
2024-03-14Add user option to disable JavaScript in xwidget webviewNoé Lopez
* src/xwidget.c: Add the 'xwidget-webkit-disable-javascript' variable to disable JavaScript in WebKit sessions. (Bug#68604) * etc/NEWS: * doc/emacs/misc.texi (Embedded Webkit Widgets): Document the change.
2024-01-02; Add 2024 to copyright yearsPo Lu
2023-03-02Improvements to xwidget on macOS (bug#60703)Andrew De Angelis
* src/nsxwidget.m () ([XwWebView initWithFrame:configuration:xwidget:]) (nsxwidget_init): Fixed memory leaks: when sending an alloc message to an object, send an autorelease message to any objects we won't explictly release. ([XwWebView webView:didFinishNavigation:]): Second string to store in 'store_xwidget_event_string' is "load finished" rather than empty string. ([XwWebView webView:didStartProvisionalNavigation:]) ([XwWebView webView:didReceiveServerRedirectForProvisionalNavigation:]) ([XwWebView webView:didCommitNavigation:]): New functions. (nsxwidget_webkit_estimated_load_progress): New function. (nsxwidget_webkit_stop_loading): New function. * src/xwidget.c (Fxwidget_webkit_estimated_load_progress): Call 'nsxwidget_webkit_estimated_load_progress' if we're on MacOS. (Fxwidget_webkit_stop_loading): Call 'nsxwidget_webkit_stop_loading' if we're on MacOS. (syms_of_xwidget): Define symbol for function. 'xwidget_webkit_estimated_load_progress' if we're on MacOS. * src/nsxwidget.h: Signature for functions 'nsxwidget_webkit_estimated_load_progress' and 'nsxwidget_webkit_stop_loading'. * lisp/xwidget.el (xwidget-webkit-current-url): Message URL rather than return value of 'kill-new' (which is always nil).
2023-01-01; Add 2023 to copyright years.Eli Zaretskii
2022-04-07Fix xwidget smooth scrolling when the default pointer is not a touchpadPo Lu
* xwidget.c (find_suitable_pointer): New argument `need_smooth'. Try to find a touchpad if that is set. (xwidget_button_1, xwidget_button, xwidget_motion_notify) (xwidget_scroll, xwidget_pinch, xw_notify_virtual_upwards_until) (xw_notify_virtual_downwards_until): (xw_maybe_synthesize_crossing): (xwidget_motion_or_crossing, synthesize_focus_in_event): Set parameter accordingly.
2022-03-01; * src/xwidget.c: Add missing part of last change.Po Lu
2022-02-22Improve XInput2 version checkingPo Lu
* configure.ac: Check for various important structures from all versions of libXi. * src/xfns.c (setup_xi_event_mask): * src/xwidget.c (x_draw_xwidget_glyph_string): * src/xterm.c (x_init_master_valuators, handle_one_xevent) (x_term_init): Replace XI version checks based on protocol headers with new constants. * src/xterm.h (HAVE_XINPUT2_1, HAVE_XINPUT2_2, HAVE_XINPUT2_3) (HAVE_XINPUT2_4): New definitions.
2022-02-16Fix recent change in xwidget.cPo Lu
* src/xwidget.c (xwidget_init_view): Don't assume ttip_widget is NULL if tooltips have not been initialized.
2022-02-13Work around tooltip bug on new versions of WebKitGTKPo Lu
* src/xwidget.c (dummy_tooltip_string): New variable. (xw_maybe_synthesize_crossing): Call `xg_prepare_tooltip' to disable tooltips on WebKitGTK 2.34 or later. (syms_of_xwidget): Make dummy string.
2022-02-04* src/xwidget.c (xwidget_button): Always let button events through.Po Lu
Filtering out emulated events is done in handle_one_xevent, so all this accomplishes is to filter out legitimate button events.
2022-02-02Improve correctness of generated xwidget eventsPo Lu
* src/xwidget.c (xw_maybe_synthesize_crossing): Add new parameters for controlling the crossing mode. Also improve the accuracy of generated crossing events when the mouse pointer moves outside the toplevel from an inferior of it. All callers changed. (xw_notify_virtual_upwards_until): (xw_notify_virtual_downwards_until): New parameters for crossing mode. All callers changed.
2022-02-02Send button events before setting xwidget passive grabPo Lu
* src/xwidget.c (xwidget_button_1): Send button event before any grab processing.
2022-01-28Prevent duplicate grab setting with xwidgetsPo Lu
* src/xwidget.c (xwidget_show_view): Don't set passive grab if already set.
2022-01-28Use the real cursor beneath the pointer on xwidgetsPo Lu
* src/xwidget.c (define_cursors): Make manual cursor definition code PGTK-only. (xw_update_cursor_for_view): (xw_last_crossing_cursor_cb): New functions. (xw_maybe_synthesize_crossing): Attach and disconnect cursor signal handler where appropriate. (xwidget_init_view): Set the default cursor to the nontext cursor. (Fxwidget_delete_view): Disconnect last crossing signal if appropriate. * src/xwidget.h (struct xwidget_view): New field `last_crossing_cursor_signal'.
2022-01-28Fix xwidget build on PGTKPo Lu
* src/xwidget.c (xw_forward_event_translate): Adjust calls to `find_widget_at_pos' for recent changes.
2022-01-28Fix duplicate scroll events without XI2Po Lu
* src/xwidget.c (xwidget_button): Only generate scroll events when the button was released.
2022-01-28Clear xwidget passive grab whenever a drag beginsPo Lu
* src/xwidget.c (xv_drag_begin_cb): New function. (xwidget_view_from_window): Attach said function to grab widget when a grab starts. * src/xwidget.h (struct xwidget_view): New field `passive_grab_drag_signal'.
2022-01-28Fix inappropriate use of killed xwidgetsPo Lu
* src/xwidget.c (x_draw_xwidget_webkit_view): Don't record embedder or synthesize focus events if the widget is killed.
2022-01-28Implement xwidget passive grabsPo Lu
* src/xwidget.c (find_widget_at_pos): New parameters for controlling whether to respect grabs. All callers changed. (window_coords_from_toplevel): Make work when the widget is the toplevel. (find_widget): Fix coding style. (xwidget_button_1): Set and clear passive grabs if appropriate. (xw_maybe_synthesize_crossing): Allow current_window to be NULL if the mode is XW_CROSSING_LEFT.
2022-01-27Improve xwidget window ancestry calculationsPo Lu
* src/xwidget.c (xw_find_common_ancestor): (xw_notify_virtual_upwards_until) (xw_notify_virtual_downwards_until): New functions. (xw_maybe_synthesize_crossing): Synthesize virtual events like GTK does for non-linear changes.
2022-01-27Implement crossing event generation between windows for xwidgets on XPo Lu
* src/xwidget.c (enum xw_crossing_mode): New enum. (xwidget_motion_notify): (xwidget_motion_or_crossing): Synthesize crossing events if the pointer moved between different windows. (window_coords_from_toplevel): (xw_maybe_synthesize_crossing): New functions. (xwidget_init_view): Initialize new field to NULL. (Fdelete_xwidget_view): Clear last crossing window. * src/xwidget.h (struct xwidget_view): New field `last_crossing_window'.
2022-01-22Fix PGTK build with xwidgetsPo Lu
* src/xwidget.c: Swap some preprocessor definitions around. Reported by Iñigo Serna <inigoserna@gmail.com>.
2022-01-21Make xwidgets work on builds that don't use Cairo drawingPo Lu
* configure.ac: Check for the parts of Cairo that are needed for xwidgets when they are enabled without cairo drawing. * src/xterm.c: * src/xwidget.c: Always include cairo-xlib headers when xwidgets are enabled.
2022-01-19Use Cairo XCB surfaces when XCB is availablePo Lu
This lets us get at goodies such as shm support, which aren't available with the xlib surface. (bug#52120) * configure.ac: Test for cairo-xcb if cairo is available on X. * src/xterm.c (USE_CAIRO_XCB_SURFACE): New define. (x_begin_cr_clip): Create XCB surfaces if available. (x_try_cr_xlib_drawable): (x_scroll_run): Handle XCB surfaces. (x_term_init): Find XCB visualtype structure. * src/xterm.h (struct x_display_info): New field `xcb_visual'. * src/xwidget.c (x_draw_xwidget_glyph_string): Fix integer overflow.
2022-01-16* src/xwidget.c (webkit_js_to_lisp): Use correct constant to check size.Po Lu
2022-01-12Use correct coordinates when translating XI2 crossing eventsPo Lu
* src/xwidget.c (xwidget_motion_or_crossing): Use displaced position instead of event position.
2022-01-05Fix xwidgets setting their own signal handlersPo Lu
* src/xgselect.c (release_select_lock): (acquire_select_lock): Fix coding style. (xg_select): Call `catch_child_signal' if xwidgets are enabled. * src/xwidget.c (kill_xwidget): (kill_buffer_xwidgets): Call `catch_child_signal'. (bug#53013)
2022-01-04Translate more modifiers to GDK ones in xwidgetsPo Lu
* src/xwidget.c (xw_translate_x_modifiers): Also handle Control and ShiftMask.
2022-01-04Stop assuming X kbd state works with GDK when forwarding events to xwidgetsPo Lu
* src/xwidget.c (xw_translate_x_modifiers): New function. (Fxwidget_perform_lispy_event): Translate X modifiers to GDK modifiers before sending them to the xwidget.
2022-01-01Merge from origin/emacs-28Eli Zaretskii
836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year. 86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year ebe8772f65 ; Minor fixes related to copyright years 23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye... 8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t. 19dcb237b5 ; Add 2022 to copyright years. # Conflicts: # etc/NEWS # etc/refcards/ru-refcard.tex # lib/cdefs.h # lisp/erc/erc-dcc.el # lisp/erc/erc-imenu.el # lisp/erc/erc-replace.el # lisp/image-dired.el # lisp/progmodes/xref.el # m4/alloca.m4 # m4/byteswap.m4 # m4/errno_h.m4 # m4/getopt.m4 # m4/gnulib-common.m4 # m4/inttypes.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/sys_socket_h.m4
2022-01-01; Add 2022 to copyright years.Eli Zaretskii
2021-12-31Don't select for gesture events on xwidgets if the server is too oldPo Lu
* src/xwidget.c (x_draw_xwidget_glyph_string): Only select for XI gesture events if the server supports XI 2.4 or later.
2021-12-31Add pinch event support to xwidgetsPo Lu
* src/xterm.c (handle_one_xevent): Pass through pinch events to xwidgets and provide root coordinates when translating motion events. * src/xwidget.c (xwidget_motion_notify): Use provided root window coordinates. (xwidget_pinch): New function. * src/xwidget.h (xwidget_motion_notify): Update prototype. (xwidget_pinch): New function prototype.
2021-12-31Restore original xwidget embedder after performing a lispy eventPo Lu
* src/xwidget.c (Fxwidget_perform_lispy_event): Restore original embedder after performing event. (Fdelete_xwidget_view): Block input around non-reentrant section.
2021-12-31* src/xwidget.c (Fxwidget_perform_lispy_event): Use FRAME_WINDOW_P.Po Lu
2021-12-30Make xwidget motion commands hscroll the window of wide widgetsPo Lu
* lisp/xwidget.el (xwidget-info): New function declaration. (xwidget-webkit-scroll-forward): (xwidget-webkit-scroll-backward): Hscroll the window if the widget is wider than the text area. (bug#52885) * src/xwidget.c (xwidget_scroll, xwidget_motion_notify): Apply clip offsets to coordinates.
2021-12-30Translate crossing event mode when sending them to xwidgetsPo Lu
* src/xwidget.c (xi_translate_notify_detail): Use XI constants instead. (xwidget_motion_or_crossing): Translate XI entry event mode.
2021-12-29Translate state of XI2 entry events when sending them to xwidgetsPo Lu
* src/xwidget.c (xi_translate_notify_detail): New function. (xwidget_motion_or_crossing): Translate detail and state of GenericEvents before sending them to the widget.
2021-12-29Get rid of obsolete xwidget-related code on PGTKPo Lu
* src/emacsgtkfixed.c (emacs_fixed_class_init): Stop setting obsolete methods. (EMACS_FIXED_GET_CLASS, struct GtkFixedPrivateL): (emacs_fixed_gtk_widget_size_allocate): Delete obsolete things. * src/xwidget.c (x_draw_xwidget_glyph_string): Work around mysterious bug.