1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-01 09:51:22 -08:00
Commit graph

45322 commits

Author SHA1 Message Date
Po Lu
70a184b141 Improve correctness of generated xwidget events
* src/xwidget.c (xw_maybe_synthesize_crossing): Add new
parameters for controlling the crossing mode.  Also improve the
accuracy of generated crossing events when the mouse pointer
moves outside the toplevel from an inferior of it.  All callers
changed.
(xw_notify_virtual_upwards_until):
(xw_notify_virtual_downwards_until): New parameters for crossing
mode.  All callers changed.
2022-02-02 19:05:54 +08:00
Po Lu
fded822c80 Send button events before setting xwidget passive grab
* src/xwidget.c (xwidget_button_1): Send button event before
any grab processing.
2022-02-02 15:33:48 +08:00
Po Lu
e7047b4aba * src/nsselect.m (ns_get_foreign_selection): Fix GCC warning. 2022-02-02 15:19:52 +08:00
Po Lu
e3e0deb86d Make behaviour of `mouse-autoselect-window' consistent with X on NS
* src/nsterm.m ([EmacsView mouseMoved:]): Ignore if
`selected_window' is a minibuffer window.
2022-02-02 15:19:52 +08:00
Po Lu
d4c2f5b524 Improve behaviour of `mouse-autoselect-window' on Haiku
* src/haikuterm.c (haiku_read_socket): Don't select windows if
the selected window is a minibuffer window or a popup is
activated.
2022-02-02 04:56:55 +00:00
Po Lu
6869679be5 Fix display of vertical window dividers on Haiku
* src/haikuterm.c (haiku_draw_window_divider): Make drawing
consistent with X.
2022-02-02 02:25:00 +00:00
Po Lu
f1f0608fd1 Don't use XRender to fill rectangles unless an alpha channel exists
* src/xterm.c (x_clear_area): Don't use XRender unless
`alpha_bits' is set.
2022-02-02 09:17:31 +08:00
Mattias Engdegård
4af491605c ; * src/eval.c (funcall_subr): Fix last change 2022-02-01 20:45:36 +01:00
Andrea Corallo
02054d9cd1 * Improve 'maybe_defer_native_compilation'
* src/comp.c (maybe_defer_native_compilation): Always store the
function name in Vcomp_deferred_pending_h if pending for deferred
compilation.
2022-02-01 18:05:51 +01:00
Mattias Engdegård
a20f2b0ff9 Speed up calls to C primitives
* src/eval.c (funcall_subr): Test most likely cases first (conforming
calls to finite-arity or n-adic SUBRs), and the error cases last,
instead of doing it the other way around.  Simplify.
2022-02-01 17:37:05 +01:00
Po Lu
2b9c648de6 * src/pgtkterm.c (pgtk_draw_rectangle): Fix trivial typo. (bug#53677) 2022-02-01 20:15:37 +08:00
Andrea Corallo
e7fd6fe7ec Rename comp--loadable' into comp--compilable'
* lisp/startup.el (comp--compilable): Rename from `comp--loadable'.
(startup--require-comp-safely): Update accordingly.
(startup--honor-delayed-native-compilations): Likewise.
* src/comp.c (syms_of_comp): Update.
(maybe_defer_native_compilation): Likewise.
2022-02-01 11:30:17 +01:00
Stefan Kangas
30ebb54410 Merge from origin/emacs-28
31ef751f94 Clarify documentation of a "face's font"
29bdedf12f Bind Qdebugger to Qdebug in signal_or_quit.
2022-02-01 06:57:16 +01:00
Po Lu
558c4dafa3 Clean up Haiku display structures
* src/haikufns.c (haiku_set_parent_frame): Set `parent_desc'
correctly.

* src/haikuterm.h (C_FRAME, C_FONT, C_TERMINAL):
(struct haiku_display_info):
(struct haiku_output): Get rid of C_* preprocessor defines,
since these files are no longer included in any way by C++ files.
2022-02-01 05:39:28 +00:00
Po Lu
103ddfe387 Display images with a mask correctly when `alpha-background' is set
* src/xterm.c (x_query_frame_background_color): Return value
adjusted for background alpha.
(x_draw_image_glyph_string): Respect `alpha-background' when
generating background pixmap.
2022-02-01 12:58:00 +08:00
Po Lu
d6d73224a2 Make fringe bitmaps respect alpha-background
* src/xterm.c (x_draw_fringe_bitmap): Respect alpha-background
on non-overlay fringe bitmaps.
* src/xterm.h (struct x_display_info): New field `alpha_mask'.
2022-02-01 09:38:26 +08:00
Eli Zaretskii
31ef751f94 Clarify documentation of a "face's font"
* doc/lispref/display.texi (Attribute Functions)
(Face Attributes): Clarify that the :font attribute of a face and
the font returned by 'face-font' are by default for ASCII
characters.  (Bug#53664)
2022-01-31 19:29:54 +02:00
Alan Mackenzie
29bdedf12f Bind Qdebugger to Qdebug in signal_or_quit.
* src/eval.c (signal_or_quit): Bind the correct variable, Qdebugger (not
Vdebugger) to Qdebug in the section for errors in batch jobs.
(syms_of_eval): New DEFSYM for Qdebugger.
2022-01-31 17:20:45 +00:00
Stefan Monnier
1d1b664fbb (function-history): New symbol property (bug#53632)
Rework the code we have in Fdefalias that tries to keep track
of definitions so as to be able to undo them later.

We used to store in `load-history` when an autoload is redefined as
a non-autoload and in the `autoload` symbol property we used to store
the autoload data that used to be used before it got overriden.

Instead, store the history of the function definition of
a symbol in its `function-history` symbol property.
To make this list cheap in the default case, the latest value is not stored
in the list (since it's in the `symbol-function`) and neither is the first
file.  So if there's only been a single definition (the most common case),
the list is empty and the property is just not present at all.

The patch also gets rid of the `autoload` vs `defun` distinction in
`load-history` which seems unnecessary (a significant part of the
motivation for this patch was to get rid of the special handling of
autoloads in this part of the code).

* src/data.c (add_to_function_history): New function.
(defalias): Use it.  Don't add the `t` entries for autoloads and always
use `defun` regardless of the kind of definition.
Change `Vautoload_queue` to only hold the function
symbols since the rest is now available from `function-history`.
* src/eval.c (un_autoload): Adjust accordingly.

* src/lread.c (load-history): Udate docstring.

* lisp/loadhist.el (loadhist-unload-filename): New var.
(unload-feature): Bind it.
(loadhist-unload-element): Document its availability.
(loadhist--restore-autoload): Delete var.
(loadhist--unload-function): Delete function.
(loadhist-unload-element): Delete the `t` and `autoload` methods.
Rewrite the `defun` method using `function-history`.

* lisp/help-fns.el: Require `seq`.
(help-fns--autoloaded-p): Rewrite.
(help-fns-function-description-header): Adjust call accordingly.

* doc/lispref/loading.texi (Where Defined): Remove `autoload` and `t`
entries from `load-history` since we don't generate them any more.
Document the `function-history` which replaces the `autoload` property.
(Unloading): Adjust symbol property name accordingly.

* test/lisp/loadhist-resources/loadhist--bar.el:
* test/lisp/loadhist-resources/loadhist--foo.el: New files.
* test/lisp/loadhist-tests.el (loadhist-tests-unload-feature-nested)
(loadhist-tests-unload-feature-notnested): New tests.
2022-01-31 11:07:26 -05:00
Po Lu
6da021fce8 Fix artifacting on PGTK when bits are copied with an alpha channel
* src/pgtkterm.c (x_draw_stretch_glyph_string): Draw background
respecting `alpha-background'.
(pgtk_copy_bits): Use CAIRO_OPERATOR_SOURCE to draw onto the
destination surface.
2022-01-31 21:13:41 +08:00
Po Lu
4efab4330e ; * src/gtkutil.c (xg_create_frame_widgets): Avoid private GTK symbol. 2022-01-31 21:01:45 +08:00
Po Lu
46473a4eac Implement `alpha-background' on PGTK
* src/ftcrfont.c (ftcrfont_draw): Respect alpha-background where
appropriate.
* src/gtkutil.c (xg_create_frame_widgets): Swap some
conditionals around to get the right visual and signal handlers
on PGTK.
(xg_widget_style_updated): Likewise.
* src/pgtkfns.c (pgtk_set_alpha_background): New function.
(pgtk_frame_parm_handlers): Add it instead of the generic param
handler.
(Fx_create_frame): Fix typo.
* src/pgtkterm.c (pgtk_fill_rectangle):
(pgtk_set_cr_source_with_gc_foreground):
(pgtk_set_cr_source_with_gc_background):
(pgtk_set_cr_source_with_color): New argument
`respect_alpha_backend'.  All callers changed.
* src/pgtkterm.h: Update function prototypes.
2022-01-31 20:21:04 +08:00
Po Lu
790ad61fcf Fix accesses to GTK structures on tooltip frames
* src/xfns.c (xic_set_preeditarea): Don't set the GTK context on
tooltip frames.
(x_set_alpha_background): Don't make tooltip frames paintable.
* src/xterm.c (x_xr_ensure_picture): Get rid of GDK visual code.
This is now done in a better way inside xg_create_frame_widgets.
(bug#53654)
2022-01-31 18:38:24 +08:00
Po Lu
2ce7ac1c50 * src/haikufns.c (Fx_display_visual_class): Return correct values. 2022-01-31 10:14:52 +00:00
Po Lu
5edef4e98c Improve portability of GDK visual code
* src/gtkutil.c (xg_create_frame_widgets): Look up the visual
instead of assuming it based on the depth.
2022-01-31 18:13:19 +08:00
Po Lu
1472b046ea * src/xterm.c (x_term_init): Avoid freeze with 24-bit visuals. 2022-01-31 18:08:07 +08:00
Po Lu
79896d3eb7 Improve portability of alpha channel handling on TrueColor visuals
* src/xfns.c (select_visual): Always ask for a TrueColor visual.
* src/xfont.c (xfont_draw):
* src/xftfont.c (xftfont_draw): Test `alpha_bits' instead of
n_planes.
* src/xterm.c (x_fill_rectangle, x_clear_rectangle): Likewise.
(x_query_colors, x_alloc_nearest_color): Remove code that
hard-coded alpha mask.
(x_term_init): Calculate alpha bits and offset and populate
field appropriately.
* src/xterm.h (struct x_display_info): New fields `alpha_bits'
and `alpha_offset'.
(x_make_truecolor_pixel): Stop hardcoding the value of the alpha
mask.
2022-01-31 18:05:13 +08:00
Po Lu
cb91643c97 Fix motion not being reported on GTK when mouse moves over toolbar
* src/gtkutil.c (xg_event_is_for_scrollbar): Make code
consistent between XI2 and Core Input.
2022-01-31 13:53:44 +08:00
Po Lu
eb9dd32130 Make cursor alpha consistent with a transparent background
* src/xfont.c (xfont_draw):
* src/xftfont.c (xftfont_shape):
* src/xterm.c (x_clear_glyph_string_rect): Don't respect
background alpha when drawing the cursor.
2022-01-31 13:06:14 +08:00
Po Lu
ae8332b830 * src/xterm.c (x_xrender_color_from_gc_foreground): Fix omission error. 2022-01-31 12:58:11 +08:00
Po Lu
04f9c3b8df Fix the X toolkit build
* src/xterm.c (x_after_update_window_line): Update calls to
`x_fill_rectangle'.
2022-01-31 11:59:52 +08:00
Po Lu
a31914dda5 Fix tooltip frame creation with 32-bit visuals
* src/xfns.c (x_create_tip_frame): Define CWColormap and
CWBorderPixel to use a 32-bit visual if available.
2022-01-31 11:53:10 +08:00
Po Lu
2f32333cff Fix the no toolkit build.
* src/xfns.c (x_window): Use n_planes instead of CopyFromParent
for depth.
2022-01-31 10:37:49 +08:00
Po Lu
0a34aeee7e Fix builds without GTK
* src/xfns.c (x_set_alpha_background): Don't call
gtk_widget_set_app_paintable without GTK.
2022-01-31 10:30:24 +08:00
Po Lu
1555453694 Implement `alpha-background' on non-Cairo builds
* src/frame.c (gui_set_alpha_background): Recompute basic faces
so xft face ext info gets reset.
* src/gtkutil.c (xg_create_frame_widgets): Attach to style
updated signal.
(xg_update_frame_menubar): Set menu bar visual correctly.
(xg_widget_style_updated): New function.

* src/xfns.c (x_set_alpha_background): New function.
(x_frame_parm_handlers): Use x_set_alpha_background instead.

* src/xfont.c (xfont_draw):
* src/xftfont.c (xftfont_draw): Handle `alpha-background'
parameter.

* src/xterm.c (x_xr_ensure_picture): Export function.
(x_update_opaque_region): New function.
(x_fill_rectangle): New parameter `respect_alpha_background'.
All callers changed.
(handle_one_xevent): Set opaque region on ConfigureNotify.
(x_drop_xrender_surfaces): Set opaque region.
(x_xrender_color_from_gc_foreground):
(x_xrender_color_from_gc_background): Premultiply alpha with
components if asked for.
* src/xterm.h (struct x_display_info): New atom
`Xatom_net_wm_opaque_region'.
2022-01-31 10:15:47 +08:00
Juri Linkov
1b83e58adb * lisp/frame.el: Don't require 'frameset.el' (bug#51883).
(clone-frame): Use frame-internal-parameters.
(undelete-frame--handle-delete-frame): Instead of using frameset-save,
save frame-parameters except frame-internal-parameters and 'display'
on non-graphic display.  Also save window-state from window-state-get.
(undelete-frame): Instead of using frameset-restore,
set default-frame-alist for make-frame (like in clone-frame),
and restore window-state with window-state-put.

* lisp/frameset.el (frameset-session-filter-alist): Append
parameters from frame-internal-parameters with the filter :never.
Remove :name that is now in frame-internal-parameters.
(frameset-persistent-filter-alist): Remove outer-window-id,
parent-id, window-id that are now in frame-internal-parameters,
included here via frameset-session-filter-alist.

* src/frame.c (frame-internal-parameters): New variable.
2022-01-30 18:40:09 +02:00
Po Lu
71174a16da Handle correctly errors during frame creation on Haiku
* src/haikufns.c (haiku_create_frame): Only block input where
required.

* src/haiku_support.cc (BCursor_delete): Accept NULL values of
`cursor'.
2022-01-30 13:23:52 +00:00
Po Lu
988d3d79ba Use XRender to composite fringe bitmaps
This will allow us to apply transforms such as scaling in the
future.

* src/xterm.c (x_draw_fringe_bitmap): Composite fringe bitmaps
with XRender if available.
2022-01-30 16:02:58 +08:00
Po Lu
26a9acc86a Fix some problems with inconsistent visuals on GDK
* src/xterm.c (x_xr_ensure_picture): Use the visual GDK used
instead of our own.
2022-01-30 14:04:12 +08:00
Po Lu
2886520160 Use consistent font when displaying menu equivalent keys on Haiku
* src/haiku_support.cc (DrawContent): Set plain font when
drawing key text.
2022-01-30 05:20:15 +00:00
Po Lu
310bcda934 Add support for ARGB visuals on non-Xt builds
* src/gtkutil.c (xg_create_frame_widgets): Enable RGBA visual
on non-PGTK builds.
* src/xfns.c (select_visual): Select 32-bit visuals on non-Xt
builds.
* src/xterm.c (x_draw_fringe_bitmap):
(x_draw_image_glyph_string): Stop using DefaultDepthOfScreen.
(x_query_colors):
* src/xterm.h (x_make_truecolor_pixel): Make colors opaque on
32-bit visuals.
2022-01-30 09:23:40 +08:00
Po Lu
391c1289e2 Some adjustments to last change
* src/gtkutil.c (xg_set_undecorated): Only set ARGB visual on
Cairo builds wtihout PGTK.
* src/xfns.c (select_visual): Likewise.
2022-01-30 08:51:13 +08:00
Håkon Flatval
b944841173 Add background transparency support for GTK+Cairo 2022-01-30 08:38:32 +08:00
Lars Ingebrigtsen
43a5f22857 Allow redirecting `message' output to a different buffer
* doc/lispref/display.texi (Logging Messages): Document it.
* src/xdisp.c (message_dolog): Add sanity checking.
(syms_of_xdisp): Make Vmessages_buffer_name into a defvar
(bug#27170).
2022-01-29 17:24:49 +01:00
Lars Ingebrigtsen
7608b77d9e Clarify Fmatch_data doc string
* src/search.c (Fmatch_data): Note quirk about non-matching
optional groups in the doc string (bug#29343).
2022-01-29 16:39:48 +01:00
Po Lu
4bac7d8c73 Fix error after merge
* src/filelock.c (lock_file): Fix test against I_OWN_IT.
2022-01-29 20:38:13 +08:00
Po Lu
04bba4a28f Merge from origin/emacs-28
611736f3bc Remove debug logging
ddba3c3dba Fix error in filelock.c

# Conflicts:
#	src/filelock.c
2022-01-29 20:37:24 +08:00
Alan Third
611736f3bc Remove debug logging
* src/nsterm.m ([EmacsView copyRect:to:]): Remove logging as it's no
longer required.
2022-01-29 12:15:39 +00:00
Po Lu
e380fb509b Fix unrelated help text tooltips if a popup is shown during the delay
* doc/lispref/frames.texi (Pop-Up Menus): Document new hook.
* etc/NEWS: Announce `x-pre-popup-menu-hook'.
* lisp/tooltip.el (tooltip-mode): Make sure `tooltip-hide' is
run before any popup menu is displayed to prevent unrelated help
text from obscuring the popup menu if it pops up during the
tooltip delay.
* src/menu.c (x_popup_menu_1): Run said hook right before the
popup menu is displayed.
(syms_of_menu): New hook `x-pre-popup-menu-hook'.
2022-01-29 18:57:08 +08:00
Michael Albinus
ddba3c3dba Fix error in filelock.c
* src/filelock.c (lock_file): Move call of file name handler to
`Flock_file'.  Determine lock_filename only in case
create_lockfiles is non-nil.  Adapt the rest of the function accordingly.
(Flock_file): Do not check for create_lockfiles.  Call file name
handler if appropriate.  (Bug#53207)
2022-01-29 11:45:38 +01:00