1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-23 04:53:12 -08:00
Commit graph

44948 commits

Author SHA1 Message Date
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
Stefan Kangas
4e2058aec3 Merge from origin/emacs-28
89a82182cb Improve documentation of read-multiple-choice
5fccd1e371 Explain why we remove stuff from 'user-full-name'
2021-12-26 06:30:37 +01:00
Po Lu
ab3d5b8b32 Don't clear internal border if frame isn't realized
* src/pgtkterm.c (pgtk_clear_under_internal_border): Don't clear
border if frame isn't realized.  (bug#52705)
2021-12-26 09:20:51 +08:00
Stefan Kangas
7f43b3759d Fix unused variable warning in xfns.c
* src/xfns.c (Fx_server_input_version): Fix unused variable
warning.
2021-12-25 16:41:06 +01:00
Po Lu
e0a78429ca Add a utility function to query the XI2 version on a display
* src/xfns.c (Fx_server_input_version): New function.
(syms_of_xfns): Define new subr.
2021-12-25 20:09:37 +08:00
Eli Zaretskii
5fccd1e371 Explain why we remove stuff from 'user-full-name'
* src/editfns.c (Fuser_full_name): Document why we chop everything
starting from the first comma.  (Bug#52785)
2021-12-25 09:38:39 +02:00
Po Lu
71eb1aac54 Add support for XI 2.4
We will be able to use touchpad (not touchscreen) gestures, such
as pinch and swipe gestures after this change, but they are not
yet exposed to Lisp.

* src/xterm.c (x_term_init): Declare support for XI 2.4 if
present.
2021-12-25 10:38:23 +08:00
Po Lu
8b0e9f44b7 Fix Emacs tooltips on PGTK
* src/pgtkfns.c (x_create_tip_frame): Don't set cursor and
show window.
(Fx_show_tip): Set cursor and show window.
2021-12-25 08:29:00 +08:00
Po Lu
552b74ba9e Fix text decoration display on stretch glyphs with no box on NS
* src/nsterm.m (ns_dumpglyphs_stretch): Draw decorations if
there is no box.
2021-12-24 15:51:34 +08:00
Po Lu
8e0d327b8c Remove useless functions from PGTK port that were breaking emacsbug
* src/pgtkfns.c (Fx_server_vendor, Fx_server_version): Remove
useless functions that returned invalid values.
(syms_of_pgtkfns): Stop defining removed subrs.
2021-12-24 15:24:35 +08:00
Po Lu
965b8b0fad Grab the server when warping the client pointer
* src/xfns.c (Fx_set_mouse_absolute_pixel_position):
* src/xterm.c (x_make_frame_invisible): Avoid race conditions
where the client pointer is destroyed between when it is
obtained and when XIWarpPointer is called.
2021-12-24 14:23:23 +08:00
Po Lu
fbe026cb3e Acquire draw lock when updating menubar on Haiku
* src/haikumenu.c (digest_menu_items): Acquire draw lock.
2021-12-24 03:21:21 +00:00
Po Lu
7078af622b Fix menu grabs on XI2 Motif builds
* 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.
2021-12-24 11:10:09 +08:00
Po Lu
8c99628a71 Fix some more incorrect valuator clearing
* src/xterm.c (handle_one_xevent): Improve detection of stray
ungrab events.
2021-12-24 09:55:15 +08:00
Po Lu
20647467be Drop scrollbar motion events when valuators are found
* src/xterm.c (handle_one_xevent): Drop XI_Motion if it's on
top of a scroll bar and a valuator is found.
2021-12-24 09:20:44 +08:00
Po Lu
d54d8a88e9 Allow window-text-pixel-size to measure pixels around a position
* doc/lispref/display.texi (Size of Displayed Text): Announce
new meaning of `from'.
* etc/NEWS: Announce changes.

* lisp/pixel-scroll.el (pixel-scroll-precision-scroll-up-page):
Use new feature.

* src/xdisp.c (window_text_pixel_size): Understand a special
format of `from' that specifies the amount of pixels above or
below a position.

(Fwindow_text_pixel_size): Update doc string.
2021-12-23 18:55:54 +08:00
Alan Third
ec1312d76a Add native HEIC support on macOS (bug#51381)
* lisp/image.el (image-type-header-regexps):
(image-type-file-name-regexps):
(image-type-auto-detectable): Add auto-detect code for heic.
* src/image.c (syms_of_image): Add heic as an image type under NS.
* src/nsimage.m (ns_can_use_native_image_api): Add heic to list of
possible image types in the native image support lookup.
2021-12-22 20:48:19 +00:00
Alan Third
ab0d7a2b83 Allow resizing undecorated frames on macOS (bug#28512, bug#31795)
* 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.
2021-12-22 20:48:19 +00:00
Alan Third
89749a62b5 Make NS toolbar item ID more unique (bug#50160)
* 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.
2021-12-22 20:48:19 +00:00
Alan Third
42601d3a93 Make NS toolbar use NSString instead of C strings
* 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.
2021-12-22 20:48:19 +00:00