1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-26 15:21:51 -08:00
Commit graph

45491 commits

Author SHA1 Message Date
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
Po Lu
64eb2a5f8d Fix crash when displaying XBM images on a 32-bit visual
* src/image.c (Create_Pixmap_From_Bitmap_Data): Fix use of wrong
(default) depth.
2022-02-17 20:44:53 +08:00
Po Lu
7e6fa8ed38 Implement XBM images on Haiku
* src/image.c (image_create_bitmap_from_data): Handle allocation
failures on Haiku.
(Create_Pixmap_From_Bitmap_Data): Implement for Haiku.
2022-02-17 12:36:50 +00:00
Po Lu
c0fa3f2a6b Prevent menu items leak if x-pre-popup-menu-hook signals
* src/menu.c (x_popup_menu_1): Make sure menu items are
discarded if the pre popup menu hook signals.
2022-02-17 18:06:12 +08:00
Po Lu
6094f3a16b * src/xterm.c (x_init_master_valuators): Clear `pending_enter_reset'. 2022-02-17 13:35:11 +08:00
Po Lu
5df33cfcaf Improve handling of XI2 wheel movement
* src/xterm.c (handle_one_xevent): Process movement in all
directions and send it as a single event.
2022-02-17 13:25:01 +08:00
Po Lu
99d6536c32 Fix SIGFPE on some fonts when calculating their average width on Haiku
* src/haiku_font_support.cc (estimate_font_ascii): Avoid divison
by zero.
2022-02-17 02:32:55 +00:00
Po Lu
74c0773369 * src/emacsgtkfixed.c (XSetWMSizeHints): Improve fix for bug#8919. 2022-02-17 10:28:02 +08:00
Po Lu
e14317eec4 Don't auto-lower when moving onto a menu bar on Haiku
* src/haiku_io.c (haiku_len): Handle `MENU_BAR_LEFT'.
* src/haiku_support.cc (EmacsMenuBar::MouseMoved): New function.
* src/haiku_support.h (enum haiku_event_type): New event
`MENU_BAR_LEFT'.
(struct haiku_menu_bar_left_event): New structure.
* src/haikuterm.c (haiku_read_socket): Don't auto-lower when the
mouse exits the frame view onto the menu bar and handle
MENU_BAR_LEFT events.
2022-02-17 01:26:14 +00:00
Po Lu
9780972a44 Handle `unspecified' values of symbolic font values on Haiku
* src/haikufont.c (haikufont_spec_or_entity_to_pattern): Handle
`unspecified' values of symbolic values.
2022-02-17 01:25:24 +00:00
Po Lu
e389da74d5 Fix recent change in xwidget.c
* src/xwidget.c (xwidget_init_view): Don't assume ttip_widget
is NULL if tooltips have not been initialized.
2022-02-16 19:55:11 +08:00
Mattias Engdegård
3b7d55a801 Speed up count_size_as_multibyte
This function is used in many places to calculate the length of
a unibyte string converted to multibyte.

* src/character.c (count_size_as_multibyte): Move the overflow test
outside the loop, which makes it much faster.  Standard compilers
will even vectorise it if asked to (-O2 in Clang, -O3 in GCC).
2022-02-16 12:33:35 +01:00
Po Lu
fd2252294b Fix frame focus handling with native input
* lisp/term/x-win.el (x-gtk-use-native-input-watcher): Stop
passing frame parameter  to `x-internal-focus-input-context'.
* src/xfns.c (Fx_internal_focus_input_context): Focus all focus
frames from all displays.
2022-02-16 15:40:39 +08:00
Po Lu
db5d2a4407 Resolve xwidget scrolling mysteries
* src/xterm.c (x_any_window_to_frame): Handle xwidget views.
(handle_one_xevent): Always increment values array when handling
motion events.
2022-02-16 14:38:06 +08:00
Po Lu
f1d535da1e Decode keyboard input as latin-1 whenever appropriate
* src/keyboard.c (kbd_buffer_get_event_1): Use `coding'
property if present.

* src/termhooks.h (enum event_kind): Document meaning of
`coding' property on text strings.

