1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-27 09:11:48 -07:00
Commit graph

45374 commits

Author SHA1 Message Date
Mattias Engdegård
6f3c62ff07 Pin lazily read bytecode (bug#53809)
* src/eval.c (Ffetch_bytecode): Bytecode strings read lazily weren't
pinned as they must be.  Do so.

Bug reported by Gregor Zattler.
2022-02-07 18:18:32 +01:00
Po Lu
30d92721ce Correct off-by-one errors with frame resizing on Haiku
* src/haiku_support.cc (UnZoom):
(MakeFullscreen):
(BWindow_resize): Fix off-by-one errors in calls to
`BWindow::ResizeTo'.
2022-02-07 09:43:26 +00:00
Po Lu
b432fb6c86 Make menus work better on X toolkit builds with XInput 2
* src/xmenu.c (popup_get_selection): Translate some important
XI2 events into events the toolkit can understand.
(x_activate_menubar):
(create_and_show_popup_menu): Clear grab regardless of reported
status on Motif.
* src/xterm.c (xi_device_from_id): Export function.
* src/xterm.h: Update prototypes.
2022-02-07 17:15:53 +08:00
Po Lu
61a5bbc683 Really fix extended frame synchronization
* src/xterm.c (XTframe_up_to_date): Make sure the extended
counter ends up even.
2022-02-07 14:59:06 +08:00
Po Lu
ab5b2e63fa Respect `x-cursor-fore-pixel' on Haiku
* src/haikufns.c (haiku_set_cursor_color): Respect
`x-cursor-fore-pixel'.
(syms_of_haikufns): Declare variable `x-cursor-fore-pixel'.
2022-02-07 03:00:25 +00:00
Po Lu
e9217d0f34 Clean up more code from PGTK port
* lisp/term/pgtk-win.el (pgtk-disown-selection-internal)
(pgtk-get-selection-internal): Fix declarations for new calling
conventions.
* src/gtkutil.c (xg_frame_set_char_size, x_wm_set_size_hint):
Clean up meaningless variables on PGTK.
* src/pgtkfns.c (Fx_create_frame, syms_of_pgtkfns): Clean up
meaningless variables and fix copied doc strings to use "skip".
* src/pgtkim.c (im_context_commit_cb)
(im_context_retrieve_surrounding_cb)
(im_context_delete_surrounding_cb, make_color_string)
(im_context_preedit_changed_cb, im_context_preedit_end_cb)
(im_context_preedit_start_cb): Fix coding style.
* src/pgtkselect.c (pgtk_selection_usable)
(Fpgtk_disown_selection_internal, Fpgtk_get_selection_internal):
Remove unused arguments.
(syms_of_pgtkselect): Fix doc strings and old style variable
declarations.
* src/pgtkterm.c (x_set_offset, x_set_parent_frame)
(syms_of_pgtkterm): Clean up doc strings and remove meaningless
variables.
2022-02-07 10:38:15 +08:00
Po Lu
011fa3a4cb Correct implementation of extended frame synchronization
* src/xterm.c (handle_one_xevent): Use value provided in the
extended synchronization message as the current counter value.
2022-02-07 09:42:08 +08:00
Lars Ingebrigtsen
0d36eaa7c6 Make async connect_network_socket failures use Qfailed
* src/process.c (connect_network_socket): Mark the process as
Qfailed instead of using the error symbol (since this is what's
defined for the status) (bug#53814).
2022-02-07 00:26:25 +01:00
Mattias Engdegård
1850121629 Avoid deprecation warning in NS-specific code
* src/macfont.m (mac_font_create_preferred_family_for_attributes):
CTGetCoreTextVersion is obsolete and its use elicits a warning
in macOS 11.6; use NSProcessInfo instead.
2022-02-06 17:58:54 +01:00
Mattias Engdegård
ead36d8d36 ; * src/alloc.c (mark_memory): Fix outdated comment. 2022-02-06 17:57:46 +01:00
Po Lu
b0fd3ec2c0 Ensure bar cursors are always visible on Haiku
* src/haikuterm.c (haiku_draw_window_cursor): Adjust bar cursor
colors like X.
2022-02-06 13:08:06 +00:00
Po Lu
dc5930ba97 Fix the GTK 2 build
* src/gtkutil.c (xg_filter_key): Remove call to GTK3-only
function without GTK 3.
* src/xfns.c (select_visual): Avoid 32-bit visuals on GTK 2.
2022-02-06 20:10:46 +08:00
Po Lu
3775156990 Disable extended frame synchronization by default
* doc/emacs/xresources.texi (Table of Resources): Document
new possible value of `synchronizeResize'.
* src/xfns.c (Fx_create_frame): Set synchronization protocol
according to `synchronizeResize'.
2022-02-06 19:51:05 +08:00
Po Lu
30c6074d5a Add support for EWMH extended frame synchronization
* src/xfns.c (Fx_create_frame): Populate both counter variables.
* src/xterm.c (XTframe_up_to_date):
(handle_one_xevent): Support extended synchronization.
(x_free_frame_resources): Destroy extended counter.
(x_term_init): Intern new atom _NET_WM_FRAME_DRAWN.

* src/xterm.h (struct x_display_info): New atom
`_NET_WM_FRAME_DRAWN'.
(struct x_output): New fields for extended counter tracking.
(FRAME_X_EXTENDED_COUNTER): New macro.
2022-02-06 18:59:00 +08:00
Eli Zaretskii
47ddaaab02 Fix infloop in 'redisplay_window' when buffer is narrowed
* src/xdisp.c (redisplay_window): Ensure window-start point is in
the accessible portion of the buffer when passing it to
'window_start_acceptable_p'.  (Bug#14582)
2022-02-06 12:26:36 +02:00
Po Lu
a645c3bee7 ; * src/xfns.c (x_encode_text): Fix comment. 2022-02-06 11:30:22 +08:00
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