1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-14 23:40:39 -08:00
Commit graph

44967 commits

Author SHA1 Message Date
Po Lu
cbc77dcf03 Fix child frame synchronization order on Haiku
* src/haiku_support.cc (DoMove):
(FrameMoved): Fix locking and sync order semantics.
2022-01-01 07:10:39 +00:00
Po Lu
376d6cf36a Implement numeric values of `mouse-highlight' on Haiku
* src/haikuterm.c (haiku_read_socket): Clear mouse face on
keyboard input if `mouse-highlight' is a fixnum.
2022-01-01 06:17:51 +00:00
Stefan Kangas
78066671c0 Merge from origin/emacs-28
67400da412 Improve doc strings of fringe indicator variables
a6adfe21e4 * lisp/tab-line.el (tab-line--get-tab-property): New funct...
2022-01-01 06:51:58 +01:00
Po Lu
57753ed761 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs 2022-01-01 05:36:23 +00:00
Po Lu
d7e1ed17d9 Flush frames after mouse face is cleared on a child frame in Haiku
* src/haiku_support.cc (~EmacsWindow):
(UpwardsSubsetChildren):
(UpwardsUnSubsetChildren): Fix locking semantics.

* src/haikuterm.c (haiku_read_socket): Flush dirty back buffers
after clearing mouse face because the pointer was moved out of a
frame.
2022-01-01 05:32:42 +00:00
Po Lu
4d1968b4c9 Print dead xwidgets specially
* src/print.c (print_vectorlike) <PVEC_XWIDGET>: Print "killed
xwidget" for dead xwidgets.
2022-01-01 08:54:51 +08:00
Eli Zaretskii
67400da412 Improve doc strings of fringe indicator variables
* src/buffer.c (syms_of_buffer): Fix doc strings of
'indicate-empty-lines' and 'indicate-buffer-boundaries'.
2021-12-31 21:58:42 +02:00
Po Lu
1f34f072be Fix copyright dates in some files belonging to the pgtk port
* src/pgtkgui.h:
* src/pgtkim.c:
* src/pgtkmenu.c:
* src/pgtkselect.c:
* src/pgtkselect.h:
* src/pgtkterm.c:
* src/pgtkterm.h: Fix copyright dates to say '2021'.
2021-12-31 21:08:23 +08:00
Po Lu
7dd4dc6ace On Haiku, sync a frames's connection to the app sever after raising
* src/haiku_support.h: (BWindow_sync)
* src/haiku_support.cc (BWindow_sync): New function.
* src/haikuterm.c (haiku_frame_raise_lower): Synchronize window
after raising it to avoid situations where raising windows is
done out-of-order, such as when ediff raises a frame.
2021-12-31 13:03:07 +00:00
Po Lu
a8c3e8e2a6 Fix child frame unlinking on Haiku
* src/haiku_support.cc (UnlinkChild): Fix obvious mistake.
(DoMove): Lock child frame window before moving it.
2021-12-31 10:59:53 +00:00
Po Lu
d1fde0ab8a Use a single global lock for the child frame state on Haiku
Each BWindows (and various system callbacks) runs in a separate
thread, so there are very complicated locking semantics that
used to be handled manually.  This changes child frame state to
use a single global lock, which makes things much easier.

* src/haiku_support.cc (child_frame_lock): New variable.
(class EmacsWindow):
(~EmacsWindow):
(Unparent):
(ParentTo):
(MoveChild):
(FrameMoved):
(EmacsHide):
(EmacsShow):
(GetParentWidthHeight):
(OffsetChildRect):
(MakeFullscreen):
(SetUpDoubleBuffering): Use a single lock for controlling access
to child frame state.
2021-12-31 09:31:27 +00:00
Po Lu
c452ffe4c2 Prevent double buffering from being disabled on USE_BE_CAIRO builds
The direct rendering code used in that situation never
completely worked, and the BDirectWindow destructor is also
buggy.  Completely remove that code in order to let us inherit
from BWindow, so as to prevent the buggy destructor from being
run.

* src/haiku_support.cc (cairo_format_from_color_space): Delete
function.
(class EmacsWindow): Inherit from BWindow.
(EmacsWindow): Call BWindow constructor instead.
(MessageReceived):
(DispatchMessage):
(FrameResized):
(FrameMoved):
(Zoom): Call BWindow functions instead.
(EmacsView_cairo_surface): Stop looking for surfaces in the
window.
(EmacsWindow_begin_cr_critical_section):
(EmacsWindow_end_cr_critical_section): Stop locking the window.

