aboutsummaryrefslogtreecommitdiffstats
path: root/src/xmenu.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ; Add 2026 to copyright years.Sean Whitton2026-01-011-1/+1
|
* ; Fix confusing comment in xmenu.c.Paul Eggert2025-12-091-1/+1
|
* Fix xmenu.c USE_X_TOOLKIT duplicationPaul Eggert2025-12-081-2/+2
| | | | | | * src/xmenu.c (Fx_menu_bar_open_internal): Don’t say ‘#ifdef USE_X_TOOLKIT’ inside an #if where it is already known that USE_X_TOOLKIT is defined.
* Beware large stack growth in pgtk_menu_showPaul Eggert2025-01-261-5/+1
| | | | | * src/pgtkmenu.c (pgtk_menu_show): USE_SAFE_ALLOCA instead of alloca. Problem found with --enable-gcc-warnings.
* Replace call[1-8] with callnStefan Kangas2025-01-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Since the introduction of the 'calln' macro, the 'call1', 'call2', ..., 'call8' macros are just aliases for the former. This is slightly misleading and potentially unhelpful. The number of arguments N can also easily go out-of-synch with the used alias callN. There is no reason not to replace these aliases with using 'calln' directly. To reduce the risk for mistakes, the tool Coccinelle was used to make these changes. See <https://coccinelle.gitlabpages.inria.fr/website/>. * src/alloc.c, src/androidvfs.c, src/androidfns.c, src/buffer.c: * src/callint.c, src/callproc.c, src/casefiddle.c, src/charset.c: * src/chartab.c, src/cmds.c, src/coding.c, src/composite.c: * src/data.c, src/dbusbind.c, src/dired.c, src/doc.c: * src/emacs.c, src/eval.c, src/fileio.c, src/filelock.c: * src/fns.c, src/frame.c, src/gtkutil.c, src/haikufns.c: * src/haikumenu.c, src/image.c, src/insdel.c, src/intervals.c: * src/keyboard.c, src/keymap.c, src/lisp.h, src/lread.c: * src/minibuf.c, src/nsfns.m, src/nsselect.m, src/pgtkfns.c: * src/pgtkselect.c, src/print.c, src/process.c, src/sort.c: * src/syntax.c, src/textconv.c, src/textprop.c, src/undo.c: * src/w32fns.c, src/window.c, src/xfaces.c, src/xfns.c: * src/xmenu.c, src/xselect.c, src/xterm.c: Replace all uses of 'call1', 'call2', ..., 'call8' with 'calln'.
* Update copyright year to 2025Paul Eggert2025-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* SAFE_ALLOCA fixesPaul Eggert2024-07-201-4/+2
| | | | | | | | | | | | | | | | | | | | | * src/comp.c (declare_imported_func, emit_simple_limple_call) (declare_lex_function, compile_function): * src/emacs-module.c (funcall_module): * src/fns.c (Fstring_distance): * src/font.c (font_sort_entities): * src/haikumenu.c (digest_menu_items, haiku_menu_show): * src/pgtkselect.c (Fpgtk_register_dnd_targets): * src/xfns.c (Fx_begin_drag): * src/xmenu.c (x_menu_show): * src/xterm.c (x_dnd_compute_toplevels, handle_one_xevent) (x_term_init): Prefer SAFE_NALLOCA to doing size multiplication by hand, to catch unlikely integer overflows. * src/comp.c (emit_simple_limple_call): Fix bug where SAFE_FREE was called too early, leading to unlikely use of freed storage. * src/xterm.c (handle_one_xevent): Remove side effects from SAFE_ALLOCA args, as the args are evaluated twice.
* lwlib: pacify gcc -Wmissing-variable-declarationsPaul Eggert2024-06-031-0/+1
| | | | | | * lwlib/lwlib.c (lwlib_toolkit_type): Remove unused var. * lwlib/xlwmenu.c (submenu_destroyed): Now static. * src/xmenu.c (widget_id_tick): Declare extern, as a FIXME.
* Pacify GCC 14 -Wnull-dereferencePaul Eggert2024-04-301-1/+1
| | | | | | * src/xterm.c (x_dpyinfo): New function, which acts like x_display_info_for_display except it always returns nonnull. This simplifies callers and pacifies GCC 14. All callers changed.
* Merge from savannah/emacs-29Po Lu2024-01-021-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dc4e6b13296 ; Update copyright years in more files 64b37776318 ; Run set-copyright from admin.el 8e1c56ae467 ; Add 2024 to copyright years # Conflicts: # doc/misc/modus-themes.org # doc/misc/texinfo.tex # etc/NEWS # etc/refcards/ru-refcard.tex # etc/themes/modus-operandi-theme.el # etc/themes/modus-themes.el # etc/themes/modus-vivendi-theme.el # lib/alloca.in.h # lib/binary-io.h # lib/c-ctype.h # lib/c-strcasecmp.c # lib/c-strncasecmp.c # lib/careadlinkat.c # lib/cloexec.c # lib/close-stream.c # lib/diffseq.h # lib/dup2.c # lib/filemode.h # lib/fpending.c # lib/fpending.h # lib/fsusage.c # lib/getgroups.c # lib/getloadavg.c # lib/gettext.h # lib/gettime.c # lib/gettimeofday.c # lib/group-member.c # lib/malloc.c # lib/md5-stream.c # lib/md5.c # lib/md5.h # lib/memmem.c # lib/memrchr.c # lib/nanosleep.c # lib/save-cwd.h # lib/sha1.c # lib/sig2str.c # lib/stdlib.in.h # lib/strtoimax.c # lib/strtol.c # lib/strtoll.c # lib/time_r.c # lib/xalloc-oversized.h # lisp/auth-source-pass.el # lisp/emacs-lisp/lisp-mnt.el # lisp/emacs-lisp/timer.el # lisp/info-look.el # lisp/jit-lock.el # lisp/loadhist.el # lisp/mail/rmail.el # lisp/net/ntlm.el # lisp/net/webjump.el # lisp/progmodes/asm-mode.el # lisp/progmodes/project.el # lisp/progmodes/sh-script.el # lisp/textmodes/flyspell.el # lisp/textmodes/reftex-toc.el # lisp/textmodes/reftex.el # lisp/textmodes/tex-mode.el # lisp/url/url-gw.el # m4/alloca.m4 # m4/clock_time.m4 # m4/d-type.m4 # m4/dirent_h.m4 # m4/dup2.m4 # m4/euidaccess.m4 # m4/fchmodat.m4 # m4/filemode.m4 # m4/fsusage.m4 # m4/getgroups.m4 # m4/getloadavg.m4 # m4/getrandom.m4 # m4/gettime.m4 # m4/gettimeofday.m4 # m4/gnulib-common.m4 # m4/group-member.m4 # m4/inttypes.m4 # m4/malloc.m4 # m4/manywarnings.m4 # m4/mempcpy.m4 # m4/memrchr.m4 # m4/mkostemp.m4 # m4/mktime.m4 # m4/nproc.m4 # m4/nstrftime.m4 # m4/pathmax.m4 # m4/pipe2.m4 # m4/pselect.m4 # m4/pthread_sigmask.m4 # m4/readlink.m4 # m4/realloc.m4 # m4/sig2str.m4 # m4/ssize_t.m4 # m4/stat-time.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/stdio_h.m4 # m4/stdlib_h.m4 # m4/stpcpy.m4 # m4/strnlen.m4 # m4/strtoimax.m4 # m4/strtoll.m4 # m4/time_h.m4 # m4/timegm.m4 # m4/timer_time.m4 # m4/timespec.m4 # m4/unistd_h.m4 # m4/warnings.m4 # nt/configure.bat # nt/preprep.c # test/lisp/register-tests.el
| * ; Add 2024 to copyright yearsPo Lu2024-01-021-1/+1
| |
* | Fix pinch gestures after toolkit menuPo Lu2023-08-101-1/+16
|/ | | | | * src/xmenu.c (leave_toolkit_menu): Restore gesture event mask. (bug#65129)
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-011-1/+1
|
* Further fixes to menu event processing on no-toolkit buildsPo Lu2022-10-221-0/+8
| | | | | | | | * src/xdisp.c (note_mouse_highlight): Return if a popup is activated under the no-toolkit build as well. * src/xmenu.c (pop_down_menu): Clear popup_activated_flag when not on MS-DOS. (x_menu_show): Set popup_activated_flag under X.
* Fix delivery of window manager ping events during menuPo Lu2022-10-211-5/+9
| | | | | | | | | | * oldXMenu/Activate.c (XMenuActivateSetExposeFunction) (XMenuActivate): * oldXMenu/XMenu.h: Remove expose functions. * src/msdos.h (XMenuSetAEQ): Remove no longer used function. * src/xmenu.c (x_menu_expose_event): Delete function. (x_menu_dispatch_event): New function. (x_menu_show): Set it as the XMenu event handler.
* Fix pieces of code being too expensive over slow network connectionsPo Lu2022-10-171-40/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/menu-bar.el (menu-bar-edit-menu): Test buffer-read-only before gui-backend-selection-exists-p. This places the less expensive condition before the more expensive one. * src/xfns.c (compute_tip_xy): Use cached monitor attributes whenever available. (Fx_show_tip): Remove code that really did nothing. (Fx_backspace_delete_keys_p): Do not download the entire keymap from the server upon creating a frame. * src/xmenu.c (create_and_show_popup_menu): Use x_translate_coordinates_to_root. (x_menu_show): Use x_translate_coordinates_to_root. * src/xselect.c (Fx_selection_exists_p): If a temporary selection owner can be found, use it. * src/xterm.c (x_translate_coordinates_to_root) (x_handle_selection_monitor_event, x_find_selection_owner): New functions. These functions try to avoid downloading data from the X server in places that are called very often (i.e. during tool bar updates.) (handle_one_xevent): Handle selection notify events. Also catch some mistakes found. Fetch all kinds of key names as well. (x_create_special_window): New function. (x_term_init, x_delete_display): Ask for all key names. Also, passively monitor selections that are given to `x-selection-exists-p' during redisplay, so we do not have to ask the server about them upon each redisplay. (syms_of_xterm): New variable `x-fast-selection-list'. * src/xterm.h (struct x_monitored_selection): New structure. (X_INVALID_WINDOW): New define. (struct x_display_info): New fields for selection monitoring. Also, record the fixes extension base.
* Fix crash when handling "swallowed" generic eventsPo Lu2022-08-271-37/+47
| | | | | | | * src/xmenu.c (x_menu_translate_generic_event, x_menu_show): Pass through more events, correctly. * src/xterm.c (handle_one_xevent): Don't abort if must_free_data and xi_event is NULL; this is an Xlib bug.
* Fix oldXMenu grab handlingPo Lu2022-08-051-0/+26
| | | | | * src/xmenu.c (x_menu_translate_generic_event, pop_down_menu): Clear grab correctly on individual XI2 devices.
* Implement monitor refresh rate synchronization on XPo Lu2022-07-291-9/+14
| | | | | | | | | | | | | | | | | | | | * src/xfns.c (x_set_parent_frame, Fx_create_frame): Disable vsync on child and embedded frames. * src/xmenu.c (x_menu_show): Fix XMenu position calculation in child frames. * src/xterm.c (x_sync_is_frame_drawn_event) (x_sync_wait_for_frame_drawn_event): New functions. (x_sync_update_begin): Wait for frame to be drawn if not double buffered. (x_sync_update_finish): Set FRAME_X_WAITING_FOR_DRAW (f). (show_back_buffer): Wait for frame to be drawn before flipping buffers. (XTframe_up_to_date): Set FRAME_X_WAITING_FOR_DRAW if bumped. (handle_one_xevent): Handle frame drawn events. * src/xterm.h (struct x_output): New fields for frame dirtyness and vsync.
* Expunge unused recompute-lucid-menubar, lucid-menu-bar-dirty-flagAlan Mackenzie2022-07-121-2/+0
| | | | | | | | | | | | | | | | | | This fixes bug #56502. That function and these variables were manipulated by the former file emacs-lisp/lmenu.el that was finally expunged from directory obsolete/ by Stefan Kangas on 2020-05-15. There remain references to them in the *.c, and *.m files. * src/keyboard.c (syms_of_keyboard): Remove declarations of the symbol and variable. * src/haikumenu.c (set_frame_menu_bar) * src/keyboard.c (command_loop_1) * src/nsmenu.m (ns_update_menubar) * src/pgtkmenu.c (set_frame_menubar) * src/xdisp.c (update_menu_bar) * src/xmenu.c (set_frame_menubar): Remove calls to Qrecompute_lucid_menubar contitional on Vlucid_menu_bar_dirty_flag.
* Avoid code duplication converting XI event state in toolkit menu codePo Lu2022-07-041-23/+3
| | | | | | | | * src/xmenu.c (x_menu_translate_generic_event): (popup_get_selection): Use `xi_convert_event_state' instead. * src/xterm.c (xi_convert_event_state): Export on non-GTK builds. * src/xterm.h: Update prototypes.
* Make responding to selection requests work inside popupsPo Lu2022-06-081-5/+19
| | | | | | | | | | | | | | | | | | | * src/xfns.c (Fx_file_dialog): * src/xmenu.c (x_menu_wait_for_event, create_and_show_popup_menu) (create_and_show_dialog, x_menu_show): Defer selection requests. * src/xselect.c (x_get_foreign_selection) (x_handle_selection_notify): Add some more info to selection trace. * src/xterm.c (x_defer_selection_requests): Make non-static. (x_release_selection_requests_and_flush): New function. (x_dnd_begin_drag_and_drop): Use DEFER_SELECTIONS instead. (x_wait_for_cell_change): Fix initial value of rc for pushed back events. (handle_one_xevent): Allow GTK to respond to selections in its windows too. * src/xterm.h (DEFER_SELECTIONS): New slug of code.
* Fix stack overflows with large popup menusPo Lu2022-05-231-5/+16
| | | | | * src/xmenu.c (x_menu_show): Allocate various stacks with SAFE_ALLOCA.
* Fix freezes with some oddball menusPo Lu2022-05-071-1/+4
| | | | | | | * src/xmenu.c (x_activate_menubar): Clear flag if dispatching the event failed. * src/xterm.c (handle_one_xevent): Check for sensitive CascadeButton instead of row column type.
* Fix mouse face persisting inside Lucid menus on XI2Po Lu2022-05-061-0/+5
| | | | | | | | * src/xmenu.c (create_and_show_popup_menu): Call `x_mouse_leave' on Lucid as well when the input extension is being used. * src/xterm.c (x_mouse_leave): Enable on Lucid XI2 builds. * src/xterm.h: Update prototypes.
* Fix menu dismissal problems on Xt builds with XI2Po Lu2022-05-061-22/+84
| | | | | | | * src/xmenu.c (prepare_for_entry_into_toolkit_menu) (leave_toolkit_menu): New functions. (create_and_show_popup_menu): Replace some of the grab logic with resetting the XI event mask instead.
* Fix focus reversion of Motif menus on XI2Po Lu2022-04-301-17/+3
| | | | | * src/xmenu.c (create_and_show_popup_menu): Stop setting input focus on the menu window.
* Fix key navigation of Lucid menus on XI2Po Lu2022-04-231-8/+39
| | | | | | | | * src/xmenu.c (popup_get_selection): Fix cookie claiming of input extension events. (Fx_menu_bar_open_internal): Use right timestamps on XI2. * src/xterm.c (handle_one_xevent): Dispatch XI2 key events via Xt when popup is active.
* Minor fixes to menus on XI2Po Lu2022-04-141-8/+11
| | | | | | | | | | | | | | * src/xfns.c (Fx_create_frame): Populate `xi_masks'. * src/xmenu.c (x_activate_menubar) (create_and_show_popup_menu, x_menu_show): Only clear input extension grabs if we (or the toolkit) actually selected for XI_ButtonPress events. * src/xterm.c (xi_frame_selected_for): New function. (xi_populate_device_from_info, handle_one_xevent): Store device use instead of just whether or not it's a master device. (x_dnd_begin_drag_and_drop): Clean up block_input stuff. * src/xterm.h: Update prototypes. (struct xi_device_t): Rename `master_p' to `use'.
* Make XInput 2 features work on GTK 2 buildsPo Lu2022-03-091-0/+17
| | | | | | | | | | * src/xfns.c (setup_xi_event_mask): On GTK 2, select for button, motion, entry/exit and key events. * src/xmenu.c (create_and_show_popup_menu): Clear XI grab if appropriate. * src/xterm.c (handle_one_xevent): Pass some kinds of input extension events to GTK manually on versions of GTK+ that don't understand them.
* Correctly handle exposure in oldXMenuPo Lu2022-03-071-0/+9
| | | | | | | | | | | | * oldXMenu/Activate.c (XMenuActivate): Call set expose_func if no pane was found. (XMenuActivateSetExposeFunction): New function. * oldXMenu/XMenu.h: New typedef `expose_func'. Update prototypes. * src/xmenu.c (x_menu_expose_event): New function. (x_menu_show): Set expose event handler. * src/xterm.c (x_dispatch_event): Make `static' only on GTK. * src/xterm.h: Expose `x_dispatch_event' on no-toolkit builds.
* Improve behavior of Motif popup menus on XI2Po Lu2022-03-021-0/+9
| | | | | * src/xmenu.c (create_and_show_popup_menu): Set input focus to menu window.
* Fix old X menu on builds with XI2Po Lu2022-03-011-0/+61
| | | | | | | | | | | * oldXMenu/Activate.c (XMenuActivateSetTranslateFunction): New function. (XMenuActivate): Handle generic events. * oldXMenu/XMenu.h: New prototypes. (Translate_func): New type. * src/xmenu.c (x_menu_wait_translate_generic_event): New function. (x_menu_show): Set translate function.
* Disable some code that interferes with menus on LucidPo Lu2022-03-011-2/+4
| | | | | | * src/xmenu.c (create_and_show_popup_menu) (server_timestamp_predicate): Disable timestamp code on builds using the Lucid menu bar widget.
* Fix C-g inside toolkit file dialogs with XI2Po Lu2022-03-011-2/+2
| | | | | | | * src/xfns.c (Fx_file_dialog): Handle GenericEvents when looking for quit character. * src/xmenu.c (x_menu_wait_for_event): If data is non-nil, use XPending.
* Intern server time property during terminal initializationPo Lu2022-03-011-2/+2
| | | | | | | | * src/xmenu.c (create_and_show_popup_menu): Use previously interned atom. * src/xterm.c (x_term_init): New atom `EMACS_SERVER_TIME_PROP'. * src/xterm.h (struct x_display_info): New field `Xatom_EMACS_SERVER_TIME_PROP'.
* Work around some problems with Motif and the input extensionPo Lu2022-02-271-0/+8
| | | | | | * src/xmenu.c (create_and_show_popup_menu): Restore input focus to the frame's outer window if there was an input extension grab.
* Fix Motif menu and menu bar dismissal on XI2Po Lu2022-02-271-13/+57
| | | | | | | | | | | * src/xmenu.c (x_activate_menubar): Improve ungrabbing logic on XI2. (server_timestamp_predicate): New function. (create_and_show_popup_menu): If the display supports XI2, make sure the timestamps are correct by dispatching a PropertyNotify event to Xt. * src/xterm.c (handle_one_xevent): Translate XI_ButtonRelease events into core events before dispatching them to Xt.
* Replace ptrdiff_t with new specpdl_ref type for specpdl referencesMattias Engdegård2022-02-121-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The specpdl_ref type is just an alias for ptrdiff_t; the compiled code remains the same. All operations on specpdl_ref (arithmetic, comparison etc) now go through inline functions. The bulk of the change is almost completely mechanical. It is done to prepare for a type-safe representation and subsequent performance improvement. * src/lisp.h (specpdl_ref, specpdl_count_to_ref, specpdl_ref_to_count) (specpdl_ref_eq, specpdl_ref_lt, specpdl_ref_valid_p) (make_invalid_specpdl_ref, specpdl_ref_add, specpdl_ref_to_ptr): New. (SPECPDL_INDEX, struct handler, USE_SAFE_ALLOCA, safe_free) (safe_free_unbind_to): * src/alloc.c (run_finalizer_function, inhibit_garbage_collection) (garbage_collect, Fgarbage_collect, which_symbols): * src/bidi.c (bidi_at_paragraph_end, bidi_find_paragraph_start): * src/buffer.c (Fkill_buffer, Fset_buffer_major_mode, Fmove_overlay) (Fdelete_overlay): * src/bytecode.c (exec_byte_code): * src/callint.c (Ffuncall_interactively, Fcall_interactively): * src/callproc.c (Fcall_process, call_process, create_temp_file) (Fcall_process_region): * src/charset.c (load_charset_map_from_file): * src/coding.c (decode_coding_gap, decode_coding_object) (encode_coding_object, Fread_coding_system): * src/comp.c (emit_static_object, helper_unbind_n, load_comp_unit): * src/composite.c (update_compositions, autocmp_chars): * src/cygw32.c (conv_filename_to_w32_unicode) (conv_filename_from_w32_unicode): * src/data.c (notify_variable_watchers): * src/decompress.c (Fzlib_decompress_region): * src/dired.c (directory_files_internal, file_name_completion) (file_attributes): * src/dispnew.c (Fredisplay): * src/doc.c (get_doc_string, Fsnarf_documentation): * src/editfns.c (Fsave_excursion, Fsave_current_buffer) (Freplace_buffer_contents, Fsubst_char_in_region, Fsave_restriction) (styled_format): * src/emacs-module.c (Fmodule_load, funcall_module): * src/emacs.c (init_cmdargs, Fdump_emacs): * src/eval.c (call_debugger, do_debug_on_call, FletX, Flet) (Ffuncall_with_delayed_message, Funwind_protect) (internal_lisp_condition_case, signal_or_quit) (load_with_autoload_queue, Feval, grow_specpdl_allocation) (record_in_backtrace, eval_sub, Ffuncall, apply_lambda) (funcall_lambda, clear_unwind_protect, set_unwind_protect) (set_unwind_protect_ptr, unbind_to, Fbacktrace_eval): * src/fileio.c (Fmake_temp_file_internal, Fcopy_file, Frename_file) (Finsert_file_contents, write_region, Fdo_auto_save): * src/fns.c (Fyes_or_no_p, Frequire, hash_table_user_defined_call): * src/fringe.c (update_window_fringes): * src/gtkutil.c (xg_dialog_run): * src/haiku_io.c (c_specpdl_idx_from_cxx): * src/haiku_support.cc (be_popup_file_dialog): * src/haiku_support.h (c_specpdl_idx_from_cxx): * src/haikufns.c (haiku_create_frame, haiku_create_tip_frame) (haiku_hide_tip, Fx_show_tip, Fhaiku_read_file_name): * src/haikumenu.c (haiku_popup_dialog, set_frame_menubar): * src/image.c (slurp_file): * src/indent.c (line_number_display_width, Fvertical_motion): * src/insdel.c (signal_before_change, signal_after_change) (Fcombine_after_change_execute): * src/intervals.c (get_local_map): * src/json.c (lisp_to_json_nonscalar_1, Fjson_serialize, Fjson_insert) (Fjson_parse_string, Fjson_parse_buffer): * src/keyboard.c (recursive_edit_1, Frecursive_edit, cmd_error) (Finternal_track_mouse, command_loop_1, read_menu_command) (safe_run_hooks, read_event_from_main_queue, read_char, timer_check_2) (menu_item_eval_property, read_key_sequence, read_key_sequence_vs) (Fsuspend_emacs): * src/keymap.c (Fcurrent_active_maps, Fdescribe_vector) (Fhelp__describe_vector): * src/lread.c (Fload, save_match_data_load, readevalloop) (Feval_buffer, Feval_region, grow_read_buffer, read_integer, read1): * src/macros.c (Fexecute_kbd_macro): * src/menu.c (x_popup_menu_1): * src/minibuf.c (read_minibuf, set_minibuffer_mode) (read_minibuf_unwind, Fread_string, Fread_buffer): * src/nsfns.m (Fx_create_frame, Fx_show_tip): * src/nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog): * src/pdumper.c (Fdump_emacs_portable): * src/pgtkfns.c (Fx_create_frame, x_create_tip_frame, x_hide_tip) (Fx_show_tip, Fpgtk_print_frames_dialog, Fx_file_dialog, Fx_select_font): * src/pgtkmenu.c (set_frame_menubar, create_and_show_popup_menu) (pgtk_menu_show, create_and_show_dialog, pgtk_dialog_show) (pgtk_popup_dialog): * src/pgtkterm.c (pgtk_cr_export_frames): * src/print.c (PRINTPREPARE, temp_output_buffer_setup) (Fprin1_to_string, print_vectorlike): * src/process.c (Fmake_process, create_process, Fmake_pipe_process) (Fmake_serial_process, connect_network_socket, Fmake_network_process) (network_interface_info, server_accept_connection) (wait_reading_process_output, read_process_output, exec_sentinel): * src/regex-emacs.c (re_match_2_internal): * src/search.c (looking_at_1, fast_looking_at, search_buffer_re): * src/sound.c (Fplay_sound_internal): * src/sysdep.c (system_process_attributes): * src/term.c (tty_menu_show): * src/textprop.c (Fnext_single_char_property_change) (Fprevious_single_char_property_change, add_text_properties_1) (set_text_properties, set_text_properties_1, Fremove_text_properties) (Fremove_list_of_text_properties): * src/thread.c (Fmutex_lock, invoke_thread_function): * src/undo.c (truncate_undo_list): * src/w32fns.c (Fx_create_frame, w32_create_tip_frame, w32_hide_tip) (Fx_show_tip, Fx_file_dialog): * src/w32font.c (Fx_select_font): * src/w32menu.c (set_frame_menubar): * src/window.c (window_list, next_window, window_list_1) (run_window_configuration_change_hook, Frun_window_scroll_functions) (run_window_change_functions, set_window_buffer) (temp_output_buffer_show, window_scroll, scroll_command) (Fscroll_other_window, Fscroll_other_window_down): * src/xdisp.c (safe__call, handle_fontified_prop, handle_face_prop) (handle_single_display_spec, Fbuffer_text_pixel_size) (message_dolog, with_echo_area_buffer, setup_echo_area_for_printing) (display_echo_area, set_message, clear_message, echo_area_display) (gui_consider_frame_title, prepare_menu_bars, update_menu_bar) (update_tab_bar, update_tool_bar, redisplay_internal) (redisplay_preserve_echo_area, run_window_scroll_functions) (redisplay_window, extend_face_to_end_of_line) (display_count_lines_logically, display_count_lines_visually) (display_mode_lines, display_mode_line, Fformat_mode_line) (decode_mode_spec): * src/xfns.c (Fx_create_frame, x_create_tip_frame, x_hide_tip) (Fx_show_tip, Fx_file_dialog, Fx_select_font, Fx_print_frames_dialog): * src/xmenu.c (set_frame_menubar, create_and_show_popup_menu) (x_menu_show, create_and_show_dialog, x_dialog_show) (xw_popup_dialog): * src/xselect.c (x_get_local_selection, x_reply_selection_request) (x_handle_selection_request, wait_for_property_change): * src/xterm.c (x_cr_export_frames, x_connection_closed): Replace ptrdiff_t with specpdl_ref for referencing specpdl and use the corresponding functions instead of direct arithmetic.
* Fix entry and exit events with XI2 grabs on X toolkit menusPo Lu2022-02-121-10/+43
| | | | | | | | | | * src/xmenu.c (popup_get_selection): Only claim cookie if new event will be generated. (create_and_show_popup_menu): Ungrab XI2 device, then immediately set core grab on the frame's edit widget window. * src/xterm.c (handle_one_xevent): Use x_any_window_to_frame to find exit event frame if a popup menu is active.
* Fix compatibility with ancient versions of libXiPo Lu2022-02-121-2/+2
| | | | | * src/xmenu.c (popup_get_selection): Don't rely on xev->display being non-NULL.
* Make menus work better on X toolkit builds with XInput 2Po Lu2022-02-071-3/+119
| | | | | | | | | | * src/xmenu.c (popup_get_selection): Translate some important XI2 events into events the toolkit can understand. (x_activate_menubar): (create_and_show_popup_menu): Clear grab regardless of reported status on Motif. * src/xterm.c (xi_device_from_id): Export function. * src/xterm.h: Update prototypes.
* Fix menus on the no-toolkit build when using XI2Po Lu2022-01-231-4/+26
| | | | | | | * src/xmenu.c (x_activate_menubar): (create_and_show_popup_menu): Only ungrab the device if it is actually grabbed. (x_menu_show): Release XI2 passive grab.
* Merge from origin/emacs-28Eli Zaretskii2022-01-011-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * ; Add 2022 to copyright years.Eli Zaretskii2022-01-011-1/+1
| |
* | Fix menu window persistence and entry/leave events on Lucid on XI2Po Lu2021-12-271-5/+4
| | | | | | | | | | | | | | | | * src/xmenu.c (x_activate_menubar): Always clear the XI2 grab on Xt. * src/xterm.c (handle_one_xevent): On XI2, ignore LeaveNotify events coming from the shell widget and use `x_window_to_frame' to find the frame when handling XI_Leave events.
* | Fix Lucid popup menu being stuck on XI2 buildsPo Lu2021-12-271-0/+12
| | | | | | | | | | | | | | | | | | * src/xmenu.c (x_activate_menubar): Make some changes conditional on XI2. (create_and_show_popup_menu): Clear XI2 grab before showing popup. * src/xterm.c (xi_grab_or_ungrab_device): Don't grab device if popup is activated on Lucid.
* | Fix menu grabs on XI2 Motif buildsPo Lu2021-12-241-0/+16
| | | | | | | | | | | | * src/xmenu.c (x_activate_menubar) [USE_MOTIF]: Clear XI grab. * src/xterm.c (xi_grab_or_ungrab_device) [USE_MOTIF]: Always ungrab if a popup is active.
* | Add support for event processing via XInput 2Po Lu2021-11-201-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac: Add an option to use XInput 2 if available. * src/Makefile.in (XINPUT_LIBS, XINPUT_CFLAGS): New variables. (EMACS_CFLAGS): Add Xinput CFLAGS. (LIBES): Add XInput libs. * src/xmenu.c (popup_activated_flag): Expose flag if XInput 2 is available. * src/xfns.c (x_window): Set XInput 2 event mask. (setup_xi_event_mask): New function. (syms_of_xfns): Provide XInput 2 feature. * src/xterm.c (x_detect_focus_change): Handle XInput 2 GenericEvents. (handle_one_xevent): Handle XInput 2 events. (x_term_init): Ask the server for XInput 2 support and set xkb_desc if available. (x_delete_terminal): Free XKB kb desc if it exists, and free XI2 devices if they exist. (xi_grab_or_ungrab_device) (xi_reset_scroll_valuators_for_device_id) (x_free_xi_devices, x_init_master_valuators): New functions. (x_get_scroll_valuator_delta): New function. (init_xterm): Don't tell GTK to only use Core Input when built with XInput 2 support. * src/xterm.h (struct x_display_info): Add fields for XKB and XI2 support. * src/gtkutil.c (xg_event_is_for_menubar): Handle XIDeviceEvents. (xg_is_menu_window): New function. (xg_event_is_for_scrollbar): Handle XIDeviceEvents. * etc/NEWS: Document changes. * lisp/mwheel.el (mouse-wheel-down-alternate-event) (mouse-wheel-up-alternate-event) (mouse-wheel-left-alternate-event) (mouse-wheel-right-alternate-event): New user options. (mouse-wheel-text-scale) (mwheel-scroll): Test for alternate events. (mouse-wheel--setup-bindings): Set up bindings for alternate buttons.
* | Revert "Add support for event processing via XInput 2"Po Lu2021-11-101-4/+0
| | | | | | | | This reverts commit 346cfc81247e6bf8e727a27b42f44f2389bd1269.