Instead of relying on a compositor to do the work, we simply
wait for VBLANK and hope that the update finishes soon enough.
* doc/lispref/frames.texi (Management Parameters): Document that
frame synchronization is now supported on Haiku.
* src/haiku_support.cc (class EmacsView): New field
`use_frame_synchronization'.
(FlipBuffers): Wait for vertical blanking period.
(be_set_use_frame_synchronization): New function.
* src/haiku_support.h: Update prototypes.
* src/haikufns.c (haiku_create_frame): Set
`use-frame-synchronization'.
(haiku_set_use_frame_synchronization)
(haiku_frame_parm_handlers): New param handler.
* src/pgtkterm.c (window_state_event): Support values fullheight and
fullwidth for the fullscreen frame-parameter
* doc/lispref/frames.texi (Size Parameters): Document inability to
actively set hullheight/fullwidth for PGTK frames
* configure.ac: Bump GTK version for PGTK
* etc/NEWS: Change GTK version in PGTK announcement
* doc/lispref/frames.texi (Drag and Drop): Document new
variable.
* lisp/x-dnd.el (x-dnd-do-direct-save): Disable drop emulation
during XDS drag-and-drop.
* src/keyboard.c (kbd_buffer_get_event): Handle recorded value.
* src/xterm.c (x_dnd_do_unsupported_drop): Return if new
variable is nil.
(x_dnd_send_unsupported_drop): Record value of new variable in
events.
(x_dnd_begin_drag_and_drop): Handle recorded value.
(syms_of_xterm): New variable `x-dnd-use-unsupported-drop'.
* doc/lispref/frames.texi (Drag and Drop): Document new function
`dnd-direct-save'.
* etc/NEWS: Likewise.
* lisp/dnd.el (dnd-direct-save-remote-files): New defcustom.
(dnd-begin-file-drag): Implement defucstom.
(dnd-begin-drag-files): Add kill-emacs-hook after saving remote
file.
(dnd-direct-save): New function.
* lisp/x-dnd.el (x-dnd-known-types): Fix coding style.
(x-dnd-handle-drag-n-drop-event): Handle local value with
self-originating DND events.
(x-dnd-xds-current-file, x-dnd-xds-source-frame): New defvars.
(x-dnd-handle-direct-save, x-dnd-do-direct-save): New functions.
* src/xfns.c (Fx_begin_drag): Allow any atom to be used as a DND
action.
* src/xselect.c (symbol_to_x_atom): Make public.
* src/xterm.c (x_dnd_note_self_drop): Include selection local
value.
(x_ignore_errors_for_next_request): Don't assume x_error_message
is set.
* src/xterm.h: Update prototypes.
* doc/lispref/frames.texi (Drag and Drop): Document new
parameter to `x-begin-drag'.
* lisp/mouse.el (mouse-drag-and-drop-region): Don't hide tooltip
when initiating interprogram drag-and-drop.
* lisp/term/haiku-win.el (x-begin-drag):
* lisp/term/ns-win.el (x-begin-drag): Add stubs for new
parameter.
* src/xfns.c (Fx_begin_drag): New parameter `follow-tooltip'.
(Fx_show_tip, syms_of_xfns): Add records of the last dx and dy
given to `x-show-tip'.
* src/xterm.c (x_clear_dnd_monitors): New function.
(x_dnd_begin_drag_and_drop): Save monitor attributes list if
appropriate.
(x_dnd_compute_tip_xy, x_dnd_update_tooltip_position): New
function.
(x_dnd_update_state, handle_one_xevent): Update tooltip position
during DND mouse movement.
(syms_of_xterm): Update staticpros.
* src/xterm.h: Update prototypes.
* lisp/dnd.el (dnd-begin-text-drag, dnd-begin-file-drag):
* doc/lispref/frames.texi (Drag and Drop): Improve wording of
documentation of 'dnd-begin-text-drag' and 'dnd-begin-file-drag'.
* doc/lispref/frames.texi (Drag and Drop): Document new function
`dnd-begin-drag-files'.
* lisp/dired.el (dired-mouse-drag-files): Update doc string.
(dired-map-over-marks): Accept a new value of ARG `marked',
meaning to not fall back to the current file if no marks were
found.
(dired-mouse-drag): Handle marked files in an intuitive way.
* lisp/dnd.el (dnd-last-dragged-remote-file): Allow list values
as well.
(dnd-remove-last-dragged-remote-file): Handle list values.
(dnd-begin-file-drag): Fix file name expansion.
(dnd-begin-drag-files): New function.
* lisp/select.el (xselect-convert-to-filename): Handle mutiple
files
(a vector of file names):.
The previous interface required that users know intricacies of
the data types used to transfer data on each platform Emacs
supports.
* doc/lispref/frames.texi (Drag and Drop): Document new
functions.
* lisp/dired.el (dired-last-dragged-remote-file)
(dired-remove-last-dragged-local-file): Delete functions.
(dired-mouse-drag): Use `dnd-begin-file-drag'.
* lisp/dnd.el (dnd-last-dragged-remote-file)
(dnd-remove-last-dragged-remote-file): New variables and
functions.
(dnd-begin-text-drag, dnd-begin-file-drag): New functions.
* src/xterm.c (x_dnd_begin_drag_and_drop): Add porting note.
* doc/lispref/frames.texi (Drag and Drop): Don't conflate X
Windows specific implementation details with general
drag-and-drop functionality, document what `dnd-protocol-alist'
actually means, and improve documentation on DND data types.
* doc/lispref/frames.texi (Window System Selections):
* etc/NEWS: Document new changes to `gui-get-selection'.
* lisp/dired.el (dired-mouse-drag): Specify text/uri-list value
explicitly.
* lisp/select.el (gui-set-selection): Update doc string.
(xselect-convert-to-text-uri-list): Update to handle either a
single URL (as a string) or a vector of URLs, instead of file
names.
(xselect-uri-list-available-p): Likewise.
* src/xselect.c (x_get_local_selection): Look in tem's text
properties (if it is a string) for a local value before using
tem itself.
* doc/lispref/frames.texi (Drag and Drop):
* src/xfns.c (Fx_begin_drag): Document that x-begin-drag may
return immediately if no mouse buttons are held down.
* doc/lispref/frames.texi (Size Parameters): Remove note saying
Haiku doesn't support `fullwidth' and `fullboth'.
* src/haiku_support.cc (subset_windows, class EmacsWindow)
(Unparent, ParentTo): Stop calling old fullscreen functions.
(ClearFullscreen, FullscreenRectForMode, SetFullscreen): New
functions. Completely rewrite old zoom and fullscreen handling
code.
(Zoom): Send a ZOOM_EVENT and don't actually zoom.
(BWindow_zoom, EmacsWindow_make_fullscreen, EmacsWindow_unzoom):
Delete functions.
(be_set_window_fullscreen_mode): New function.
* src/haiku_support.h (struct haiku_zoom_event): Remove
`zoomed_p' parameter.
(enum haiku_fullscreen_mode): New enum. Update prototypes.
* src/haikufns.c (Fx_display_pixel_height): Return height
instead of width.
* src/haikuterm.c (haiku_make_fullscreen_consistent)
(haiku_read_socket, haiku_fullscreen): Adjust to always set zoom
and fullscreen in the main thread instead of the UI threads.
* src/haikuterm.h (struct haiku_output): Remove flag `zoomed_p'
and add field `fullscreen_mode'.
* doc/lispref/frames.texi (Frame Layout): Document changes to
Haiku frame layout.
* src/haiku_support.cc (class EmacsWindow, MoveToIncludingFrame)
(EmacsMoveTo, MakeFullscreen): Move to an offset including the
decorator frames.
(be_get_window_decorator_dimensions):
(be_get_window_decorator_frame): New functions.
* src/haiku_support.h: Update prototypes.
* src/haikufns.c (haiku_update_after_decoration_change): New
function.
(haiku_create_frame, haiku_set_undecorated)
(haiku_set_override_redirect): Call that function.
(frame_geometry): Actually calculate frame geometry based on
decorator and frame sizes.
* src/haikuterm.c (haiku_coords_from_parent): Use frame width
instead.
(haiku_read_socket): Set left and top positions based on
decorator width and height.
* src/haikuterm.h (struct haiku_output): New field `frame_x' and
`frame_y'.
* 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.
* doc/lispref/frames.texi (Drag and Drop): Document new meaning
of `return-frame' in `x-begin-drag'.
* lisp/mouse.el (mouse-drag-and-drop-region): Use `now' when
calling `x-begin-drag'.
* src/xfns.c (Fx_begin_drag): Update doc string.
* src/xterm.c (x_dnd_begin_drag_and_drop): Accept return_frame
as a Lisp_Object and handle Qnow correctly.
(XTmouse_position): Ignore tooltip frames when processing
`drag-source'.
(syms_of_xterm): New defsym `now'.
* src/xterm.h: Update prototypes.
* doc/lispref/frames.texi (Mouse Tracking):
* etc/NEWS: Announce new `drag-source' value of `track-mouse'.
* lisp/mouse.el (mouse-drag-and-drop-region): Use new value of
`track-mouse' during interprogram drag and drop.
* src/keyboard.c (make_lispy_position): Handle nil values of f
correctly.
* src/xdisp.c (define_frame_cursor1): Ignore if `drag-source' as
well.
(syms_of_xdisp): New defsym `drag-source'.
* src/xterm.c (XTmouse_position): Implement `drag-source'.
(mouse_or_wdesc_frame): Likewise.
* doc/lispref/frames.texi (Window System Selections):
* lisp/select.el (gui-set-selection): Don't say `data' can be a
cons or list of two integers, since that's not supported.
* doc/lispref/frames.texi (Drag and Drop): Document new meaning
of `action'.
* lisp/term/haiku-win.el (x-begin-drag): Correct for new meaning
of `action'.
* src/xfns.c (Fx_begin_drag): Handle new alist meaning of
`action'.
* src/xterm.c (x_dnd_begin_drag_and_drop): New parameters
`ask_action_list', `ask_action_names' and `n_ask_actions'.
* src/xterm.h: Update prototypes.
* doc/lispref/frames.texi (Drag and Drop): Fix documentation of
`x-begin-drag' to match actual function arity.
* lisp/term/haiku-win.el (haiku-dnd-selection-value): New
variable.
(haiku-dnd-selection-converters): New variable.
(haiku-dnd-convert-string): New function.
(gui-backend-get-selection, gui-backend-set-selection): Handle
XdndSelection specially.
(x-begin-drag): New function.
* src/haiku_select.cc (be_create_simple_message)
(be_add_message_data): New functions.
* src/haiku_support.cc (WAIT_FOR_RELEASE): New message type.
(class EmacsView, MouseUp): If waiting for release, reply and
drop event.
(be_drag_message, be_drag_message_thread_entry): New functions.
* src/haiku_support.h: Update prototypes.
* src/haikuselect.c (lisp_to_type_code, haiku_lisp_to_message)
(Fhaiku_drag_message): New functions.
(syms_of_haikuselect): Define new subr.
* src/haikuselect.h: Update prototypes.
* doc/lispref/frames.texi (Drag and Drop): Document new
parameter `return-frame' to `x-begin-drag'.
* lisp/mouse.el (mouse-drag-and-drop-region): Utilize new
feature.
* src/xfns.c (Fx_begin_drag): New parameter `return-frame'.
* src/xterm.c (x_dnd_begin_drag_and_drop): New parameter
return_frame_p.
(handle_one_xevent): Set new flags and return frame whenever
appropriate.
* src/xterm.h: Update prototypes.
This still probably needs some more protection from
malfunctioning clients which delete windows at random, but I
don't know if that's a problem in practice.
* doc/emacs/frames.texi (Drag and Drop):
* doc/lispref/frames.texi (Drag and Drop): Document new
features.
* etc/NEWS: Announce new function `x-begin-drag' and new user
option `mouse-drag-and-drop-region-cross-program'.
* lisp/mouse.el (mouse-drag-and-drop-region-cross-program): New
user option.
(x-begin-drag): New variable declaration.
(mouse-drag-and-drop-region): If the mouse moves out of an Emacs
frame, begin a window system drag.
* lisp/x-dnd.el (x-dnd-handle-xdnd): Remove left-over debugging
code.
* src/xfns.c (Fx_set_mouse_absolute_pixel_position): Fix
indentation of opening paren.
(Fx_begin_drag): New function.
(syms_of_xfns): Define new subr.
* src/xselect.c (x_timestamp_for_selection): New function.
* src/xterm.c (X_DND_SUPPORTED_VERSION): New preprocessor
declaration.
(x_dnd_get_window_proto, x_dnd_send_enter, x_dnd_send_position)
(x_dnd_send_leave, x_dnd_send_drop, x_set_dnd_targets)
(x_dnd_begin_drag_and_drop): New functions.
(handle_one_xevent): Handle drag-and-drop motion and button
events when active.
(x_free_frame_resources): If f is the DND source, stop
drag-and-drop.
(x_term_init): Intern new atoms.
(syms_of_xterm): New symbol QXdndSelection.
* src/xterm.h (struct x_display_info): New atoms
Xatom_XdndAware, Xatom_XdndSelection, Xatom_XdndTypeList,
Xatom_XdndActionCopy, Xatom_XdndActionMove,
Xatom_XdndActionLink, Xatom_XdndActionAsk,
Xatom_XdndActionPrivate, Xatom_XdndActionList,
Xatom_XdndActionDescription, Xatom_XdndProxy, Xatom_XdndEnter,
Xatom_XdndPosition, Xatom_XdndStatus, Xatom_XdndLeave,
Xatom_XdndDrop, and Xatom_XdndFinished.
* doc/lispref/frames.texi (Pop-Up Menus): Document new hook.
* etc/NEWS: Announce `x-pre-popup-menu-hook'.
* lisp/tooltip.el (tooltip-mode): Make sure `tooltip-hide' is
run before any popup menu is displayed to prevent unrelated help
text from obscuring the popup menu if it pops up during the
tooltip delay.
* src/menu.c (x_popup_menu_1): Run said hook right before the
popup menu is displayed.
(syms_of_menu): New hook `x-pre-popup-menu-hook'.
* doc/lispref/frames.texi (Raising and Lowering): Document that
lowering frames is now supported on Haiku.
* src/haikuterm.c (haiku_frame_raise_lower): Implement a hack to
lower frames.
* doc/lispref/frames.texi (Raising and Lowering): Update
documentation to reflect that restacking frames is now
supported on Haiku.
* lisp/frame.el (haiku-frame-restack): New declaration.
(frame-restack): Use `haiku-frame-restack' on Haiku.
* src/haiku_support.cc (BWindow_send_behind):
* src/haiku_support.h (BWindow_send_behind):
* src/haikufns.c (Fhaiku_frame_restack): New functions.
(syms_of_haikufns): New subr `haiku-frame-restack'.
* lisp/frame.el (before-make-frame-hook)
(after-make-frame-functions):
* doc/lispref/frames.texi (Creating Frames): Mention that these
functions will be run for the initial frame only if added to the
hook in early-init file. (Bug#38143)