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

45975 commits

Author SHA1 Message Date
Po Lu
8e464272bd ; * src/haiku_support.h: Fix header coding style. 2022-04-15 12:00:35 +00:00
Po Lu
4ac25d53af Clean up keysyms from Haiku headers
* src/haiku_support.cc (keysym_from_raw_char): Add keysym
numbers here and use those instead.
* src/haiku_support.h: Delete all the X11 keysym definitions.
2022-04-15 12:00:35 +00:00
Po Lu
09ac2c73ee Fix dismissal of tooltips on Haiku
* src/haikuterm.c (haiku_mouse_or_wdesc_frame): New argument
`accept_tooltip'.
(haiku_read_socket): Use it when handling MOUSE_MOTION events.
2022-04-15 11:25:54 +00:00
Eli Zaretskii
2b92b57923 ; * src/fringe.c: Include pgtkterm.h only in HAVE_PGTK builds. 2022-04-15 12:22:15 +03:00
Po Lu
504779f744 More PGTK related cleanup
* src/pgtkfns.c (x_set_foreground_color, x_set_background_color)
(x_set_border_color, x_set_cursor_color, x_set_title)
(x_set_menu_bar_lines, x_set_tab_bar_lines, x_set_tool_bar_lines)
(x_set_child_frame_border_width, x_set_internal_border_width)
(x_set_icon_type, x_set_icon_name, x_set_cursor_type)
(x_set_mouse_color, x_set_undecorated, x_set_skip_taskbar)
(x_set_override_redirect, pgtk_frame_parm_handlers)
(Fx_create_frame): Rename most `x_' functions to `pgtk_' ones.
All callers changed.
* src/pgtkmenu.c (Fx_menu_bar_open_internal): Remove duplicate
doc string definition.
* src/pgtkterm.c (x_set_offset, pgtk_iconify_frame)
(x_set_parent_frame, x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_z_group, x_set_cursor_gc, x_set_mouse_face_gc)
(x_set_mode_line_face_gc, x_set_glyph_string_gc)
(x_set_glyph_string_clipping, x_set_glyph_string_clipping_exactly)
(x_setup_relief_color, x_setup_relief_colors)
(x_set_clip_rectangles, x_draw_relief_rect, x_draw_box_rect)
(x_draw_glyph_string_box, x_draw_image_relief)
(x_draw_image_foreground, x_draw_stretch_glyph_string)
(pgtk_draw_glyph_string, x_set_toolkit_scroll_bar_thumb)
(x_set_toolkit_horizontal_scroll_bar_thumb)
(pgtk_set_vertical_scroll_bar, pgtk_set_horizontal_scroll_bar)
(x_set_frame_alpha, frame_highlight, frame_unhighlight)
(pgtk_create_terminal, map_event): Rename most `x_' functions to
`pgtk_' ones.  All callers changed.
* src/pgtkterm.h: Update prototypes.
2022-04-15 16:44:18 +08:00
Po Lu
bdceac0d5a Clean up some extraneous stuff in pgtkfns.c
* src/pgtkfns.c (Fx_gtk_debug): Fix doc string and remove extra
version check.
(syms_of_pgtkfns): Delete left over defvar from NS port.
2022-04-15 16:44:18 +08:00
Po Lu
4d2aa420bd Fix core string lookup with modifiers on XI2
* src/xterm.c (handle_one_xevent): Clean modifiers from
xkey.state before giving it to XLookupString.
2022-04-15 15:09:18 +08:00
Po Lu
095a776d06 Clean up various bits of Haiku code
* src/haiku_font_support.cc (BFont_string_width): Delete unused
function.
* src/haiku_support.cc (BWindow_new): Clean up type of `view'.
(BWindow_quit): Clean up coding style.
(BView_mouse_down, BView_mouse_up, BView_mouse_moved): Delete
unused functions.
(unwind_popup_file_dialog): Clean up coding style.
(be_popup_file_dialog_safe_set_target): Delete function.
(be_popup_file_dialog): Improve code clarity.
* src/haiku_support.h: Fix coding style.
* src/haikufns.c (haiku_get_color, haiku_display_info_for_name)
(check_haiku_display_info, Fhaiku_read_file_name)
(Fx_display_save_under, Fhaiku_frame_restack): Remove references
to "Be displays" and replace them with "Haiku displays".
* src/haikuselect.h: Clean up coding style.
* src/haikuterm.c (haiku_read_socket): Clean up coding style and
fix a few latent bugs.
2022-04-15 06:36:37 +00:00
Po Lu
2c5b4ae93a Add missing extern declarations to headers
* src/xterm.h (xi_device_from_id, xi_frame_selected_for): Add
`extern' declaration.
2022-04-15 14:08:40 +08:00
Po Lu
24df0273e9 Make Haiku scroll bar behave more like other programs
* haiku_support.cc (class EmacsScrollBar): New field
`repeater_start'.
(Pulse): Wait for time to pass repeater_delay.
(MouseDown): Set it to the current time + the system repeater
delay.
2022-04-15 02:38:35 +00:00
Paul Eggert
7c17bd2a6d New time-equal-p test
* test/src/timefns-tests.el (time-equal-p-NaN-NaN): New test.
2022-04-14 19:09:51 -07:00
Po Lu
6c4559d138 Properly wait for app thread exit on Haiku
* src/haiku_support.cc (MessageReceived): Handle
QUIT_APPLICATION.
(start_running_application): Clean up code a little.
(wait_for_exit_of_app_thread): New function.
(BApplication_setup): Add atexit handler to clean up app thread.
(be_app_quit): Delete function.
* src/haikuterm.c (haiku_delete_terminal): Un-implement
function.
* src/haikuterm.h: Update prototypes.
2022-04-15 01:23:27 +00:00
Po Lu
804d919ac5 Fix calls to XKB functions without testing for server support
* src/xterm.c (x_dnd_cleanup_drag_and_drop):
(x_dnd_begin_drag_and_drop): Never call XkbSelectEvents if the
X server doesn't have XKB.
2022-04-15 08:55:25 +08:00
Eli Zaretskii
67e7870a62 Fix mouse clicks in hscrolled window with variable-height fonts
* src/xdisp.c (move_it_in_display_line_to): Fix calculation of
height of a screen-line that is completely hscrolled out of view.
Reported by Yasushi SHOJI <yasushi.shoji@gmail.com>.
2022-04-14 20:40:24 +03:00
Philip Kaludercic
17b639aabb Avoid possibly unnecessary lisp_time_struct call
* timefns.c (time_cmp): Defer the calculation of the time struct, in
  case A and B are eq to one another.
2022-04-14 18:39:35 +02:00
Po Lu
a9b8ebf34c Fix races with child frame locks on Haiku
* src/haiku_support.cc
(CHILD_FRAME_LOCK_INSIDE_LOOPER_CALLBACK): New macro.
(FrameMoved, WorkspacesChanged): Lock child frame data with that
macro instead.
2022-04-14 13:14:32 +00:00
Po Lu
e5ef0fe832 Keep track of keyboard state during drag and drop
* src/xterm.c (x_dnd_cleanup_drag_and_drop): Deselect for
keyboard state changes.
(x_dnd_begin_drag_and_drop): Select for keyboard state changes
when XKB is available.
(x_dnd_update_state, handle_one_xevent): Use current XKB state
if it is available.
(x_term_init): Reformat code a little.
2022-04-14 19:02:13 +08:00
Po Lu
203c503ff2 Minor fixes to menus on XI2
* src/xfns.c (Fx_create_frame): Populate `xi_masks'.
* src/xmenu.c (x_activate_menubar)
(create_and_show_popup_menu, x_menu_show): Only clear input
extension grabs if we (or the toolkit) actually selected for
XI_ButtonPress events.
* src/xterm.c (xi_frame_selected_for): New function.
(xi_populate_device_from_info, handle_one_xevent): Store device
use instead of just whether or not it's a master device.
(x_dnd_begin_drag_and_drop): Clean up block_input stuff.
* src/xterm.h: Update prototypes.
(struct xi_device_t): Rename `master_p' to `use'.
2022-04-14 16:04:59 +08:00
Po Lu
c10024911d Ignore XdndPosition events triggered by the wrong mouse button
* src/xterm.c (x_dnd_send_position): Don't send if button is set
but not a scroll wheel button.
2022-04-14 10:26:39 +08:00
Po Lu
63c28d389d Add support for Xdnd features introduced after version 5
* src/xterm.c (x_dnd_send_position, x_dnd_update_state)
(handle_one_xevent): Add support for sending button and keyboard
state during DND.
2022-04-14 09:31:02 +08:00
Eli Zaretskii
be42fdc6dc ; * src/xterm.c (x_term_init): Fix whitespace. 2022-04-13 16:48:13 +03:00
Po Lu
ed6237e039 Move raw event selection on GTK+ 2 to a more appropriate place
* src/xfns.c (setup_xi_event_mask): Stop selecting for
RawKeyPress on the root window.
* src/xterm.c (x_new_focus_frame): Select here instead, once a
frame becomes focused.
2022-04-13 19:13:38 +08:00
Po Lu
e1c6b40e9d Fix input availability detection during visible-bell
* src/xterm.c (XTflash): Exit pselect loop also if input becomes
available on f's display connection.
2022-04-13 15:03:50 +08:00
Po Lu
eb85abf5b2 Minor cleanups to Haiku windowing
* src/haikufns.c (haiku_create_frame, haiku_create_tip_frame):
* src/haikuterm.h (struct haiku_output, struct scroll_bar)
(XSCROLL_BAR): Remove used fields of various structs.

