<feed xmlns='http://www.w3.org/2005/Atom'>
<title>chemacs.git/src/xterm.c, branch devmain</title>
<subtitle>emacs
</subtitle>
<id>http://cgit.adnoto.dev/chemacs.git/atom?h=devmain</id>
<link rel='self' href='http://cgit.adnoto.dev/chemacs.git/atom?h=devmain'/>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chemacs.git/'/>
<updated>2026-06-04T03:42:19Z</updated>
<entry>
<title>Avoid background fills on parent during child frame resize/move/hide</title>
<updated>2026-06-04T03:42:19Z</updated>
<author>
<name>Dmitry Gutov</name>
<email>dmitry@gutov.dev</email>
</author>
<published>2026-05-11T02:51:49Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chemacs.git/commit/?id=c9dfe2abe6339c7b48a9f62c7843d8c75ce7e644'/>
<id>urn:sha1:c9dfe2abe6339c7b48a9f62c7843d8c75ce7e644</id>
<content type='text'>
* src/xterm.c (x_suspend_background_fills)
(x_restore_background_fills): New functions.
(x_set_window_size, x_set_window_size_and_position)
(x_make_frame_invisible): Use them (bug#80961).
</content>
</entry>
<entry>
<title>ARRAYELTS → countof</title>
<updated>2026-05-27T04:57:20Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2026-05-27T00:51:44Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chemacs.git/commit/?id=225876e97999664a075eb6f1489b4b4c8e515ded'/>
<id>urn:sha1:225876e97999664a075eb6f1489b4b4c8e515ded</id>
<content type='text'>
C2y will standardize countof as the macro that Emacs uses the name
ARRAYELTS for.  Switch to the standard name, which is supported
by GCC 16+, by Clang 21, and by the Gnulib stdcountof-h module already
in use for compilers that do not support countof.
Also, use countof in a few places where we missed using ARRAYELTS.
* admin/coccinelle/arrayelts.cocci: Suggest countof, not ARRAYELTS.
* admin/merge-gnulib (GNULIB_MODULES): Add stdcountof-h,
as it is now a direct rather than an indirect dependency.
* exec/trace.c, src/lisp.h, src/sfnt.c: Include &lt;stdcountof.h&gt;.
(ARRAYELTS): Remove.  All uses replaced by countof.
* lib-src/ebrowse.c, lib-src/etags.c, lib-src/make-docfile.c:
* lib-src/seccomp-filter.c, lwlib/lwlib-Xaw.c:
Prefer &lt;stdcountof.h&gt; and countof to doing things by hand.
</content>
</entry>
<entry>
<title>Omit useless casts found by GCC 16</title>
<updated>2026-05-27T04:57:19Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2026-05-27T00:51:44Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chemacs.git/commit/?id=5d8bb14d3b90513ed1a849ebbafb82a7734d9c8c'/>
<id>urn:sha1:5d8bb14d3b90513ed1a849ebbafb82a7734d9c8c</id>
<content type='text'>
GCC 16’s -Wuseless-cast warning can be useful.
Fix the useless casts it identifies, and also fix false positives
by using compound literals, which are safer anyway than casts.
* src/composite.c (composition_adjust_point)
(Ffind_composition_internal):
* lwlib/xlwmenu.c (xlwMenuResources, xlwMenuClassRec)
(resource_widget_value, XlwMenuDestroy, Select):
* src/alloc.c (process_mark_stack):
* src/data.c (Faref):
* src/emacs-module.c (module_extract_big_integer):
* src/fileio.c (Finsert_file_contents):
* src/frame.h (FRAME_MESSAGE_BUF_SIZE):
* src/gtkutil.c (xg_tool_item_stale_p, update_frame_tool_bar):
* src/image.c (pbm_load, png_load_body, jpeg_load_body)
(tiff_load, gif_load):
* src/pdumper.c (ptrdiff_t_to_dump_off, dump_queue_dequeue)
(field_relpos, dump_field_emacs_ptr)
(dump_object_start_pseudovector, pdumper_remember_scalar_impl)
(pdumper_load, syms_of_pdumper):
* src/regex-emacs.c (BUF_PUSH, BUF_PUSH_2, POINTER_TO_OFFSET):
* src/xdisp.c (remember_mouse_glyph, pint2str):
* src/xterm.c (cvt_string_to_pixel, handle_one_xevent):
Omit useless casts.  Perhaps they were formerly needed,
but they should not be needed now.
* src/alloc.c (Fmemory_info):
* src/category.c (Fdefine_category, Fmodify_category_entry):
* src/data.c (Fash):
* src/dispextern.h (GLYPH_CODE_P):
* src/emacs.c (load_seccomp):
* src/fns.c (Flocale_info, maybe_resize_hash_table):
* src/indent.c (check_display_width):
* src/json.c (symset_size):
* src/lisp.h (XUNTAG, BOOL_VECTOR_LENGTH_MAX, obarray_size)
(hash_table_index_size):
* src/lread.c (make_obarray, grow_obarray, Fobarray_clear):
* src/menu.c (digest_single_submenu, x_popup_menu_1):
* src/term.c (init_tty):
* src/widget.c (update_wm_hints):
* src/xdisp.c (truncate_echo_area):
* src/xfns.c (x_set_border_pixel):
* src/xfont.c (xfont_match, xfont_open):
* src/xmenu.c (set_frame_menubar):
* test/src/emacs-module-resources/mod-test.c (emacs_module_init):
Use compound literal instead of a cast that is useless in
some platforms but not others.
* src/dispextern.h, src/haikugui.h, src/w32gui.h:
(WINDOW_HANDLE_UINTPTR): New macro.
* src/frame.c (gui_report_frame_params):
* src/xterm.c (x_try_cr_xlib_drawable):
Use it.
* src/lisp.h (XUNTAG): And tag with UINTPTR_MAX to pacify
gcc warning about a constant out of range.
(hash_idx_t): Make it int_least32_t, as it need not be exactly 32 bits.
(PRIdHASH_IDX): New macro.
* src/pdumper.c (dump_queue_dequeue): Use it.
* src/profiler.c (setup_cpu_timer): Make a local EMACS_INT
rather than int, to avoid need for casting later.
* src/syntax.c (uninitialized_interval):
Use 1u rather than 1 so the cast is always useful.
A compound literal wouldn’t do here, as this macro
needs to be an integer constant expression.
* src/xfns.c (XICCallback, XICProc): Remove macros.
(Xxic_preedit_start_callback): Use a cleaner way to specify it,
avoiding the need for type macros, and for a cast
if HAVE_XICCALLBACK_CALLBACK.
* src/xterm.c (handle_one_xevent): 2nd arg is now XEvent *
on all platforms, as there is no need to diverge, and
diverging meant we needed lots of unnecessary casts.
</content>
</entry>
<entry>
<title>Be more careful about size multiplication</title>
<updated>2026-05-24T02:18:53Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2026-05-22T00:13:42Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chemacs.git/commit/?id=64eb869b68835e15b46a217a6d955605b78044bc'/>
<id>urn:sha1:64eb869b68835e15b46a217a6d955605b78044bc</id>
<content type='text'>
* src/alloc.c (xcalloc): New function.
* src/dispnew.c (save_current_matrix):
* src/fns.c (Finternal__hash_table_histogram):
* src/nsfns.m (Fns_display_monitor_attributes_list):
* src/pgtkfns.c (Fpgtk_display_monitor_attributes_list):
* src/pgtkselect.c (pgtk_own_selection):
* src/profiler.c (make_log):
* src/sfnt.c (sfnt_poly_edges_exact):
* src/xfns.c (x_get_monitor_attributes_xinerama)
(x_get_monitor_attributes_xrandr, Fx_display_monitor_attributes_list):
Use it instead of multiplying by hand, conceivably with overflow.
* src/profiler.c (make_log):
Check for overflow in internal size calculations.
Use xnmalloc instead of multiply + xmalloc.
* src/sfnt.c (xzalloc) [TEST]: Remove, replacing with ...
(xicalloc) [TEST]: ... this new function.  All callers changed.
(eassert) [TEST]: New macro.
* src/treesit.c (treesit_calloc_wrapper): Remove, replacing its
use with xcalloc.
</content>
</entry>
<entry>
<title>Fix misleading x_dnd_begin_drag_and_drop API</title>
<updated>2026-05-24T02:18:53Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2026-05-20T16:24:19Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chemacs.git/commit/?id=b1d338d89ae1e6484306e0ba7c32bd4163b3b54d'/>
<id>urn:sha1:b1d338d89ae1e6484306e0ba7c32bd4163b3b54d</id>
<content type='text'>
* src/xterm.c (x_dnd_begin_drag_and_drop): The n_ask_actions arg
is an int, not a size_t, as XChangeProperty supports only int and
our caller passes an int.
</content>
</entry>
<entry>
<title>New function memory_full_up</title>
<updated>2026-05-24T02:18:52Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2026-05-20T01:39:09Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chemacs.git/commit/?id=1eb2e052bb55184d62c1dec265f6d327be4e9113'/>
<id>urn:sha1:1eb2e052bb55184d62c1dec265f6d327be4e9113</id>
<content type='text'>
* src/alloc.c (memory_full_up): New function.  Replace all callers
of memory_full (SIZE_MAX) with callers to this function.
This simplifies callers and should make future changes easier.
It also saves a whopping 296 bytes in executable size
with gcc 16.1.1 20260515 (Red Hat 16.1.1-2) x86-64.
</content>
</entry>
<entry>
<title>Make X_ERROR_MESSAGE_SIZE dependency more explicit</title>
<updated>2026-05-19T18:54:26Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2026-05-19T17:21:56Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chemacs.git/commit/?id=a8b9fad89720847a869bf288eb41473b6c82b833'/>
<id>urn:sha1:a8b9fad89720847a869bf288eb41473b6c82b833</id>
<content type='text'>
This avoids an alloca in x_set_mouse_color.
* src/xfns.c (x_set_mouse_color): Use local array rather than
alloca, since the string is small.
* src/xterm.c (X_ERROR_MESSAGE_SIZE): Move defn from here ...
* src/xterm.h: ... to here, and make it an enum not a macro.
</content>
</entry>
<entry>
<title>[GTK3] On Expose, repaint the border before the content</title>
<updated>2026-05-10T23:03:30Z</updated>
<author>
<name>Dmitry Gutov</name>
<email>dmitry@gutov.dev</email>
</author>
<published>2026-05-10T23:03:30Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chemacs.git/commit/?id=acc07f1a0301e4e797728c170e652290d0721927'/>
<id>urn:sha1:acc07f1a0301e4e797728c170e652290d0721927</id>
<content type='text'>
* src/xterm.c (handle_one_xevent): Move the
x_clear_under_internal_border call before expose_frame, for less
chance of implicit flush to screen in between (bug#80662).
</content>
</entry>
<entry>
<title>[GTK3] Move the frame to position before showing</title>
<updated>2026-05-07T03:27:27Z</updated>
<author>
<name>Dmitry Gutov</name>
<email>dmitry@gutov.dev</email>
</author>
<published>2026-05-07T01:00:54Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chemacs.git/commit/?id=f20e3e473d10501ca9bc9f232ac7a0fd24ca72de'/>
<id>urn:sha1:f20e3e473d10501ca9bc9f232ac7a0fd24ca72de</id>
<content type='text'>
* src/xterm.c (x_make_frame_visible): Move XMoveWindow call before
gtk_widget_show_all, so that the move happens before the frame
become visible (bug#80662).
</content>
</entry>
<entry>
<title>Fix flicker of child frame right after make-frame-visible</title>
<updated>2026-05-06T01:31:50Z</updated>
<author>
<name>Dmitry Gutov</name>
<email>dmitry@gutov.dev</email>
</author>
<published>2026-05-06T01:31:22Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chemacs.git/commit/?id=14f17722aaf34f4a7cf27981be98d0779cf3f72b'/>
<id>urn:sha1:14f17722aaf34f4a7cf27981be98d0779cf3f72b</id>
<content type='text'>
* src/xterm.c (x_make_frame_visible): Call SET_FRAME_GARBAGED
before making a child frame visible (bug#80943).
</content>
</entry>
</feed>