* src/xterm.c (handle_one_xevent): Set coding property on text
to latin-1 if it was obtained with XLookupString.
2022-02-16 10:53:00 +08:00
Po Lu
0a9c8855b0 Don't decode text within XIM callbacks or handle_one_xevent
* src/keyboard.c (kbd_buffer_get_event_1):
(kbd_buffer_get_event_2): New functions.
(kbd_buffer_get_event): Accept a new meaning of
MULTIBYTE_CHAR_KEYSTROKE_EVENT where .arg can be a unibyte
string to be decoded in the locale coding system.

* src/termhooks.h (enum event_kind): Document new meaning of
.arg in a multibyte keystroke event.

* src/xfns.c (struct x_xim_text_conversion_data): New struct.
(x_xim_text_to_utf8_unix_1):
(x_xim_text_to_utf8_unix_2): New functions.
(x_xim_text_to_utf8_unix): Handle decode failure correctly.
(xic_preedit_draw_callback): Abort IM context if text could not
be decoded correctly.

* src/xterm.c (handle_one_xevent): Utilize new meaning of
MULTIBYTE_CHAR_KEYSTROKE_EVENT.
2022-02-16 10:10:13 +08:00
Po Lu
0b286ea45a Fix parsing of some semibold font styles on Haiku
* src/haiku_font_support.cc (font_style_to_flags): Accept
"Semibold" to mean SemiBold as well.  Reported by
augiedoggie <augiedoggie@users.noreply.github.com>.
2022-02-15 07:27:31 +00:00
Po Lu
5129e713b0 Disable auto-lowering and raising on Haiku when a popup is active
* src/haikuterm.c (haiku_new_focus_frame):
(haiku_read_socket): Don't raise or lower if popup is activated.
2022-02-15 07:21:18 +00:00
Po Lu
6f566021ed Replace use of `DefaultRootWindow' with our recorded root window
* src/xfns.c (x_relative_mouse_position):
(x_set_parent_frame):
(Fx_mouse_absolute_pixel_position):
(Fx_set_mouse_absolute_pixel_position):
* src/xterm.c (x_iconify_frame): Use dpyinfo->root_window
instead of DefaultRootWindow.
2022-02-15 13:41:52 +08:00
Po Lu
f6811ff8e2 * src/xterm.c (init_xterm): Use more reliable method to disable XI2. 2022-02-15 10:23:49 +08:00
Po Lu
bb33446f2a Better handle devices being enabled on XI2
* src/xterm.c (handle_one_xevent): Don't abort on DeviceChanged
if the device couldn't be found, instead regenerating the device
hierarchy to see if it was enabled.
2022-02-15 09:19:12 +08:00
Lars Ingebrigtsen
d52d913fa0 Don't signal errors in abbrev-table-p
* lisp/abbrev.el (abbrev-table-p): Ignore the error.
* src/lread.c (oblookup): Signal `wrong-type-argument' instead of
`error' if it turns out that we're not really in an obarray (bug#53988).
2022-02-14 12:00:22 +01:00
Po Lu
9844b152a5 Premultiply background color by alpha for images
* src/xterm.c (x_query_frame_background_color): Premultiply
colors as X wants them when built without Cairo.
2022-02-14 18:43:44 +08:00
Po Lu
b47d36f189 Improve Haiku selection handling
* lisp/select.el (gui--selection-value-internal): Use X types on
Haiku as well.

* lisp/term/haiku-win.el (haiku--selection-type-to-mime): Update
types to correspond better with X.

* src/haikuselect.c (Fhaiku_selection_data):
(Fhaiku_selection_put): Remove a great deal of ad hoc code now
handled by the regular selection machinery.
2022-02-14 10:26:29 +00:00
Po Lu
5fb262597f Handle allocation failures of fringe bitmaps on Haiku
* src/haikuterm.c (haiku_define_fringe_bitmap): Handle
allocation failures.
2022-02-14 07:12:17 +00:00