* src/haikufns.c (haiku_set_inhibit_double_buffering): Always
enable double buffering on Cairo builds.
2021-12-31 07:34:09 +00:00
Po Lu
080a529f7e Don't select for gesture events on xwidgets if the server is too old
* 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-31 14:07:32 +08:00
Stefan Monnier
291085a2a6 (Fmake_finalizer): Check the arg is a function
* src/eval.c (syms_of_eval): Add `Qfunctionp`.
* src/alloc.c (Fmake_finalizer): Check the arg is a function.
2021-12-31 00:16:03 -05:00
Stefan Monnier
59732a83c8 Don't store docstrings of preloaded .el files in etc/DOC
Since the location of those files changes between build time and
installation time, this requires to tweak the file name used in those
(#$ . NNN) references during the dump so they don't hardcode the build
directory.  We do it in the same way as was already done for those
same file names in `load-history`, except we convert them back to
absolute file names more lazily (i.e. when fetching the actual
docstring rather than at startup), which requires remembering the
`lisp-dir` computed at startup in the new `lisp-directory` variable.

* src/Makefile.in ($(etc)/DOC): Don't scan Lisp files any more.

* src/lread.c (Fload): Use relative file names for `load-file-name`
when preloading for the dump, like we already did for `current-load-list`.
(read_list): Don't zero-out dynamic docstring references during the
preload since they won't be filled later by Snarf-documentation any more.
(read1): Remove the hash-hack for doc references that were zeroed.

* lisp/startup.el (lisp-directory): New variable.
(command-line): Set it.

* src/doc.c (get_doc_string): Use `lisp-directory` for dynamic
docstring references using relative file names.
(syms_of_doc): Add `Qlisp_directory`.

* lib-src/make-docfile.c (scan_file): Don't handle `.el` or `.elc`
files any more.
(IS_SLASH): Remove macro, not used any more.
(skip_white, read_lisp_symbol, search_lisp_doc_at_eol)
(scan_lisp_file): Remove functions, not used any more.

* doc/lispref/loading.texi (Library Search): Mention `lisp-directory`.
2021-12-30 23:17:45 -05:00
Po Lu
337005af0b Add pinch event support to xwidgets
* 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-31 10:07:30 +08:00
Po Lu
77f17649d8 Restore original xwidget embedder after performing a lispy event
* 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 09:28:12 +08:00
Po Lu
cc43606b55 * src/xwidget.c (Fxwidget_perform_lispy_event): Use FRAME_WINDOW_P. 2021-12-31 09:18:56 +08:00
Eli Zaretskii
89f205084b Avoid assertion violations with variable-weight fonts
* src/font.c (font_score, font_delete_unmatched): Don't assume
weight, slant, and width properties of the font must be fixnums:
some variable-weight fonts violate that assumption.  Reported
by Sean Whitton <spwhitton@spwhitton.name>.  Do not merge to
master.  (Bug#52888)
2021-12-30 20:28:58 +02:00
Eli Zaretskii
8b90d91f21 Fix previous change in 'pop_it'
* src/xdisp.c (restore_face_box_flags): New function.
(pop_it): Use 'restore_face_box_flags'.  (Bug#51550)
2021-12-30 13:32:14 +02:00
Eli Zaretskii
c80d2f3d67 Fix start-of-box-face display after display and overlay strings
* src/xdisp.c (pop_it): Recompute the 'start_of_box_run_p' flag,
like we do in 'handle_fontified_prop', when faces change while
iterating over a buffer or string.  (Bug#51550)
2021-12-30 13:21:01 +02:00
Po Lu
37ad776b9e Make xwidget motion commands hscroll the window of wide widgets
* 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-30 15:05:39 +08:00
Po Lu
a4893515c2 Work around xwidgets releasing the passive grab on an entry event
* src/xterm.c (handle_one_xevent): Don't send XI_Enter events to
xwidgets if button 1 is pressed.
2021-12-30 11:18:42 +08:00
Po Lu
b88024ad1a Use XRandR 1.5 to generate monitor attributes if available
* src/xfns.c (x_get_monitor_attributes_xrandr): Use XRR 1.5 if
present.
(xlw_monitor_dimensions_at_pos_1): Remove redundant XRR 1.5
code.
(xlw_monitor_dimensions_at_pos): Rely on
`x_get_monitor_attributes_xrandr' to retrieve the workarea
instead.
2021-12-30 10:08:18 +08:00
Po Lu
14f074f95e Translate crossing event mode when sending them to xwidgets
* src/xwidget.c (xi_translate_notify_detail): Use XI constants
instead.
(xwidget_motion_or_crossing): Translate XI entry event mode.
2021-12-30 09:24:30 +08:00
Po Lu
fb386e22e1 Fix a hang on servers that don't support the X Keyboard Extension
* src/xfns.c (Fx_backspace_delete_keys_p): Don't block input
before checking for Xkb.
2021-12-29 18:59:47 +08:00
Po Lu
7d672ed069 Translate state of XI2 entry events when sending them to xwidgets
* 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-29 18:37:04 +08:00
Po Lu
9d1312d8e9 Get rid of obsolete xwidget-related code on PGTK
* 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.
2021-12-29 18:06:34 +08:00
Po Lu
8719abe4ca Test for Xkb support when opening a display
* src/xfns.c (Fx_backspace_delete_keys_p): Use
dpyinfo->supports_xkb instead of testing for its presence
manually.

* src/xterm.c (x_term_init): Test for Xkb presence
and set supports_xkb appropriately.

* src/xterm.h (struct x_display_info): New field `supports_xkb'.
2021-12-29 17:49:42 +08:00
Po Lu
7b621c40f3 Queue xwidget views for allocation in more places
* src/xwidget.c (Fmake_xwidget) [HAVE_PGTK]:
(Fxwidget_resize) [HAVE_PGTK]: Queue xwidgets and views for
allocation.
2021-12-29 14:59:41 +08:00
Po Lu
2b7d33e30b Improve xwidget event handling on XI2
* src/xterm.c (handle_one_xevent): Pass XI2 entry and leave
events to xwidgets and fix scroll valuator reset logic for
xwidgets.

* src/xwidget.c (xwidget_button_1): Stop ungrabbing all devices
XI2 builds.
(xwidget_motion_or_crossing): Learn to pass through XI2 crossing
events.
(x_draw_xwidget_glyph_string): Add crossing events to the XI2
event mask.
2021-12-29 14:41:07 +08:00
Po Lu
8419011ceb Translate buttons when sending XI2 motion events to xwidgets
* src/xterm.c (handle_one_xevent): Translate all three buttons
when passing XI2 motion events to xwidgets.
2021-12-29 13:30:46 +08:00
Po Lu
42ede97016 Use XI2 to handle xwidget button events
* src/xterm.c (handle_one_xevent): Handle xwidget views when
handling XI_ButtonPress or XI_ButtonRelease events.
* src/xwidget.c (x_draw_xwidget_glyph_string): Add appropriate
values to the XI2 event mask.
2021-12-29 13:13:15 +08:00
Po Lu
0b5d9e9d8e Fix embedder calculation for xwidgets on PGTK
* src/xwidget.c (Fmake_xwidget):
(x_draw_xwidget_glyph_string): Defer focus event synthesis on
PGTK as well.
(record_osr_embedder): Use view window on PGTK.
(to_embedder):
(from_embedder): Rectify accordingly.
2021-12-29 12:59:46 +08:00
Po Lu
8be5b08bb5 Fix NS xwidget build
* src/xwidget.c (kill_frame_xwidget_views):
* src/xwidget.h (kill_frame_xwidget_views): Disable on NS.
2021-12-29 10:06:37 +08:00
Po Lu
512e7c3685 * src/xwidget.c (syms_of_xwidget): Fix typo. 2021-12-29 10:01:49 +08:00
Po Lu
9249365837 Add support for xwidgets to the PGTK port
* src/emacsgtkfixed.c (EMACS_FIXED_GET_CLASS): New function.
(struct GtkFixedPrivateL): New struct.
(emacs_fixed_gtk_widget_size_allocate):
(emacs_fixed_class_init): New functions.

* src/keyboard.h: Declare lispy_function_keys also when
HAVE_PGTK.

* src/pgtkterm.c (x_free_frame_resources): Destroy all xwidget
views.
(pgtk_scroll_run): Move xwidget views that overlap with the
scrolled area.
(pgtk_emacs_to_gtk_modifiers): Expose function.

* src/pgtkterm.h: Wrap in include guard.
(pgtk_emacs_to_gtk_modifiers): New prototype.

* src/xwidget.c (xw_forward_event_translate):
(xw_forward_event_from_view): New functions.
(Fmake_xwidget): Remove obsolete PGTK specific code.
(Fxwidget_perform_lispy_event): Convert modifiers correctly on
PGTK.
(define_cursors): Use GDK functions to define cursors on PGTK.
(xwidget_view_from_window): Disable on non-PGTK builds.
(xwidget_show_view):
(xwidget_hide_view): Implement on PGTK.
(xv_do_draw): Disable on non-PGTK builds.
(offscreen_damage_event): Queue xwidget views for draw.
(xwidget_expose): Disable on non-PGTK builds.
(xwidget_init_view):
(x_draw_xwidget_glyph_string):
(Fdelete_xwidget_view): Implement for PGTK.
(syms_of_xwidget): Don't initialize XID to widget table on PGTK.
(lower_frame_xwidget_views): Disable on PGTK.
* src/xwidget.h (struct xwidget_view): New fields for PGTK
builds.
(kill_frame_xwidget_views): Enable on PGTK.
2021-12-29 09:59:30 +08:00
Po Lu
208ae993ba Add support for pinch events to NS
* lisp/face-remap.el (text-scale-pinch): Remove mistaken
assumption that angle is always 1.0 at the beginning of
a sequence.

* src/nsterm.c (- magnifyWithEvent): New function.
2021-12-28 14:07:49 +08:00
Po Lu
b6b2f797d9 Fix menu placement on multiple-display setups when using lwlib
* lwlib/xlwmenu.c (fit_to_screen):
(pop_up_menu): Adjust menu position based on dimensions of the
current monitor's workarea.  (bug#52809)

* src/xfns.c (x_get_monitor_attributes): Stop testing for the
RandR extension here.
(xlw_monitor_dimensions_at_pos_1):
(xlw_monitor_dimensions_at_pos): New functions.

* src/xterm.c (x_term_init): Query for the RandR extension when
connecting to a display.
* src/xterm.h (xlw_monitor_dimensions_at_pos): New prototype.
2021-12-28 10:52:38 +08:00
Stefan Monnier
1a724cc2d2 Replace uniquify.el's advice with direct calls
This fixes bug#1338.

* src/buffer.c (Frename_buffer): Call `uniquify--rename-buffer-advice`.
* lisp/files.el (create-file-buffer):
Call`uniquify--create-file-buffer-advice`.

* lisp/uniquify.el (uniquify--rename-buffer-advice)
(uniquify--create-file-buffer-advice): Don't add them as advice any more.
Adjust their calling convention accordingly.
2021-12-27 20:59:16 -05:00
Po Lu
0f9ec379eb Only rely on passive device grabs on XI2
* src/xterm.c (xi_grab_or_ungrab_device): Remove function.
(handle_one_xevent): Stop setting non-passive grabs.
2021-12-28 09:28:04 +08:00
Po Lu
53cf2cf81b * src/pgtkterm.c (pgtk_handle_event): Add pinch event support. 2021-12-27 12:43:50 +08:00
Po Lu
d9977018e0 Fix menu window persistence and entry/leave events on Lucid on XI2
* 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.
2021-12-27 10:05:01 +08:00
Po Lu
2ccb156887 Fix Lucid popup menu being stuck on XI2 builds
* 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.
2021-12-27 09:16:18 +08:00
Po Lu
c609865258 Accumulate deltas in pinch events that were skipped
* src/keyboard.c (kbd_buffer_get_event): Accumulate relative deltas
inside skipped events when coalescing them.
2021-12-26 20:09:47 +08:00
Po Lu
deab5f413f Coalesce pinch gestures in the keyboard buffer
* src/keyboard.c (kbd_buffer_get_event): Coalesce consecutive
pinch gesture events.
2021-12-26 19:36:18 +08:00
Po Lu
472bc18ffd Change x-server-input-version' to x-server-input-extension-version'
* src/xfns.c (Fx_server_input_version)
(Fx_server_input_extension_version): Rename to
`x-server-input-extension-version'.
(syms_of_xfns): Update defsubr.
2021-12-26 15:01:55 +08:00
Po Lu
62339e62d8 Add configure tests for faulty XI2 installations
* configure.ac: Detect cases where XI 2.4 headers are installed
without the correct event structures.
* src/xterm.c (handle_one_xevent): Don't use structures that
might not exist unless configure found them.
2021-12-26 14:48:13 +08:00
Po Lu
50484ad7d7 Only focus frame implicitly if focus flag is set
* src/xterm.c (x_detect_focus_change): Test for focus flag on
XI entry events.
2021-12-26 14:48:13 +08:00
Po Lu
101bbd1392 Add support for pinch gestures to the XI2 build
* doc/lispref/commands.texi (Misc Events): Document new event
type `pinch'.
* etc/NEWS: Announce new event `pinch'.
* etc/PROBLEMS: Document problems with mismatched libXi
versions.
* lisp/face-remap.el (text-scale--pinch-start-scale): New
variable.
(text-scale-pinch): New command.
* src/keyboard.c (make_lispy_event): Handle PINCH_EVENTs.
(syms_of_keyboard): New symbol `pinch'.
* src/termhooks.h (enum event_kind): New enum `PINCH_EVENT'.
* src/xfns.c (setup_xi_event_mask): Add pinch events to event
mask if available.
* src/xterm.c (handle_one_xevent): Handle pinch events.
2021-12-26 13:55:05 +08:00