1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-01 11:20:41 -08:00
Commit graph

45516 commits

Author SHA1 Message Date
Po Lu
4f53789a0a * src/xterm.c (x_term_init): Catch some errors from defective X servers. 2022-02-23 18:11:29 +08:00
Po Lu
304c373c98 Improve input extension version checks on GTK 3
* src/xterm.c (x_term_init): If newer versions of XInput 2 don't
work, then look for an older one.
2022-02-23 15:40:15 +08:00
Po Lu
e97580724d Fix display corruption with background alpha set on unsupported display
* src/xfns.c (x_set_alpha_background): Make opaque if display
doesn't support the required features.
2022-02-23 13:14:28 +08:00
Po Lu
659eca9ed8 * src/xterm.c: Expand commentary. 2022-02-23 11:40:38 +08:00
Po Lu
b16e36476e * src/xterm.c (x_term_init): Don't catch errors too many times. 2022-02-23 08:58:06 +08:00
Po Lu
1f00710ecf Fix X errors caused by GTK using newer versions of XI2 than Emacs
* src/xterm.c (x_term_init): Handle errors from XIQueryVersion
caused by Emacs requesting versions of XI2 older than 2.2 and
what GTK requested.
2022-02-23 08:56:06 +08:00
Po Lu
85567d5798 ; * src/xterm.h: Fix typo in recent change. 2022-02-22 19:17:41 +08:00
Po Lu
dfa607c164 Fix build on glibc <2.10
* src/alloc.c (Fmalloc_info): Only enable if glibc supports
malloc_info.
(syms_of_alloc): Likewise.
2022-02-22 19:13:50 +08:00
Po Lu
f7b5553045 Fix GTK build with GLib <2.44
* src/gtkutil.c (struct _EmacsMenuBar, EmacsMenuBar): New
structs.
(emacs_menu_bar_get_type): New function declaration.