* src/haikuterm.c (haiku_flash): Make input detection actually
work.
2022-04-13 06:46:45 +00:00
Po Lu
8e3d120b9f Fix zoom rect computation for some deskbar positions on Haiku
* src/haiku_support.cc (CalculateZoomRect): Fix computation for
left top and right bottom.
2022-04-13 04:44:11 +00:00
Po Lu
e91cbdfaee Bump minimum GTK for PGTK builds
* configure.ac: Require GTK 3.20 or later if building with PGTK.
It has already been required for some time now, but the
requirement was not reflected in the configure script.

* src/pgtkterm.c (pgtk_any_window_to_frame): Remove version
check.
2022-04-13 11:15:05 +08:00
Po Lu
1c1ae6ba80 Clean up PGTK code more
* src/pgtkterm.c (STORE_KEYSYM_FOR_DEBUG): Delete macro.
(x_find_modifier_meanings): Delete function.
(get_modifier_values, pgtk_gtk_to_emacs_modifiers)
(pgtk_emacs_to_gtk_modifiers): Use GDK's own modifier mask
constants instead of detecting our own from the keymap.  This
does mean a specific "meta" key will no longer be detected on X
Windows, but that interface doesn't exist on Wayland, and X
users should use the X port anyway.
(key_press_event): Avoid decoding input text.
(pgtk_term_init): Stop computing modifiers.
(syms_of_pgtkterm): Delete obsolete comment.
* src/pgtkterm.h (struct pgtk_display_info): Delete modifier
masks.
2022-04-13 10:54:56 +08:00
Po Lu
db56a69274 Remove unused flag on Haiku
* src/haikufns.c (haiku_create_frame, haiku_create_tip_frame):
* src/haikuterm.h (struct haiku_output): Delete mentions of
`explicit_parent'.
2022-04-13 02:37:54 +00:00
Po Lu
4cf885a41a Fix bit rot in the XEmbed code
* src/xterm.c (x_term_init): Delete unused atom.
(handle_one_xevent):
(x_make_frame_visible): Handle embedded frame visibility
correctly.
* src/xterm.h (struct x_display_info): Delete unused atom.
2022-04-13 10:08:18 +08:00
Po Lu
2e0a2ecc29 Fix freezes when trying to accelerate menu bar on Haiku
* src/haiku_support.cc (class EmacsWindow): New field
`menus_begun'.
(MenusBeginning): Don't send menu bar open events when that is
set, instead set it to true.
(BMenuBar_start_tracking): Stop locking the menu bar here and
send a special BE_MENU_BAR_OPEN event instead.
* src/haiku_support.h (struct haiku_menu_bar_state_event):
Delete field `no_lock'.
* src/haikumenu.c (Fhaiku_menu_bar_open):
* src/haikuterm.c (haiku_read_socket): Update accordingly.
2022-04-13 00:51:13 +00:00
Lars Ingebrigtsen
95c9079da0 Make the SVG error message less verbose
* src/image.c (svg_load_image): Don't include the spec in the
error message, because this is commonly the entire SVG string, and
this will fill up the *Messages* buffer quickly.
2022-04-13 01:38:10 +02:00
Lars Ingebrigtsen
a987e66e6b Improve DISPOSE_PREVIOUS in gif_load slightly
* src/image.c (gif_load): Tweak how DISPOSE_PREVIOUS is handled.
It's still not right, but it's less glaringly wrong.
2022-04-12 16:22:38 +02:00
Eli Zaretskii
66189689ca Fix 'window-text-pixel-size' when starting from a display property
* src/xdisp.c (Fwindow_text_pixel_size): Handle the case where
there's a display property at START and 'move_it_to' overshoots.
(Bug#54862)
2022-04-12 17:19:06 +03:00
Lars Ingebrigtsen
9b892eeb91 Fix webp_load data lifetime issues
* src/image.c (webp_load): Take care of lifetime issues of the
image data we're iterating over for animated images.
2022-04-12 16:08:58 +02:00
Po Lu
c3c08b90b6 Fix keyboard event device attribution on GTK+ 2
* src/xfns.c (setup_xi_event_mask): Select for raw keypress
events on GTK 2.
* src/xterm.c (handle_one_xevent): Set pending keystroke time
when a raw event is received.
* src/xterm.h (struct x_display_info): New flag
`pending_keystroke_time_special_p'.
2022-04-12 21:30:25 +08:00
Po Lu
1b20c4eaa2 Fix detection of Meta key in some cases
* src/xterm.c (x_find_modifier_meanings): Set found_meta_p
correctly.
2022-04-12 21:30:25 +08:00
Lars Ingebrigtsen
4a108df0eb Fix check for whether frames fit into gif images
* src/image.c (gif_load): Really check all frames that they fit.
2022-04-12 15:11:32 +02:00
Po Lu
00071c976f Fix some confusing names in xterm.c
* src/xterm.c (enum xm_targets_table_byte_order): Rename to
`xm_byte_order'.  All uses changed.
2022-04-12 21:09:25 +08:00
Lars Ingebrigtsen
7b67b9a5a2 Store less data in the gif animation cache
* src/image.c (gif_load): Only start a cache if we're have an
:index entry (which means that we're trying to animate something).
2022-04-12 14:45:29 +02:00
Lars Ingebrigtsen
25a28ed4f7 Release resources in gif_load on errors
* src/image.c (webp_load): Clean up code slightly.
(gif_load): Really release resources on GIF parsing errors.
2022-04-12 13:17:14 +02:00
Lars Ingebrigtsen
3de2462da7 Animate GIF images that don't have an explicit delay setting
* src/image.c (gif_load): Use the default delay for GIF images
that don't explicitly state a delay.
2022-04-12 12:43:56 +02:00
Lars Ingebrigtsen
8e1c0054b3 Fix thinko in the anim cache
* src/image.c (gif_load): Fix resetting the cache when we're out
of sync.
(anim_create_cache): Start from zero, not 1.
2022-04-12 12:12:24 +02:00
Po Lu
78784ccfad Disallow drag and drop inside a menu-entry
* src/xterm.c (x_dnd_cleanup_drag_and_drop): Always free DND
targets even if waiting for finish.
(x_dnd_begin_drag_and_drop): Free targets correctly when
signalling error and prevent activating drag-and-drop inside a
menu or popup.  (It doesn't work.)
2022-04-12 16:38:02 +08:00
Po Lu
e2b64f8999 Fix some DISPLAY variable related bugs on PGTK
* src/callproc.c (getenv_internal, make_environment_block):
Don't set DISPLAY on non-X GDK backends.  (bug#54844)
2022-04-12 13:27:56 +08:00
Po Lu
b15d9fcebb * src/xterm.c (frame_set_mouse_pixel_position): Avoid server grab. 2022-04-12 12:01:34 +08:00
Po Lu
bf44581a5e Don't use native image APIs for some types on Haiku
* src/haikuimage.c (haiku_can_use_native_image_api): Ignore
types with animations when their respective libraries are
present.
2022-04-12 02:37:39 +00:00
Po Lu
1ef57361ab Fix last tool bar bug on Haiku as well
* src/haikuterm.c (haiku_read_socket): Adapt last change to
Haiku.
2022-04-12 00:47:38 +00:00
Po Lu
60f66cc2a2 Fix selecting text and releasing the mouse buttons above the toolbar
* src/xterm.c (handle_one_xevent): Don't send ButtonRelease
events to tool bars if there is no selected tool bar item.
2022-04-12 08:41:19 +08:00
Lars Ingebrigtsen
1c28b9ed1a Make normal image caching actually work when doing animated images
* src/image.c (filter_image_spec): New function.
(uncache_image): Use it.
(lookup_image): Ditto.
(syms_of_image): Define some keywords.
2022-04-11 18:50:39 +02:00
Mattias Engdegård
949bc336a0 ; * src/image.c: move #endif to correct place 2022-04-11 17:11:00 +02:00