1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-07 08:00:48 -08:00
Commit graph

46290 commits

Author SHA1 Message Date
Pieter van Prooijen
526e9758de Use gsettings font rendering entries for pgtk builds
If present, apply the gsettings font hinting and antialiasing
entries when creating a font in cairo.  Do this at
initialization and when the entries change, re-rendering the
frames.

* src/ftcrfont.c (ftcrfont_open): Use the font_options derived
from gsettings when opening a font.
(ftcrfont_cached_font_ok): Report a cached font as invalid if
its font options differ from the current options inside
gsettings.
* src/xsettings.c (apply_gsettings_font_hinting)
(apply_gsettings_font_alias, apply_gsettings_font_rgba_order):
Convert the settings from GSettings to the cairo_font_options_t
object.
(init_gsettings, something_changed_gsettingsCB): Invoke the
apply functions if the relevant settings changed.
(store_font_options_changed): Store an event to re-render the
fonts.
(xsetting_get_font_options)
* src/xsettings.h (xsettings_get_font_options): New function.
2022-05-13 20:52:02 +08:00
Po Lu
77aba69768 Rely solely on device scaling for fonts on PGTK
* src/pgtkterm.c (pgtk_get_text_scaling_factor): Delete
function.
(pgtk_term_init): Stop multiplying dpi by text scale.
(bug#55394)
2022-05-13 19:19:52 +08:00
Po Lu
dae431bf0a Fix display of image reliefs for tab bars on NS
* src/nsterm.m (ns_draw_image_relief): New function.
Synchronize code with X.
(ns_dumpglyphs_image): Use that function instead, as on X.
2022-05-13 17:08:09 +08:00
Po Lu
1a6def02cd Minor cleanups to PGTK code
* src/pgtkterm.c (pgtk_text_scaling_factor): Rename to
`pgtk_get_text_scaling_factor', clean up coding style, and fix
leak of GSettings object.
(pgtk_term_init): Clean up coding style and fix scroll
increments.
2022-05-13 16:32:10 +08:00
Po Lu
7dd4e0b72e Improve test for empty help-echo on NS menu bar items
* src/nsmenu.m ([EmacsMenu menu:willHighlightItem:]): Also check
if idx is valid.
2022-05-13 16:08:54 +08:00
Po Lu
62d2db341c Display help-echo for popup menus on NS
* src/nsmenu.m ([EmacsMenu menu:willHighlightItem:]): Display
help echo for ordinary popup menus as well.
2022-05-13 16:06:40 +08:00
Po Lu
85ac627ef4 Fix extraneous quit events processing GTK native input inside popups
* src/gtkutil.c (xg_widget_key_press_event_cb): Return
immediately if a popup is active.
* src/xterm.c (x_filter_event): Clear `xg_pending_quit_event' if
a popup is active.
2022-05-13 15:31:50 +08:00
Po Lu
1bf3afba23 Add more cursor bitmaps on Haiku
* src/haikufns.c (cursor_bitmaps, cursor_bitmaps_for_id):
Register crosshair and xterm cursors.

* src/haikugui.h (cross_ptr_bits, cross_ptrmask_bits)
(ibeam_ptr_bits, ibeam_ptrmask_bits): New cursor bitmaps.
2022-05-13 05:36:02 +00:00
Po Lu
62636ea3c1 Fix disabling frame synchronization on child frames
* src/xfns.c (Fx_create_frame): Disable GTK 3's own frame
synchronization on child frames, since the CM doesn't send
synchronization events to them.
2022-05-13 12:21:32 +08:00
Po Lu
53ed3ad594 Allow setting cursor colors for custom cursors on Haiku
* src/haikufns.c: (struct user_cursor_bitmap_info):
(cursor_bitmaps): Fix hotspot for left arrow pointer.
(cursor_bitmaps_for_id): New array.
(haiku_set_mouse_color): If a color was specified, consult
`cursor_bitmaps_for_id' for user-specified cursors.
2022-05-13 04:03:36 +00:00
Po Lu
119f613cf5 Allow actually setting cursor colors on Haiku
* src/haiku_support.cc (be_create_pixmap_cursor): New function.
* src/haiku_support.h: Update prototypes.

* src/haikufns.c (haiku_create_frame): Change default cursor
color to "font-color".
(haiku_create_tip_frame): Likewise.

(struct user_cursor_bitmap_info): New struct.
(cursor_bitmaps): New list of bitmaps corresponding to cursors.
(haiku_create_colored_cursor): New function.
(haiku_free_custom_cursors): Set current cursor to the default
cursor before freeing the original value.
(haiku_set_mouse_color): Actually recolor cursors based on
built-in bitmaps.

* src/haikuterm.c (haiku_defined_color): Clean up coding style.
2022-05-13 03:14:26 +00:00
Po Lu
6d31ac5961 Fix quitting during drag-and-drop when GTK native input is on
* src/xterm.c (x_dnd_begin_drag_and_drop): Also look in
`xg_pending_quit_event' when GTK native input is on.
2022-05-13 09:15:42 +08:00
Paul Eggert
0f731c49e6 Pacify GCC 12 in default developer build
This lets ‘./configure; make’ work on Fedora 36 x86-64 from a Git
checkout without generating false-alarm warnings.
* lib-src/etags.c (main): There appeared to be false alarm with
GCC 12.  However, the code was wrong anyway, as it mishandled file
names containing "'" so fix that bug.  This pacifies GCC.
(mercury_decl): Omit tests ‘s + pos != NULL’ that were apparently
intended to be ‘s[pos] != '\0'’ but which were miscoded to always
be true and which were mostly not needed anyway.  In one place,
though, a test was needed, so fix that by using strchr instead.
* src/alloc.c (lisp_free) [!GC_MALLOC_CHECK]:
* src/term.c (Fsuspend_tty): Don’t look at a pointer after freeing
it, even just to test it for equality with some other pointer, as
this has undefined behavior in C and GCC 12 diagnoses this.
* src/dbusbind.c (xd_read_message_1): Rework the code a bit
so that it has fewer tests.  This pacifies GCC 12 which was
complaining incorrectly about dereferencing a null pointer.
* src/intervals.c (copy_properties): Remove an eassume that should
no longer be needed even to pacify older GCCs, due to ...
* src/intervals.h (split_interval_left): ... this addition of
ATTRIBUTE_RETURNS_NONNULL to pacify a GCC 12 warning about
dereferencing a null pointer.
* src/regex-emacs.c (EXTEND_BUFFER): Use negative values rather
than auxiliary booleans to indicate null pointers.  This pacifies
GCC 12 false alarms about using uninitialized variables.
* src/xdisp.c (clear_position): New function.
(append_space_for_newline, extend_face_to_end_of_line):
Use it to work around false alarms from GCC 12.
(display_and_set_cursor): Add an UNINIT to pacify GCC 12.
* src/xterm.c (x_draw_glyphless_glyph_string_foreground):
Defend against hypothetical bad code elsewhere;
this also pacifies GCC 12.
(x_term_init): Use fixed-size auto array rather than alloca,
as the array is small; this also pacifies GCC 12.
2022-05-12 17:03:55 -07:00
Po Lu
c8d7a27438 Remove unused RIF method
* src/haikuterm.c (haiku_update_window_end): Delete function.
(haiku_redisplay_interface): Remove RIF method.
2022-05-12 13:08:44 +00:00
Po Lu
b6aff96a74 Fix build on Mac OS X 10.11
* src/nsterm.h (NSButtonTypeMomentaryPushIn): New define.
2022-05-12 17:23:45 +08:00
Po Lu
89c6e412dd Fix searching the bitmap file path on Haiku
* src/image.c (image_create_bitmap_from_file): [HAVE_HAIKU]:
Look for the bitmap inside `x-bitmap-file-path' as well.
2022-05-12 07:42:33 +00:00
Stefan Kangas
0e5623b491 ; * src/bytecode.c (exec_byte_code): Fix white space. 2022-05-12 09:32:10 +02:00
Po Lu
a4a229dfff Fix merging of anonymous faces with an `:extend' property on unexec
* src/emacs.c (main): Unconditionally call `init_xfaces'.
* src/lisp.h: Enable `init_xfaces' on unexec builds too.
* src/xfaces.c (init_xfaces): Move fix for bug#34226 into
pdumper-specific section leaving the initialization of
`face_attr_sym' intact.
2022-05-12 14:56:32 +08:00
Eli Zaretskii
7d0d87ec51 ; Improve documentation of 'restore-buffer-modified-p'
* src/buffer.c (Frestore_buffer_modified_p):
* doc/lispref/buffers.texi (Buffer Modification): Fix doc wording.
2022-05-12 09:47:25 +03:00
Po Lu
ec1a14ab33 Make cursor display on Haiku consistent with X
* src/haikuterm.c (haiku_draw_image_glyph_string): Merge cursor
foregrounds correctly.
(haiku_draw_hollow_cursor, haiku_draw_bar_cursor): New
functions.  Port code from X.
(haiku_draw_window_cursor): Port code from X so bar cursors on
top of images are treated right.
2022-05-12 04:11:32 +00:00
Po Lu
2e2efe7722 Clean up Haiku display opening code
* src/haikufns.c (Fx_open_connection):
(Fhaiku_frame_list_z_order): Improve error messages and fix
coding style.
2022-05-12 02:29:43 +00:00
Po Lu
2dc996a95d Port some stuff to XCB to avoid confusing Xlib behavior
* src/xterm.c (x_set_frame_alpha, handle_one_xevent): Port
retrieving the opacity property to XCB.
2022-05-12 09:37:33 +08:00
Po Lu
69d3a84c83 Only handle SelectionRequest events from the DND display during DND
* src/xterm.c (handle_one_xevent): Handle only SelectionRequest
events from the DND frame's display via hold_quit.
2022-05-12 09:11:52 +08:00
Lars Ingebrigtsen
1642a5ffcd Adjust restore-buffer-modified-p autosaved logic
* doc/lispref/buffers.texi (Buffer Modification): Adjust
documentation.

* src/buffer.c (Frestore_buffer_modified_p): Fix up the logic
around `autosaved': It means "the buffer is modified, and also
autosaved".
2022-05-12 02:16:38 +02:00
Paul Eggert
4f27e4ff02 functionp doc improvement
* doc/lispref/eval.texi, doc/lispref/functions.texi, src/eval.c:
Document functionp a bit more carefully.  It can return t
on non-functions.
2022-05-11 10:18:12 -07:00
Po Lu
5079f42446 Add support for changing pointer types on Haiku
* doc/lispref/frames.texi (Pointer Shape): Document that the
pointer shape can now be changed on some window systems other
than X.

* lisp/term/haiku-win.el (x-pointer-X-cursor, x-pointer-arrow)
(x-pointer-bottom-left-corner, x-pointer-bottom-right-corner)
(x-pointer-bottom-side, x-pointer-clock, x-pointer-cross)
(x-pointer-cross-reverse, x-pointer-crosshair)
(x-pointer-diamond-cross, x-pointer-hand1, x-pointer-hand2)
(x-pointer-left-side, x-pointer-right-side)
(x-pointer-sb-down-arrow, x-pointer-sb-left-arrow)
(x-pointer-sb-right-arrow, x-pointer-sb-up-arrow, x-pointer-target)
(x-pointer-top-left-corner, x-pointer-top-right-corner)
(x-pointer-top-side, x-pointer-watch, x-pointer-invisible): New
pointer constants.

* src/haiku_support.cc (BCursor_from_id): Accept int instead of
enum.
* src/haiku_support.h: Update prototypes.

* src/haikufns.c (haiku_create_frame): Stop manually assigning
cursors and set default value of the mouse color property.
(haiku_free_frame_resources): Free custom cursors too.
(struct user_cursor_info, INIT_USER_CURSOR): New struct.
(haiku_free_custom_cursors): New function.
(haiku_set_mouse_color): New param handler.
(haiku_frame_parm_handlers): Add param handler.
(syms_of_haikufns): New cursor shape variables from X.

* src/haikuterm.h: Update prototypes.
2022-05-11 12:40:53 +00:00
Mattias Engdegård
14fe0eec0c * src/lisp.h (FOR_EACH_TAIL_INTERNAL): Faster node comparison. 2022-05-11 10:28:07 +02:00
Po Lu
95717db1e8 Fix mouse pointer avoidance in some configurations
* lisp/avoid.el (mouse-avoidance-random-shape): Ignore invisible
pointer.
(mouse-avoidance-ignore-p): Adjust for interprogram DND.
* lisp/term/x-win.el (x-pointer-invisible): Make value larger
than the maximum possible glyph.

* src/xfns.c (x_set_mouse_color): Use function that handles
`x-pointer-invisible' too.
* src/xterm.c (x_create_font_cursor): New function.  Handle
invisible cursors.
* src/xterm.h: Update prototypes.
2022-05-11 16:01:52 +08:00
Po Lu
96be8458b0 Make Haiku event buffer non-static
* src/haikuterm.c (haiku_read_socket): Don't make `buf' static
in case thread yielding happens inside.
2022-05-11 06:59:39 +00:00
Po Lu
70c4b5bdc6 Fix event memory leak on Haiku
* src/haikuterm.c (haiku_read_socket): Allocate event buffer on
the stack.
2022-05-11 06:56:43 +00:00
Po Lu
80951f764b Fix frame invalidation on Haiku
* src/haiku_support.cc (FlipBuffers): Only set view bitmap if it
actually changed.

* src/haikuterm.c (haiku_clip_to_string_exactly)
(haiku_draw_window_cursor, haiku_draw_fringe_bitmap): Fix region
invalidation.
2022-05-11 03:48:36 +00:00
Po Lu
7360813208 Try to preserve font styles in the Haiku font dialog
* haiku_support.cc (class EmacsFontSelectionDialog)
(UpdateStylesForIndex): If a style was previously selected and
exists in the new family as well, select it after adding the new
items.
2022-05-11 02:02:21 +00:00
Po Lu
a78a5b1346 Make reliefs on Haiku more like X
* src/haikuterm.c (haiku_draw_relief_rect): Use frame background
(normal GC) for corners.
2022-05-11 01:21:18 +00:00
Po Lu
a09fc82748 ; * src/window.c (Fset_window_vscroll): Fix doc string. 2022-05-11 09:13:36 +08:00
Po Lu
8baa13ed99 Clean up some MAYBE_UNUSED functions
* src/xterm.c (x_clear_area1): Wrap in the conditions where it
will actually be used.
2022-05-11 09:09:05 +08:00
Paul Eggert
430b5ba838 * src/eval.c (Ffunctionp): Clarify "function" in doc string. 2022-05-10 15:21:57 -07:00
Paul Eggert
4433df3b20 * src/floatfns.c: Update comment. 2022-05-10 14:47:22 -07:00
Po Lu
cfa317fa92 Improve display of relief rectangles on NS
* src/nsterm.m (ns_draw_relief): Respect cursor color and draw
corners like X.
2022-05-10 21:34:44 +08:00
Po Lu
77bf4ca000 Respect `alpha-background' drawing relief corners
* src/xterm.c (x_draw_relief_rect): Respect background alpha for
corner rects.
2022-05-10 21:08:15 +08:00
Eli Zaretskii
68dd94448f ; Fix recent documentation changes
* src/fileio.c (Fdo_auto_save):
* src/buffer.c (Fbuffer_modified_p, Frestore_buffer_modified_p):
* doc/lispref/buffers.texi (Buffer Modification): Improve
documentation of 'do-auto-save', 'buffer-modified-p' and
'restore-buffer-modified-p'.
2022-05-10 16:06:10 +03:00
Po Lu
145727df29 Fix display of depressed buttons
* src/xterm.c (x_draw_relief_rect): Fix typo.
2022-05-10 17:38:53 +08:00
Po Lu
773c5c00d2 Improve relief rect handling on Haiku
* haikuterm.c (haiku_calculate_relief_colors): Calculate
backgrounds for image glyphs like on X.
(haiku_draw_relief_rect): Remove extra parameter.
(haiku_draw_string_box, haiku_draw_image_relief): Adjust
accordingly.
2022-05-10 09:00:39 +00:00
Po Lu
e8d643eb83 Fix X11 relief background clearning when hwidth is larger than vwidth
* src/xterm.c (x_fill_triangle, x_make_point, x_inside_rect_p):
New functions.
(x_draw_relief_rect): Complete rewrite.  Use more sensible
primitives.
2022-05-10 16:50:10 +08:00
Po Lu
c7b48b61d0 Improve display of reliefs on NS
* src/nsfont.m (nsfont_draw): Don't compensate for left box
twice.
* src/nsterm.m (ns_draw_relief): Draw outer edges of box like on
X.
2022-05-10 16:01:00 +08:00
Po Lu
88545428f0 Handle deletion of opacity property too
* src/xterm.c (handle_one_xevent): Clear `alpha' frame parameter
when opacity prop is gone or invalid.
2022-05-10 14:40:26 +08:00
Po Lu
58f6cbeb58 Work around some broken programs when reading opacity prop
* src/xterm.c (handle_one_xevent): Accept some other types that
property is set to by thoughtless programs.
2022-05-10 14:38:53 +08:00
Po Lu
3c5e1f8ec8 Simplify Haiku selection code
* src/haiku_select.cc (get_clipboard_object): New function.
(BClipboard_find_data, BClipboard_get_targets, BClipboard_set_data)
(BClipboard_find_system_data)
(BClipboard_find_primary_selection_data)
(BClipboard_find_secondary_selection_data)
(BClipboard_set_system_data, BClipboard_set_primary_selection_data)
(BClipboard_set_secondary_selection_data, BClipboard_free_data)
(BClipboard_system_targets, BClipboard_primary_targets)
(BClipboard_secondary_targets): Delete functions.
(be_find_clipboard_data_1, be_set_clipboard_data_1)
(be_get_clipboard_targets_1, be_find_clipboard_data)
(be_set_clipboard_data, be_get_clipboard_targets): New
functions.
(be_lock_clipboard_message, be_unlock_clipboard): Use
`get_clipboard_object' to get clipboard from ID.

* src/haikuselect.c (haiku_get_clipboard_name): New function.
(Fhaiku_selection_data, Fhaiku_selection_put)
(Fhaiku_selection_owner_p): Adjust to use new simplified
functions.

* src/haikuselect.h: Update prototypes.
2022-05-10 04:11:48 +00:00
Po Lu
20b27d475f Simplify XDND code
* src/xfns.c (Fx_begin_drag): Use SAFE_ALLOCA_STRING and encode
strings in the right coding system.
2022-05-10 10:39:13 +08:00
Sean Whitton
054062060e Factor out *scratch* initialization
* lisp/simple.el (get-scratch-buffer-create): New function, factored
out of scratch-buffer, and additionally clearing the modification flag
and calling substitute-command-keys (bug#55257).
(scratch-buffer):
* lisp/server.el (server-execute):
* lisp/startup.el (normal-no-mouse-startup-screen, command-line-1):
* lisp/window.el (last-buffer, window-normalize-buffer-to-switch-to):
* src/buffer.c (Fother_buffer, other_buffer_safely): Use it.
(syms_of_buffer): Add Qget_scratch_buffer_create.
* lisp/startup.el (startup--get-buffer-create-scratch): Delete
now-unused function.
* doc/lispref/os.texi (Summary: Sequence of Actions at Startup):
* NEWS (Incompatible changes in Emacs 29.1): Document the change.
2022-05-09 18:49:13 -07:00
Lars Ingebrigtsen
0bee4cda88 Reimplement recent with-silent-modifications auto-save changes
* doc/lispref/buffers.texi (Buffer Modification): Document
buffer-modified-p returning `autosaved'.
* lisp/subr.el (with-silent-modifications): Use
restore-buffer-modified-p instead of altering the buffer modiff
(since this has other side effects like not updating after async
`display' changes.

* src/buffer.c (Fbuffer_modified_p): Allow returning whether the
buffer has been autosaved after changes.
(Frestore_buffer_modified_p): Allow adjusting whether the buffer
has been autosaved after changes.

* src/fileio.c (Fdo_auto_save): Refill the doc string.
2022-05-10 03:46:43 +02:00