* src/gtkutil.c: Remove declaration of EmacsMenuBar class.
2022-02-22 18:46:19 +08:00
Po Lu
c914572a46 Improve XInput2 version checking
* 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-22 18:41:28 +08:00
Po Lu
8d02624c0e Fix duplicate wheel events on XI2
* src/xterm.c (handle_one_xevent): Don't generate wheel events
on XI_ButtonPress.
2022-02-22 14:10:29 +08:00
Po Lu
6d060a38ec Always send wheel events on XI2
* src/xterm.c (handle_one_xevent): Send emulated button events
as wheel events when handling XI2 button events.
2022-02-22 14:02:41 +08:00
Stefan Kangas
bee54495e9 Merge from origin/emacs-28
666e40a109 Fix 'display-line-numbers-mode' in hide-show buffers
68d134cf0f Don't check whether a deleted window is deletable (Bug#54028)
b38223a844 A friendlier error message from image-mode in an empty buffer
b7a651ba37 Update to Org 9.5.2-17-gea6b74
3a8c3f7abd ; Don't reference obsolete variables in edebug.el
2022-02-22 06:30:59 +01:00
Po Lu
f654080513 Don't generate multibyte keystroke events if there is no actual text
* src/xterm.c (handle_one_xevent): Don't generate
MULTIBYTE_CHAR_KEYSTROKE_EVENTs if nbytes is zero.
2022-02-22 10:40:24 +08:00
Po Lu
993e8b010c Don't pass invalid keyboard modifiers to the event loop on Haiku
* src/haikuterm.c (haiku_read_socket): Ensure validity of extra
keyboard modifiers.
2022-02-22 01:33:56 +00:00
Eli Zaretskii
666e40a109 Fix 'display-line-numbers-mode' in hide-show buffers
* src/xdisp.c (redisplay_internal): Disable redisplay
optimizations that consider just the current line, when
'display-line-numbers-mode' is turned on in the buffer.
(Bug#54091)
2022-02-21 22:12:57 +02:00
Po Lu
9e084ddad1 Try to fix bug#54051
* src/xterm.c (handle_one_xevent): Don't give obviously bogus
configure events to Xt.
2022-02-21 19:40:28 +08:00
Po Lu
fc281e0df3 Prevent Haiku display from being opened multiple times
* src/haikufns.c (Fx_open_connection): Return if display
connection already exists.
2022-02-21 07:42:01 +00:00
Po Lu
e087c89b1e Prevent GTK from setting unreasonable size hints with large menu bars
* src/gtkutil.c (struct _EmacsMenuBar): New struct.
(emacs_menu_bar_init):
(emacs_menu_bar_class_init):
(emacs_menu_bar_get_preferred_width):
(emacs_menu_bar_new): New functions.
(xg_update_menu_item): Use our own menu bar class on GTK 3.
* src/gtkutil.h (EmacsMenuBar): New class.
2022-02-21 14:29:58 +08:00
Po Lu
816cf19a3a Implement left-right separators for dialog boxes on Haiku
* src/haiku_support.cc (BAlert_set_offset_spacing): New
function.
* src/haiku_support.h: Update prototypes.
* src/haikumenu.c (struct submenu_stack_cell): Remove unused
struct.
(haiku_dialog_show): Use offset spacing if a left-right boundary
was seen and make sure the user can always quit a dialog if no
enabled items exist.
2022-02-21 03:28:46 +00:00
Po Lu
7159c1af08 ; * src/haikuterm.c (haiku_read_socket): Add extra keyboard modifiers. 2022-02-21 01:40:01 +00:00
Po Lu
9e6df01bf1 Respect `extra-keyboard-modifiers' when handling XI2 keyboard input
* src/xterm.c (handle_one_xevent): Add extra modifiers to
XI2 keyboard state.
2022-02-21 09:33:54 +08:00
Stefan Monnier
48c65f219d (loadhist_initialize): Fix regression test failure
* src/lread.c (loadhist_initialize): Adjust assertion for the nil case.
(readevalloop): Signal an error for non-string `sourcename`.
2022-02-20 13:16:35 -05:00
Eli Zaretskii
92ce3b5d54 ; Fix compilation warnings
* src/keyboard.c (kbd_buffer_get_event):
* src/xterm.c (handle_one_xevent): Fix compiler warnings.
2022-02-20 18:42:33 +02:00
Po Lu
7a6e229a2e Fix font panel on NS
* src/nsterm.m ([EmacsView changeFont:]): Don't use emacs_event,
instead placing events directly into the keyboard buffer.
2022-02-20 20:00:28 +08:00
Po Lu
7b7c09c561 * src/haikumenu.c (haiku_dialog_show): Set `popup_activated_p'.
Author:
2022-02-20 10:42:41 +00:00
Po Lu
dad7ee2353 Handle GUI input while inside popup dialog on Haiku
* src/haiku_support.cc (alert_popup_value): New variable.
(be_alert_thread_entry): New function.
(BAlert_go): Complete rewrite that allows async input to be
handled while the popup is active.
* src/haiku_support.h: Update prototypes.
* src/haikumenu.c (haiku_dialog_show, haiku_popup_dialog): Stop
blocking input and pass required callbacks to `BAlert_go'.
* src/haikuterm.c (haiku_term_init): Set interrupt input mode to
t.
2022-02-20 10:38:38 +00:00
Po Lu
d7fc7bdd81 Fix typo in last change
* src/xterm.c (handle_one_xevent): Use `xi_done_keysym' label
when ignoring modifier keys from XI2 input.
2022-02-20 10:05:46 +08:00
Po Lu
15910e5da3 Ignore modifier keys early when handling X key press events
* src/xterm.c (handle_one_xevent): Ignore modifier keys earlier
without going through the usual key lookup.
(x_delete_terminal): Free recorded modifier map.
(x_find_modifier_meanings): Record modifier map.

* src/xterm.h (struct x_display_info): New field `modmap'.
2022-02-20 10:03:28 +08:00
Po Lu
7a699e79f6 Free XI2 devices in x_delete_display instead
* src/xterm.c (x_delete_display): Free XI2 device data here
instead, since it doesn't involve contacting the X server any
more.
(x_delete_terminal): Stop freeing XI2 device data.
2022-02-20 09:14:00 +08:00
Stefan Monnier
ecaedf2117 (specpdl_unrewind): Fix corner case
* src/lisp.h (enum specbind_tag): New elem SPECPDL_NOP.

* src/eval.c (specpdl_unrewind): Zap entries that can't be applied any more,
and simplify.
(default_toplevel_binding, lexbound_p, Fbacktrace__locals): Simplify.
(do_one_unbind, mark_specpdl): Handle SPECPDL_NOP.
2022-02-19 14:55:39 -05:00
Stefan Monnier
c3e064013e (loadhist_initialize): Minor refactoring
Consolidate a bit of code.

* src/lread.c (loadhist_initialize): New function.
(Fload, readevalloop): Use it.
2022-02-19 14:12:14 -05:00
Po Lu
14562b45bd Avoid consing extra string when processing GTK native input
* src/gtkutil.c (xg_im_context_commit): Use
`decode_string_utf8' to decode input text.

* src/keyboard.c (kbd_buffer_get_event_1): If coding system is
Qt, simply return the string without decoding it.

* src/termhooks.h (enum event_kind): Document meaning of Qt as
coding system in a multibyte keystroke event's string argument.
2022-02-19 21:02:30 +08:00
Po Lu
9fff6388b4 Fix some more hangs when parenting child frames around on Haiku
* src/haiku_support.cc (ParentTo):
(FrameMoved): Don't sync when a recursive lock might be able to
be held.
2022-02-19 12:30:26 +00:00
Po Lu
88f591f389 Improve portability of alpha channel visual detection
* src/xfns.c (select_visual): Look for PictVisuals with an alpha
channel instead of blindly assuming that 32 bit visuals have an
alpha channel.
(Fx_show_tip): Fix crash on some displays where child is None.

* src/xterm.c (x_term_init): Initialize Xrender before
calling select_visual.
2022-02-19 20:07:54 +08:00
Alan Mackenzie
f687e62ac5 Fix symbols with position appearing in the output of `compile-defun'
This happened with the tags of a condition-case.  Also fix the detection of
circular lists while stripping the positions from symbols with position.

* lisp/emacs-lisp/byte-run.el (byte-run--circular-list-p): Remove.
(byte-run--strip-s-p-1): Write a value of t into a hash table for each cons or
vector/record encountered.  (This is to prevent loops with circular
structures.)  This is now done for all arguments, not just those detected as
circular lists.

* lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-defvar)
(byte-compile-form, byte-compile-dynamic-variable-op)
(byte-compile-constant, byte-compile-push-constant): Remove redundant calls to
`bare-symbol'.
(byte-compile-lambda): call `byte-run-strip-symbol-positions' on the arglist.
(byte-compile-out): call `byte-run-strip-symbol-positions' on the operand.
This is the main call to this function in bytecomp.el.

* src/fns.c (hashfn_eq): Strip the position from an argument which is a symbol
with position.
(hash_lookup): No longer strip a position from a symbol with position.
(sxhash_obj): Add handling for symbols with position, substituting their bare
symbols when symbols with position are enabled.
2022-02-19 10:38:19 +00:00
Eli Zaretskii
767619595c Fix character compositions on the mode line
* src/composite.c (composition_compute_stop_pos)
(Ffind_composition_internal): When characters come from a string,
determine whether to compose them from that string's multibyteness,
not from that of the current buffer.  (Bug#53729)
2022-02-19 11:19:48 +02:00
Po Lu
e015dc77f5 Don't ignore events from XI2 slave devices anymore
All the machinery needed to keep track of events from those
devices is already in place, so that's no longer required.

* src/xterm.c (x_get_scroll_valuator_delta):
(xi_reset_scroll_valuators_for_device_id):
(handle_one_xevent): Don't ignore XI devices that are not master
pointers or keyboards.
2022-02-19 16:21:51 +08:00
Po Lu
5b90b05e42 Always decode GTK input method text as utf-8-unix
* src/gtkutil.c (xg_im_context_commit): Use `utf-8-unix' as
coding system for text.
2022-02-19 13:27:03 +08:00
Po Lu
7829f1b5e6 Be less strict about which emulated motion events to ignore
* src/xterm.c (handle_one_xevent): Don't test XI2 version before
dropping PointerEmulated motion events.
2022-02-19 11:51:05 +08:00
Po Lu
8f9edb2e7c * src/haikufns.c (haiku_create_frame): Error if font wasn't found. 2022-02-19 02:19:29 +00:00
Po Lu
02bca34852 Utilize new string decoding feature in GTK native input
* src/gtkutil.c (xg_im_context_commit): Don't decode strings
manually using g_utf8_to_ucs4 but pass unibyte string as the
keystroke event arg instead.
2022-02-19 09:18:27 +08:00
Po Lu
b76cd8af05 Fix background stipple with `alpha_background'
* src/xterm.c (x_fill_rectangle): Fix treatment of foreground
and background colors when there is a stipple.
2022-02-18 21:24:42 +08:00
Po Lu
1f755a74b7 Fix a crash on some versions of GTK
* src/emacsgtkfixed.c (XSetWMNormalHints): Fix potential
arithmetic fault.
2022-02-18 18:04:02 +08:00
Po Lu
ef1dfd2261 Fix blurry text on multiple scale monitor setups
* src/pgtkterm.c (pgtk_copy_bits): Preserve window scale factor
on temporary surface.  (bug#54040)
2022-02-18 15:50:25 +08:00
Po Lu
e87b07e277 Make treatment of `alpha-background' more consistent
* src/xterm.c (x_clear_glyph_string_rect):
(x_draw_glyph_string_background): Ignore alpha_background on all
cursors.
2022-02-18 13:51:15 +08:00
Po Lu
7938410ac0 Make stipple backgrounds respect `alpha-background'
* src/xterm.c (x_fill_rectangle): Respect `alpha-background'
when drawing stipple.
2022-02-18 10:35:21 +08:00
Po Lu
1a8b3b6390 Fix mis-parsing of certain malformed XBM files
* src/image.c (xbm_scan): Return error on a character literal
that doesn't start with "\x".
2022-02-18 09:37:36 +08:00
Po Lu
2236ee40ea Parse XBM images which use character escapes for hex literals
* src/image.c (xbm_scan): Implement parsing of hex escapes in
character literals.
2022-02-18 09:12:48 +08:00
Mattias Engdegård
c1111e9447 Fix or remove outdated comments
* src/eval.c (funcall_lambda): Rewrite obsolete comment.
* src/bytecode.c (exec_byte_code): Remove lying comment and
unneeded #define.
* lisp/emacs-lisp/byte-opt.el: Remove car.  Keep pig.
(byte-compile-log-lap-1): Remove obsolete and irrelevant comment.
2022-02-17 14:52:04 +01:00