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

45358 commits

Author SHA1 Message Date
Po Lu
50e51beabb Allow disabling frame resize synchronization
* doc/emacs/xresources.texi (Table of Resources): Document new
parameter `synchronizeResize'.
* etc/NEWS: Announce frame resize synchronization.
* src/xterm.c (x_term_init): Don't enable XSync if the
X resource `synchronizeResize' is off or false.
2022-02-06 10:43:38 +08:00
Po Lu
b38c0d6a2f Clean up lots of #ifdef'd out code in PGTK files
Most of them are either relics from X or from the NS code
pgtkfns.c was copied from whole.

* src/pgtkfns.c (x_icon):
(pgtk_set_scroll_bar_foreground):
(pgtk_set_scroll_bar_background):
(Fx_create_frame):
(pgtk_window_is_ancestor):
(x_create_tip_frame):
* src/pgtkselect.c (syms_of_pgtkselect):
* src/pgtkterm.c (pgtk_iconify_frame):
(x_set_frame_alpha):
(button_event): Remove defined out code that cannot make sense.

* src/pgtkmenu.c (show_help_event): Remove ifdef'd out code and
reword comment.
2022-02-06 09:18:59 +08:00
Po Lu
9c1d6b1d6a Handle window state changes on PGTK
* src/pgtkterm.c (window_state_event): Set fullscreen, sticky,
and iconification status according to the new window state.
(bug#53793)
2022-02-06 08:58:23 +08:00
Po Lu
eb351e3795 Minor changes to xsync support
* src/xfns.c (append_wm_protocols): Don't append
_NET_WM_SYNC_REQUEST unless the display supports our version of
XSync.

* src/xterm.c (handle_one_xevent): Don't handle
_NET_WM_SYNC_REQUEST unless the display supports that.
(x_free_frame_resources): Test basic counter against None.
2022-02-06 08:39:02 +08:00
Po Lu
9e420cd893 Add support for basic syncing with the window manager on resize
This is handled by GTK 3, so the code is disabled on that
specific build.  On other builds, this eliminates any unexposed
part of a frame from showing up after a resize when
`frame-resize-pixelwise' is t.

* configure.ac: Check for the X Synchronization Extension if
present.
* src/Makefile.in (EMACS_CFLAGS):
(LIBES): Add XSYNC_LIBS and XSYNC_CFLAGS.

* src/xfns.c (append_wm_protocols): Declare
`_NET_WM_SYNC_REQUEST' support if appropriate.
(x_window): Adjust location of call to `append_wm_protocols' on
Xt version to prevent it from being overwritten.
(Fx_create_frame): Create basic counter.
* src/xterm.c (XTframe_up_to_date): Set counter value to the one
asked for by the window manager.
(handle_one_xevent): Handle _NET_WM_SYNC_REQUEST.
(x_free_frame_resources): Free frame counter if present.
(x_term_init): Test for XSync and set fields accordingly.
* src/xterm.h (struct x_display_info): New fields for XSync
support and new atoms.
(struct x_output): New fields for counter status.
(FRAME_X_BASIC_COUNTER): New macro.
2022-02-05 21:43:00 +08:00
Eli Zaretskii
4243747b1b Fix 'current-column' in the presence of display strings
* src/indent.c (check_display_width): Support calculation of width
of 'display' properties whose values are strings.  This fixes the
value returned by 'current-column' when display strings are
present between BOL and point.  (Bug#53795)
2022-02-05 13:01:24 +02:00
Lars Ingebrigtsen
89d419255b Improve the selected-window doc string
* src/window.c (Fselected_window): Add some pointers to other
functions in this area.
2022-02-05 08:07:18 +01:00
Po Lu
adf1ba578d Finish up cursor color merging on Haiku
* src/haikuterm.c (haiku_draw_text_decoration):
(haiku_draw_plain_background):
(haiku_draw_stretch_glyph_string):
(haiku_merge_cursor_foreground): Use merged cursor colors.
2022-02-05 05:08:00 +00:00
Po Lu
9c66aee178 Fix last change to ftcrfont.c
* src/ftcrfont.c (ftcrfont_draw): Remove relic `face' variable
and use s->face instead.
2022-02-05 03:21:17 +00:00
Po Lu
c274bd5c52 Implement face cursor color merging on Haiku
* src/ftcrfont.c (ftcrfont_draw):
* src/haikufont.c (haikufont_draw): Use
`haiku_merge_cursor_foreground' to calculate cursor HL colors.
* src/haikuterm.c (haiku_merge_cursor_foreground): New function.
* src/haikuterm.h: Update prototypes.
2022-02-05 03:17:58 +00:00
Po Lu
686f7f8f62 Set WM_TRANSIENT_FOR on tooltip frames
Otherwise the decorations get all messed up on GNOME and some
other composited desktops.

* src/xfns.c (Fx_show_tip): Set WM_TRANSIENT_FOR to the window
underneath the tooltip.
2022-02-05 10:51:39 +08:00
Po Lu
9ff88dfc5b Implement _NET_WM_PING protocol
* src/xfns.c (append_wm_protocols): New function.
(x_window): Call `append_wm_protocols' after window creation.
* src/xterm.c (handle_one_xevent): Handle _NET_WM_PING client
messages.
(x_term_init): Intern _NET_WM_PING atom.
* src/xterm.h (struct x_display_info): New field
`Xatom_net_wm_ping'.
2022-02-05 09:41:01 +08:00
Vladimir Panteleev
5098f2b844 Update the MULTIPLE property with conversion outcomes
Per the ICCCM spec:

> If the owner fails to convert the target named by an atom in the
> MULTIPLE property, it should replace that atom in the property with
> None.

* src/xselect.c (x_handle_selection_request): Do it.
2022-02-05 09:07:14 +08:00
Vladimir Panteleev
de687e8983 Do not delete the MULTIPLE property after reading it
Per the ICCCM spec:

> The requestor should delete [...] the property specified in the
> MULTIPLE request when it has copied all the data.

We are not the requestor, so we should not be deleting this property
(which is what x_get_window_property_as_lisp_data does).  The property
needs to remain available as the requestor will generally want to read
it back to see which conversions succeeded or not.

* src/xselect.c (x_get_window_property_as_lisp_data): Add flag which
skips deleting the read property, or handling INCR (which does not
make sense for MULTIPLE).
(x_handle_selection_request): Enable the flag.
2022-02-05 09:07:00 +08:00
Eli Zaretskii
9a8796f067 Fix infloop in redisplay_window due to fix of bug#14582
* src/xdisp.c (window_start_acceptable_p): New function.
(redisplay_window): Call 'window_start_acceptable_p' to determine
whether a given window-start point is acceptable, including when
the window's force_start flag is set -- this fixes infloop in
redisplay_window in that case.
2022-02-04 15:50:50 +02:00
Po Lu
3e20a90019 ; * src/haikuterm.c (haiku_end_cr_clip): Fix trivial typo. 2022-02-04 12:12:56 +00:00
Po Lu
279f3c6d60 Implement auto-raise on Haiku
* src/haikuterm.c (haiku_read_socket): Implement auto-raising
of frames that have that parameter set.
2022-02-04 12:11:29 +00:00
Po Lu
97966c5154 ; * src/xterm.c (x_alloc_nearest_color_1): Remove extraneous code. 2022-02-04 15:39:45 +08:00
Po Lu
3da5dc66ea Fix bit rot in the color allocation code
* src/xterm.c (x_alloc_nearest_color_1): Reintroduce an older
version of the code that would try to allocate a "compromise
delta".
2022-02-04 15:38:07 +08:00
Po Lu
8e2d9193ef * src/xwidget.c (xwidget_button): Always let button events through.
Filtering out emulated events is done in handle_one_xevent, so
all this accomplishes is to filter out legitimate button events.
2022-02-04 15:19:18 +08:00
Po Lu
a42df6542a Fix toggling `x-gtk-use-native-input'.
* lisp/term/x-win.el (x-internal-focus-input-context):
(x-gtk-use-native-input-watcher): Update for changes to
`x-internal-focus-input-context'.

* src/xfns.c (Fx_internal_focus_input_context): New parameter
`focus'.
2022-02-04 13:13:49 +08:00
Po Lu
a654985bca Make Emacs build with some other XLib implementations
* configure.ac (HAVE_XKB): Check for functions that aren't
always implemented by various XLib implementations.

* src/xfns.c (select_visual): Handle NULL values of vinfo.
(XkbRefreshKeyboardMapping):
(XkbFreeNames):
(XDisplayCells):
(XDestroySubwindows): Define replacement functions where they
aren't available.

* src/xterm.c (x_find_modifier_meanings): Handle NULL values of
various fields.
2022-02-04 03:28:05 +00:00
Po Lu
52c4275283 * src/xfns.c (Fx_internal_focus_input_context): Fix typo. 2022-02-04 10:16:14 +08:00
Po Lu
334b362bf4 Make `x-gtk-use-native-input' take effect immediately
* lisp/term/x-win.el (x-internal-focus-input-context): New
declaration.
(x-gtk-use-native-input-watcher): New variable watcher.
* src/xfns.c (Fx_internal_focus_input_context): New function.
(syms_of_xfns): Define new subr.
2022-02-04 10:12:08 +08:00
Po Lu
748eb32cc5 Try to fix input method flicker on GTK builds
* src/xterm.c (x_focus_changed): Only focus GTK context if
native input is on.  (bug#53698)
2022-02-04 09:05:44 +08:00
Po Lu
d539d00c42 Improve image depth handling
Emacs defaults to a 32-bit TrueColor visual, but if that happens
on a display which defaults to 16-bit TrueColor, yet happens to
have 32-bit color, and doesn't have the X Render Extension, an
error will occur in x_composite_image as libXpm will load
pixmaps of depth 16 instead of depth 32.

* src/image.c (x_create_x_image_and_pixmap): Explictly specify
display depth.
(x_create_xrender_picture):
(xpm_load):
(gs_load): Use dpyinfo->n_planes instead of
DefaultDepthOfScreen.
2022-02-04 08:54:01 +08:00
Eli Zaretskii
dcc97fec29 Allow ensuring that a window's starting point is never invisible
* src/xdisp.c (syms_of_xdisp) <make-window-start-visible>: New
buffer-local variable.
(redisplay_window): If 'make-window-start-visible' is non-nil,
don't accept window-start position that is in invisible text or is
covered by a "replacing" 'display' property.  (Bug#14582)
2022-02-03 19:36:43 +02:00
Eli Zaretskii
abd59ad923 Fix "Buffers->Frames" submenu in daemon sessions
* lisp/menu-bar.el (menu-bar-update-buffers): Detect the initial
frame by its special terminal's name.  (Bug#53740)

* src/terminal.c (init_initial_terminal): Add comment about using
the initial-terminal's name in menu-bar.el.
2022-02-03 13:00:47 +02:00
Po Lu
9b0cdf461c * src/haikufont.c (haikufont_draw): Allocate string buffer on stack. 2022-02-03 10:34:50 +00:00
Po Lu
d35c4ee10a Stop creating cairo contexts in haiku_begin_cr_clip
* src/haikufont.c (haikufont_draw):
* src/ftcrfont.c (ftcrfont_draw): Stop holding the draw lock.
* src/haiku_support.cc (class EmacsView): New field
`cairo_context'.
(DetachCairoSurface): Destroy cairo_context.
(AttachCairoSurface): Create cairo_context from the surface.
(EmacsView_cairo_surface): Delete function.
(EmacsView_cairo_context): New function.
* src/haiku_support.h: Update prototypes.
* src/haikuterm.c (haiku_begin_cr_clip):
(haiku_end_cr_clip): Retrieve the existing cairo context instead
of creating a new one.
* src/haikuterm.h (FRAME_CR_CONTEXT): New macro.
2022-02-03 07:50:36 +00:00
Po Lu
fc79118f19 Obtain draw lock outside haiku_start_clip
* src/haikuterm.c (haiku_start_clip):
(haiku_end_clip): Stop obtaining the draw lock.
(haiku_draw_glyph_string): Set draw lock here instead.
2022-02-03 07:16:10 +00:00
Po Lu
3d7f17bf80 * src/haikuterm.c (haiku_draw_text_decoration): Don't lock for draws. 2022-02-03 05:21:33 +00:00
Po Lu
abdb198474 Simplify box display code on Haiku
* src/haikuterm.c (haiku_calculate_relief_colors): Remove
`rgbout_c' parameter.
(haiku_draw_relief_rect): Push state if performing additional
clipping.
(haiku_draw_string_box): Stop passing clip rects to the relief
drawing functions.
(haiku_draw_glyph_string): Fix calls to haiku_draw_string_box
for new parameters.
2022-02-03 05:16:35 +00:00
Po Lu
11ee58de9d Fix display of text decorations with defaulted foreground on Haiku
* src/haikuterm.c (haiku_draw_text_decoration): Remove parameter
`dcol' and use face->foreground instead.  All callers changed.
2022-02-03 01:57:00 +00:00
Po Lu
60fe17c958 Fix background daemon on Haiku
* src/emacs.c (DAEMON_MUST_EXEC): Define when using the Haiku
application kit.
2022-02-03 01:47:29 +00:00
Alan Mackenzie
aa795a6223 New file lisp/emacs-lisp/debug-early.el for backtraces in early bootstrap
This is also used in batch mode in general.

* lisp/debug-early.el (debug-early-backtrace, debug-early): New functions.

* lisp/loadup.el (top level): Load debug-early.el as first file.

* src/eval.c (signal_or_quit): Remove the condition in the batch mode section
of not being in dumping or bootstrap, since it is no longer needed.  Test that
'debug-early's symbol-function is bound.  Ensure there is enough working space
in specpdl and eval_depth.
(syms_of_eval): New DEFSYM for Qdebug_early.  Initialise Vdebugger to
Qdebug_early rather than Qnil.
2022-02-02 20:35:39 +00:00
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