Commit graph

46145 commits

Author SHA1 Message Date
Po Lu
ece2ee965f Allow quitting inside font selection dialogs on Haiku
* src/haiku_support.cc (WaitForChoice): Accept new function for
checking quit flag.
(be_select_font): Pass that function.
* src/haiku_support.h: Update prototypes.
* src/haikufont.c (haikufont_should_quit_popup): New function.
(Fx_select_font): Give said function to `be_select_font'.
2022-05-01 03:20:58 +00:00
Po Lu
ed0de6200d Allow invoking fonts in the Haiku font dialog
* src/haiku_support.cc (MessageReceived): Handle invocations.
(EmacsFontSelectionDialog): Set style panel invocation message.
2022-05-01 02:43:18 +00:00
Po Lu
7dda9835c6 Improvements to the Haiku font dialog
* src/haiku_support.cc (class EmacsFontSelectionDialog)
(EmacsFontSelectionDialog, FrameResized): Fix colors and respect
monospace only.
(be_select_font): New parameter `allow_monospace_only'.
* src/haiku_support.h: Update prototype.
* src/haikufont.c (Fx_select_font): Respect
`exclude-proportional'.
2022-05-01 02:17:04 +00:00
Po Lu
07ae30d8f2 Also fix some compiler warnings in xterm.c that didn't show up
* src/xterm.c (x_dnd_begin_drag_and_drop): Don't define unused
variable on GTK builds.
2022-05-01 09:45:20 +08:00
Po Lu
4e6eb023e0 Fix the GTK build
* src/xterm.c (x_dnd_begin_drag_and_drop): Let GTK handle events
again.
2022-05-01 09:43:08 +08:00
Po Lu
905fabe590 * src/xterm.c (x_dnd_begin_drag_and_drop): Fix typo. 2022-05-01 09:41:16 +08:00
Po Lu
ba0264e191 Fix processing events from multiple displays during DND
* src/xterm.c (x_next_event_from_any_display): New function.
Only used on no-toolkit builds.
(x_dnd_begin_drag_and_drop): Compute correct dpyinfo for
handle_one_xevent.
2022-05-01 09:37:12 +08:00
Po Lu
61d6d43fe5 Clean up X Windows tooltip code
* src/xfns.c (x_hide_tip): Remove "bloodcurdling hack".
* src/xterm.c (handle_one_xevent): Add a better version here
instead.  The code is unlikely to be hit as well, since tooltip
frames are typically deleted, not just hidden.
2022-05-01 09:15:52 +08:00
Po Lu
b2fdf78fd9 Implement font selection dialog on Haiku
* src/haiku_font_support.cc (font_style_to_flags): Handle style
allocation failures.
(be_font_style_to_flags): New function.

* src/haiku_support.cc (struct font_selection_dialog_message):
New struct.
(class EmacsFontSelectionDialog): New class.
(be_select_font): New function.

* src/haiku_support.h: Update prototypes.
* src/haikufont.c (Fx_select_font): New function.
(syms_of_haikufont): Define new subr.
2022-05-01 01:00:15 +00:00
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