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

46136 commits

Author SHA1 Message Date
Lars Ingebrigtsen
0ea0aa255c Fix Vx_show_tooltip_timeout in ns build, too
* src/nsfns.m (Fx_show_tip): Respect Vx_show_tooltip_timeout here,
too.
2022-04-30 18:21:51 +02:00
Lars Ingebrigtsen
52e6352b81 Fix compilation after recent x-show-tooltip-timeout changes
* src/dispnew.c (syms_of_display): Move x-show-tooltip-timeout to
a common file to avoid breaking other systems.
2022-04-30 18:20:19 +02:00
Lars Ingebrigtsen
655d2319bc Use x-show-tooltip-timeout in all the implementations
* src/haikufns.c (Fx_show_tip): Use the timeout variable.
* src/pgtkfns.c (Fx_show_tip): Ditto.

* src/w32fns.c (Fx_show_tip): Ditto.

* src/xfns.c (Fx_show_tip): Doc fix.
2022-04-30 17:38:34 +02:00
Lars Ingebrigtsen
86b6a69f86 Don't hard code the default x-show-tip timeout
* src/xfns.c (Fx_show_tip): Use it.
(syms_of_xfns): Add a new x-show-tooltip-timeout variable
(bug#23341).
2022-04-30 17:09:02 +02:00
Po Lu
2a2b3f5834 Fix some cases of flicker on MS Windows
* src/w32term.c (w32_read_socket): Fix typo in check before
flipping buffers.
2022-04-30 19:03:09 +08:00
Po Lu
57447f5ce0 Fix display updating inside the minibuffer on MS Windows
* src/minibuf.c (read_minibuf): Call `w32_flip_buffers_if_dirty'
after changing the cursor position and redisplaying instead of
`flush_frame'.  (bug#55193)

* src/w32term.c (w32_flip_buffers_if_dirty): New function.
* src/w32term.h: Update prototypes.
2022-04-30 18:54:34 +08:00
Po Lu
5fd5472353 Avoid server roundtrip on wheel events from scroll bars on XI2
* src/xterm.c (handle_one_xevent): Translate coordinates for
scroll bars correctly when handling XI2 wheel events.
2022-04-30 18:05:44 +08:00
Eli Zaretskii
7b7a124afa ; * src/w32term.c (w32_read_socket): Add comment for recent change. 2022-04-30 12:35:48 +03:00
Eli Zaretskii
03561b4aad ; Minor fixes of documentation of double-buffering on MS-Windows
* etc/NEWS: Improve and expand wording of the entry about
double-buffering on MS-Windows.

* src/w32fns.c (w32_set_inhibit_double_buffering): Fix commentary.
2022-04-30 12:00:33 +03:00
Po Lu
08c6e699f6 Process editres events not for frames correctly
* src/xterm.c (handle_one_xevent): Dispatch Editres events to
interested widgets.
2022-04-30 15:58:33 +08:00
Po Lu
1321b5989c Adjustments to double buffering on MS Windows
* src/w32fns.c (w32_set_inhibit_double_buffering): Add comment
describing double buffering.
(w32_wnd_proc): Respect `w32-disable-double-buffering'.
(globals_of_w32fns): New variable
`w32-disable-double-buffering'.

* src/w32term.c (w32_show_back_buffer): Return immediately if
double buffering is disabled on the frame.
(w32_scroll_run): Use old scrolling code if
`w32-disable-double-buffering' is enabled.
(w32_scroll_bar_clear): Document why we don't clear scroll bars
when double buffering is enabled.
(w32_read_socket): Respect `w32-disable-double-buffering' and
clean up some code.

* src/w32xfns.c (get_frame_dc): Respect
`w32-disable-double-buffering'.
2022-04-30 15:52:12 +08:00
Po Lu
0ce48e2882 Handle exposure in the widget's expose proc on X
* src/widget.c (emacsFrameClassRec): Don't inherit expose proc.
(get_default_char_pixel_size):
(pixel_to_char_size):
(char_to_pixel_size):
(round_size_to_char):
(EmacsFrameInitialize):
(EmacsFrameRealize):
(EmacsFrameResize): Clean up coding style.
(EmacsFrameExpose): New function.  Expose the frame here to
satisfy the toolkit when it calls the expose proc by hand.

* src/xterm.c (handle_one_xevent): Handle exposure through the
widget instead.
2022-04-30 14:29:33 +08:00
Po Lu
4fb028be6c Fix releasing the mouse on top of the tool bar on MS Windows
* src/w32term.c (w32_read_socket): Don't handle tool bar clicks
specially for button up events if no tool bar item was
previously pressed.
2022-04-30 13:26:40 +08:00
Po Lu
402c90c912 Fix palette freeing on MS Windows with double buffering
* src/w32term.c (w32_release_paint_buffer): Also release target
DC palette.
2022-04-30 11:33:38 +08:00
Po Lu
bc44455f77 Implement double buffering on MS Windows
* etc/NEWS: Announce changes.
* src/w32fns.c (w32_set_inhibit_double_buffering): New function.
(w32_wnd_proc):
(Fx_create_frame):
(w32_create_tip_frame): Set `inhibit-double-buffering' parameter.
(w32_frame_parm_handlers): Add new handler.

* src/w32term.c (w32_show_back_buffer):
(w32_release_paint_buffer): New functions.
(w32_frame_up_to_date): Show back buffer if applicable.
(w32_buffer_flipping_unblocked_hook): New hook.
(w32_scroll_run): Use BitBlt to scroll instead of window
scrolling functions.
(w32_scroll_bar_clear): Don't clear scroll bars when double
buffered.
(w32_read_socket): Flip buffers after reading input events in
some cases.
(w32_free_frame_resources): Free back buffer.
(w32_create_terminal): Add new hook.

* src/w32term.h (struct w32_output): New fields for handling
back buffers.
* src/w32xfns.c (select_palette): Fix indentation.
(get_frame_dc, release_frame_dc): Return back buffer when
appropriate and set dirty flag.
2022-04-30 11:20:46 +08:00
Po Lu
a33bf01149 Prevent cursors from being set on tooltip frames on Haiku
* src/haikuterm.c (haiku_show_hourglass, haiku_hide_hourglass)
(haiku_define_frame_cursor, haiku_toggle_invisible_pointer):
Ignore tooltip frames.  Otherwise, the cursor changes every time
a tooltip is mapped.
2022-04-30 02:34:35 +00:00
Stefan Monnier
73088b30cf * lisp/emacs-lisp/cl-preloaded.el (cl--typeof-types): Add symbol-with-pos 2022-04-29 22:13:20 -04:00
Po Lu
834383f1e1 Fix focus reversion of Motif menus on XI2
* src/xmenu.c (create_and_show_popup_menu): Stop setting input
focus on the menu window.
2022-04-30 09:29:56 +08:00
Po Lu
af84ea2b9e Fix mouse face bugs on Motif
* src/xterm.c (handle_one_xevent): Fix handling LeaveNotify
events from Motif menus.
2022-04-30 09:22:20 +08:00
Po Lu
94ecd2b3c6 Check display when handling XdndFinished events
* src/xterm.c (handle_one_xevent): Check that the display is
actually the one we want before finishing DND.
2022-04-30 08:47:42 +08:00
Titus von der Malsburg
91418d27e9 Add new functions for computing character metrics for windows
* doc/lispref/display.texi (Size of Displayed Text): Document the
char functions.
* doc/lispref/windows.texi (Window Sizes): Document
window-max-characters-per-line.

* lisp/window.el (window-char-pixel-width)
(window-char-pixel-height)
(window-max-characters-per-line): New functions (bug#19395).
2022-04-29 15:14:09 +02:00
Pip Cet
fa52782f5c Make timer_check even more resilient
* src/keyboard.c (timer_check): Inhibit atimers while making the
copy of the timer list (bug#21380).  This prevents an extremely
unlikely segfault.
2022-04-29 14:14:19 +02:00
Po Lu
20d3d62ec9 Fix colorspace calculations on Haiku
* src/haiku_support.cc (be_get_display_planes)
(be_get_display_color_cells): Handle grayscale basic colorspaces
correctly.
(be_is_display_grayscale): New function.

* src/haiku_support.h: Update prototypes.

* src/haikufns.c (haiku_set_no_accept_focus, haiku_iconify_frame)
(Fxw_display_color_p, Fxw_color_values, Fx_display_grayscale_p):
Actually handle grayscale colorspaces.
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_mm_height, Fx_display_mm_width): Clean up coding
style.
(Fx_display_visual_class): Handle grayscale colorspaces.
(syms_of_haikufns): New defsyms.
2022-04-29 11:07:10 +00:00
Lars Ingebrigtsen
e313cae71f Add helper function to remove title bar when maximizing frames
* lisp/frame.el (toggle-frame-maximized): Mention it.
(frame-hide-title-bar-when-maximized): New function (bug#31968).
Adapted from code by Jonathan Kyle Mitchell.

* src/window.c (syms_of_window): Mention it.
2022-04-29 12:42:15 +02:00
Eli Zaretskii
5c606a46bf ; Fix typo in documentation of 'current-time-list'
* src/timefns.c (syms_of_timefns) <current-time-list>:
* etc/NEWS:
* doc/lispref/os.texi (Time of Day): Fix a typo.
2022-04-29 10:12:02 +03:00
Po Lu
cc297af178 Handle IO errors when creating Motif drag window
* src/xterm.c (xm_drag_window_io_error_handler): New function.
(xm_get_drag_window): Use that as the IO error handler when the
temporary display is open.
2022-04-29 13:48:02 +08:00
Po Lu
f91c9dd2b4 Remove some unneeded tests from the X double buffering code
* src/xterm.c (x_flip_and_flush): Fix coding style.
(flush_dirty_back_buffer_on): Avoid testing for impossible
situations.
2022-04-29 11:52:56 +08:00
Po Lu
a431b44980 ; * src/xterm.c (x_connection_closed): Clean up compiler warning. 2022-04-29 09:35:58 +08:00
Po Lu
24d01af3dd Cancel DND correctly during display disconnect on a different display
* src/xterm.c (x_dnd_io_error_handler): New function.
(x_connection_closed): Send the messages to cancel DND if a
different display was disconnected.
2022-04-29 09:27:51 +08:00
Po Lu
bfcef4dd2b * src/xterm.c (XTflash): Check return value of pselect. 2022-04-29 08:43:27 +08:00
Paul Eggert
083d2708f9 Change current-time back to list form
Change current-time and related functions back to using the
traditional list form.  Also, add a new boolean variable
current-time-list that lets people try out (TICKS . HZ) form,
with the goal of smoothing the transition.
* src/timefns.c (CURRENT_TIME_LIST): Change default back to true.
(current-time-list): New boolean Lisp variable, which defaults to
CURRENT_TIME_LIST.  All uses of CURRENT_TIME_LIST changed to
use current_time_list, and all documentation changed.
2022-04-28 12:54:06 -07:00
Eli Zaretskii
b3023de543 Merge from origin/emacs-28
# Conflicts:
#	lisp/progmodes/xref.el
2022-04-28 18:37:34 +03:00
Eli Zaretskii
3b6338c8c3 Improve documentation of font- and face-related attribute functions
* lisp/faces.el (face-attribute):
* src/xfaces.c (Fx_family_fonts):
* src/font.c (Ffont_get, Ffont_put): Improve and clarify the doc
strings.

* doc/lispref/display.texi (Low-Level Font): Document the :type
attribute of a font.  Improve documentation of 'font-get' and
'font-put'.
(Attribute Functions): Add cross-reference to the description of
face attributes.
2022-04-28 17:53:36 +03:00
Lars Ingebrigtsen
5d032f2904 Allow inserting and selecting binary blobs from sqlite
* doc/lispref/text.texi (Database): Document how to insert binary
data.
* src/sqlite.c (bind_values): Bind BLOB columns correctly (bug#54591).
2022-04-28 14:58:53 +02:00
Po Lu
613aa18945 Simplify buffer flipping code on Haiku
* src/haikuterm.c (flush_dirty_back_buffers): Delete function.
(haiku_flush_dirty_back_buffer_on): New function.
(haiku_read_socket): Use that instead of looping over each frame
at the end.
2022-04-28 12:51:04 +00:00
Lars Ingebrigtsen
6db90a412a Document the non-effect of narrowing on get-text-property
* doc/lispref/text.texi (Examining Properties): Document
surprising non-effect of narrowing (bug#16413).

* src/textprop.c (Ftext_properties_at, Fget_text_property):
Mention narrowing.
2022-04-28 13:04:28 +02:00
Po Lu
3ba039dc96 * src/xterm.c (x_term_init): Fix the non-GTK3 XI2 build. 2022-04-28 17:01:15 +08:00
Eli Zaretskii
76d4e19f89 Fix handling of proportional fonts on MS-Windows
* src/xfaces.c (Fx_family_fonts): Consider fonts whose :spacing
value is numeric, but still indicates that they are proportional,
to be proportional.

* lisp/textmodes/artist.el (artist-mode): Fix test for monospaced
fonts.
2022-04-28 10:50:50 +03:00
Po Lu
9c70045f67 Fix GTK build
* src/xrdb.c (x_load_resources): Fix definitions of `helv'.
2022-04-28 13:07:33 +08:00
Po Lu
02ae85e8aa Stop overriding default Motif colors with our own
* src/xrdb.c (x_load_resources): Instead of specifying the Motif
defaults manually, let Motif set them itself.  This makes
palettes provided by color servers work again.
2022-04-28 10:50:18 +08:00
Po Lu
22b2250732 Handle display disconnects during DND
* src/xterm.c (handle_one_xevent): Keep track of the display the
drop target is on during DND finish.
(x_connection_closed, x_delete_terminal): Handle display
disconnects during DND correctly.
2022-04-28 09:31:29 +08:00
Po Lu
28b375a931 Fix target display checks during Motif DND
* src/xterm.c (handle_one_xevent): Check that the Motif DND
completion message is actually from the right display before
proceeding.
2022-04-28 08:46:21 +08:00
Stefan Monnier
afd3619b86 src/xdisp.c: Use same test in redisplay_window and prepare_menu_bars
This consolidates the test made in those two functions so as to make
sure they agree whether a window needs to be redisplayed.
At the same time, change this test so it uses the window's point
rather than the buffer's point when comparing to `w->last_point`.

* src/xdisp.c (needs_no_redisplay): New function, extracted from
`redisplay_window`.
(redisplay_window, prepare_menu_bars): Use it.

* src/window.c (window_point): New function, extracted from `Fwindow_point`.
(Fwindow_point): Use it.
* src/window.h (window_point): Declare it.
2022-04-27 18:15:34 -04:00
Eli Zaretskii
53e8f00111 Emulate 'clock' for MS-Windows
* src/w32.c (sys_clock): New function.  (Bug#44674)
* nt/inc/ms-w32.h (clock): Redirect to sys_clock.
2022-04-27 21:06:55 +03:00
Ken Brown
f97d4460e0 Implement system_process_attributes on Cygwin
* src/sysdep.c (system_process_attributes) [CYGWIN]: Implement,
using the /proc filesystem.  The code is identical to the
GNU/Linux code except for the 'ttname' attribute.  (Bug#55153)

* etc/NEWS: Mention the change.
2022-04-27 13:22:06 -04:00
Stefan Monnier
1110d7326f Add new function current-cpu-time
* doc/lispref/os.texi (Time of Day): Document it.
* src/timefns.c (Fcurrent_cpu_time): New function (bug#44674).
2022-04-27 19:20:41 +02:00
Po Lu
5aef2623a3 Cleanups to PGTK code
* src/pgtkfns.c (pgtk_explicitly_set_name, pgtk_set_tab_bar_lines)
(pgtk_change_tab_bar_height, pgtk_set_child_frame_border_width)
(pgtk_set_internal_border_width, pgtk_set_cursor_type)
(pgtk_set_mouse_color, pgtk_set_override_redirect, xg_set_icon)
(pgtk_frame_parm_handlers, Fpgtk_set_monitor_scale_factor)
(pgtk_set_scroll_bar_default_width, pgtk_get_focus_frame)
(pgtk_hide_tip, Fx_show_tip, Fx_hide_tip, frame_geometry)
(syms_of_pgtkfns): Clean up coding style and delete incorrect
comments that mostly duplicate what is in xfns.c, and fix
comment coding style.  Also rename functions from `x_' to
`pgtk_'.

* src/pgtkterm.c (pgtk_setup_relief_colors): Fix relief caching
with new flag.
(pgtk_draw_relief_rect, flip_cr_context, pgtk_wait_for_map_event)
(pgtk_make_frame_visible, pgtk_make_frame_invisible)
(pgtk_set_parent_frame, pgtk_draw_glyph_string_foreground)
(pgtk_draw_composite_glyph_string_foreground)
(pgtk_draw_glyphless_glyph_string_foreground)
(pgtk_set_clip_rectangles, pgtk_draw_glyph_string_bg_rect)
(pgtk_draw_image_foreground, pgtk_draw_image_glyph_string)
(pgtk_draw_stretch_glyph_string, pgtk_draw_glyph_string)
(pgtk_copy_bits, pgtk_bitmap_icon, pgtk_define_fringe_bitmap)
(pgtk_show_hourglass, pgtk_flash, pgtk_send_scroll_bar_event)
(pgtk_free_pixmap, set_opacity_recursively, frame_highlight)
(frame_unhighlight, pgtk_toggle_invisible_pointer)
(pgtk_create_terminal, pgtk_window_is_of_frame_recursive)
(pgtk_window_is_of_frame, pgtk_any_window_to_frame)
(pgtk_handle_draw, size_allocate, pgtk_enqueue_string)
(key_press_event, motion_notify_event): Fix coding style and
some minor bugs.

* src/pgtkterm.h (struct pgtk_output): New field for tracking
relief color status, update prototypes.
2022-04-27 19:19:01 +08:00
Po Lu
d4e3e548f5 Remove some unnecessary code
* src/haiku_support.cc (class EmacsView, AfterResize)
(SetUpDoubleBuffering): Remove `cspace' field since it's always
RGBA32.
2022-04-27 08:07:56 +00:00
Po Lu
0bea75c95a Add simple session management support to Haiku
* lisp/term/common-win.el (emacs-save-session-functions): Move
from x-win.el to common-win.el.
* lisp/term/haiku-win.el (haiku-save-session-reply)
(emacs-session-save, handle-save-session): New functions.
* lisp/term/x-win.el (emacs-save-session-functions): Delete.

* src/haiku_font_support.cc (font_style_to_flags):
* src/haiku_support.h (enum haiku_font_weight): Turn weight
macros into enum.
(struct haiku_font_pattern): Likewise.
(struct haiku_session_manager_reply): New struct.
* src/haiku_io.c (haiku_io_init): Create sm port.
* src/haiku_support.cc (QuitRequested): Wait for reply from sm
port.
* src/haikufns.c (Fhaiku_save_session_reply): New function.
(syms_of_haikufns): Define new subr.
* src/haikuterm.c (haiku_read_socket): Send session management
events.
(haiku_term_init): Check new port.
2022-04-27 05:19:15 +00:00
Po Lu
655b3e009b Clean up pointer blanking code
* src/xterm.c (XTtoggle_invisible_pointer): Dispatch to correct
function directly.
(x_probe_xfixes_extension): Return directly based on dpyinfo.
(xfixes_toggle_visible_pointer): Make conditional on
`HAVE_XFIXES'.
(make_invisible_cursor): Initialize `c' correctly.
(x_toggle_visible_pointer): Handle cursor allocation failures.
(x_free_frame_resources): Dispatch with
XTtoggle_visible_pointer.
(x_setup_pointer_blanking): Delete function.
(x_term_init): Initialize blank cursor here instead.
* src/xterm.h (struct x_display_info): New field
`fixes_pointer_blanking'.
2022-04-27 09:10:18 +08:00