aboutsummaryrefslogtreecommitdiffstats
path: root/src/xterm.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add missing extern declarations to headersPo Lu2022-04-151-2/+2
| | | | | * src/xterm.h (xi_device_from_id, xi_frame_selected_for): Add `extern' declaration.
* Minor fixes to menus on XI2Po Lu2022-04-141-2/+7
| | | | | | | | | | | | | | * 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'.
* Fix bit rot in the XEmbed codePo Lu2022-04-131-1/+1
| | | | | | | | * 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.
* Fix keyboard event device attribution on GTK+ 2Po Lu2022-04-121-0/+8
| | | | | | | | | * 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'.
* Attribute filtered events to the right source devicePo Lu2022-04-101-0/+3
| | | | | | | | * src/xterm.c (handle_one_xevent): Attribute core events sent by input methods like I-Bus to the extension device that caused them to be sent. * src/xterm.h (struct x_display_info): New fields `pending_keystroke_time' and `pending_keystroke_source'.
* Expose the name of an event's input device to LispPo Lu2022-04-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This name can be used to identify the device for special treatment, i.e. only interpolating scrolls coming from mice and not touchpads inside pixel-scroll-precision-mode. * doc/lispref/commands.texi (Command Loop Info): Document new variable `last-event-device'. * etc/NEWS: Announce new variable `last-event-device'. * src/frame.h (struct frame): New field `last_mouse_device'. * src/keyboard.c (read_char): Clear last-event-device. (kbd_buffer_get_event): Set last-event-device to the event's recorded device. (init_keyboard): Clear last-event-device. (syms_of_keyboard): New defvar `last-event-device'. * src/termhooks.h (struct input_event): New field `device'. (EVENT_INIT): Set it to the special value `Qt' by default. * src/xterm.c (x_init_master_valuators): Record the device's name. (x_dnd_begin_drag_and_drop): Only preserve last event device if the mouse ended up in the source frame. (x_note_mouse_movement): New argument `source'. (handle_one_xevent): Set input event sources whenever appropriate. (mark_xterm): Mark device names. * src/xterm.h (struct xi_device_t): New field `name'.
* Move some X11 drag and drop processing to LispPo Lu2022-04-061-0/+3
| | | | | | | | | | | | | | | * lisp/term/x-win.el: Set unsupported drop function. * lisp/x-dnd.el (x-dnd-handle-unsupported-drop): New function. * src/keyboard.c (kbd_buffer_get_event): Handle UNSUPPORTED_DROP_EVENT. * src/termhooks.h (enum event_kind): New event `UNSUPPORTED_DROP_EVENT'. * src/xterm.c (x_dnd_send_unsupported_drop): Send those events instead. (x_dnd_do_unsupported_drop): Move actual unsupported drop handling here. (syms_of_xterm): New variable `x-dnd-unsupported-drop-function'. * src/xterm.h: Update prototypes.
* Mark some data during drag-and-dropPo Lu2022-04-051-0/+2
| | | | | | | | | | | | | It doesn't make sense to prevent the return frame or movement frame from being deleted, but we should at least protect them from garbage collection. * src/alloc.c (garbage_collect): Call mark_xterm. * src/xterm.c (x_dnd_begin_drag_and_drop) (x_dnd_cleanup_drag_and_drop): Clear movement and return frames upon DND completion. (mark_xterm): Mark those frames. * src/xterm.h: Update prototypes.
* Add support for dragging text onto windows that don't support any DND protocolPo Lu2022-04-051-0/+2
| | | | | | | | | | | | | | | | * src/xselect.c (x_own_selection): Export function. (x_handle_selection_request): Handle selection requests to the pending DND time. (x_set_pending_dnd_time): New function. * src/xterm.c (x_dnd_send_unsupported_drop): New function. Implement according to the suggestions in the XDND protocol specification. (x_dnd_get_target_window): Return the toplevel window as well. (x_dnd_cleanup_drag_and_drop, x_dnd_begin_drag_and_drop) (x_dnd_update_state, handle_one_xevent): Send unsupported drops and use last seen toplevel instead of target for `return_frame'. * src/xterm.h: Update prototypes.
* Handle mouse movement correctly during DND from one of our own framesPo Lu2022-04-041-0/+3
| | | | | | | | | | | | | | | | * lisp/dnd.el (dnd-handle-movement): Select the window specified in posn. * lisp/term/x-win.el (x-dnd-movement): New function. (x-dnd-movement-function): Set it as the default. * src/frame.c (delete_frame): Prevent deleting the drop source frame. * src/xterm.c (x_dnd_send_position): Set new mouse movement flags if the target window is one of our own frames. (x_dnd_begin_drag_and_drop): Call DND movement function whenever appropriate. (x_free_frame_resources): Remove useless code. (syms_of_xterm): New defvar `x-dnd-movement-function'. * src/xterm.h: Update prototypes.
* Improve behavior of dragging text to windows on top of framesPo Lu2022-04-041-1/+1
| | | | | | | | | | | | | | * 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.
* Implement missing parts of the Motif drag and drop protocolPo Lu2022-03-311-0/+2
| | | | | | | | | | | | | | | * src/xterm.c (xm_drop_start_reply): New structure. (xm_get_drag_window): Don't grab the server since this leads to weird freezes when creating the drag window. (xm_read_drop_start_reply): New function. (x_dnd_begin_drag_and_drop): Set Motif finish flag to 0. (handle_one_xevent): When starting a motif drop, set the finish flag to 1. When the receiver replies to our drop message, set the finish flag to 2 if the drop was accepted, and only clear the waiting for finish flag when a selection request for XmTRANSFER_SUCCESS or XmTRANSFER_FAILURE arrives. (x_term_init): New atoms. * src/xterm.h (struct x_display_info): New atoms.
* Implement Motif drop protocolPo Lu2022-03-311-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the second most widely implemented drag-and-drop protocol on X Windows, but seems to have some unsolvable problems (i.e. stuff will keep accumulating in the drag window as long the target lists keep changing.) The implementation is not yet complete and doesn't work with some programs. * lisp/select.el (xselect-convert-xm-special): New functions. (selection-converter-alist): Add new converters. * lisp/x-dnd.el (x-dnd-handle-motif): Ignore messages sent by the receiver. * src/xterm.c (xm_targets_table_byte_order): New enum; (SWAPCARD32, SWAPCARD16): New macros. (xm_targets_table_rec, xm_drop_start_message) (xm_drag_initiator_info, xm_drag_receiver_info): New structures. (XM_DRAG_SIDE_EFFECT, xm_read_targets_table_header) (xm_read_targets_table_rec, xm_find_targets_table_idx) (x_atoms_compare, xm_write_targets_table) (xm_write_drag_initiator_info, xm_get_drag_window) (xm_setup_dnd_targets, xm_send_drop_message) (xm_read_drag_receiver_info): New functions. (x_dnd_compute_toplevels): Correctly free some temp data. (x_dnd_get_window_proxy, x_dnd_get_window_proto) (x_set_frame_alpha): Likewise. (handle_one_xevent): If the window has no XDND proto but has motif drag receiver data, send a motif drop protocol request. (x_term_init): New atoms for Motif DND support. * src/xterm.h (struct x_display_info): Add new atoms.
* Clean up some uses of XInternAtomPo Lu2022-03-281-1/+4
| | | | | | | | | | | * src/xfns.c (x_set_undecorated, x_set_no_focus_on_map, x_window) (set_machine_and_pid_properties): Move calls to XInternAtom for static string to use previously interned atoms. (Fx_change_window_property): Use XCB if available to avoid extra call to XSync. * src/xterm.c (x_term_init): * src/xterm.h (struct x_display_info): New atoms _MOTIF_WM_HINTS and _NET_WM_PID.
* Allow dragging files from dired to windows on the same framePo Lu2022-03-251-1/+1
| | | | | | | | | | | | | | * doc/lispref/frames.texi (Drag and Drop): Document new parameter to `x-begin-drag'. * lisp/dired.el (dired-mouse-drag): Utilize new parameter. * lisp/term/haiku-win.el (x-begin-drag): Add new parameter. * src/xfns.c (Fx_begin_drag): New parameter `allow-current-frame'. Fix typo and update doc string. * src/xterm.c (x_dnd_get_window_proto): Respect `x_dnd_allow_current_frame'. (x_dnd_begin_drag_and_drop): New parameter `allow_current_frame'. * src/xterm.h: Update prototypes.
* Take window shapes into account when processing drag and dropPo Lu2022-03-251-0/+9
| | | | | | | | | | | | | | | | | | | | * configure.ac: Test for the Nonrectangular Window Shape extension. * msdos/sed1v2.inp: Update. * src/xterm.c (struct x_client_list_window): New fields for shapes. (x_dnd_free_toplevels): Free shapes. (x_dnd_compute_toplevels): Populate window shapes. (x_dnd_get_target_window_2): New function. (x_dnd_get_target_window_1): Test WM state of window before taking it into account. (x_dnd_begin_drag_and_drop): Use outer window as the initial last seen window. (x_dnd_update_state): Small fixes to frame tracking. (handle_one_xevent): Handle ShapeNotify events correctly. (x_term_init): Test for the Nonrectangular Window Shape extension. * src/xterm.h (struct x_display_info): New atom `WM_STATE'.
* Allow dragging and dropping multiple actionsPo Lu2022-03-241-1/+2
| | | | | | | | | | | | * 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.
* Improve behaviour of drag-n-drop during window manager operationsPo Lu2022-03-201-1/+1
| | | | | | | | | | | * src/xterm.c (x_dnd_begin_drag_and_drop): Select for some events on the root window. (x_dnd_update_state): New function. (handle_one_xevent): Call that function when we get some events from the root window substructure or the window manager. (x_term_init): New atom `_NET_CLIENT_LIST_STACKING'. * src/xterm.h (struct x_display_info): New atom `_NET_CLIENT_LIST_STACKING'.
* Remove unused fns/data and make fns staticPaul Eggert2022-03-191-4/+0
| | | | | | | | | | | | | | | | | | | | | * src/comp.c (saved_sigset, helper_temp_output_buffer_setup): Remove; unused. * src/comp.c (logfile, helper_link_table): * src/fns.c (hashfn_equal, hashfn_eql): * src/frame.c (frame_windows_min_size): * src/gnutls.c (emacs_gnutls_global_init): * src/minibuf.c (Vcommand_loop_level_list): * src/syntax.c (syntax_code_spec): * src/timefns.c (time_overflow): * src/xterm.c (x_xrender_color_from_gc_foreground) (x_display_set_last_user_time): Now static, since it’s not used elsewhere. * src/xterm.c (x_xrender_color_from_gc_foreground) (x_xrender_color_from_gc_background): Move earlier to avoid forward use. (x_xrender_color_from_gc_foreground): Do not define unless !defined USE_CAIRO && (RENDER_MAJOR > 0 || RENDER_MINOR >= 2), since it’s not used otherwise.
* Handle composite overlay window during drag and drop sessionsPo Lu2022-03-191-0/+9
| | | | | | | | | | | | | | * configure.ac: Test for the composite extension and use it if available. * msdos/sed1v2.inp: Update. * src/Makefile.in (XCOMPOSITE_LIBS, XCOMPOSITE_CFLAGS): New variables. (EMACS_CFLAGS, LIBES): Add new libs and cflags. * src/xterm.c (x_dnd_get_target_window): Look for proxy on composite overlay window if mapped. (x_term_init): Test if the composite extension is available. * src/xterm.h (struct x_display_info): New fields for composite extension presence.
* Better handle drag-and-drop from one Emacs frame to anotherPo Lu2022-03-161-1/+2
| | | | | | | | | | | | | | * 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.
* Add support for dragging text from Emacs to other programsPo Lu2022-03-161-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Improve reliaibility of scroll bar dimensions adjustment on GTK 3Po Lu2022-03-131-0/+4
| | | | | | | | | | * src/gtkutil.c (xg_scroll_bar_size_allocate_cb): New function. (xg_finish_scroll_bar_creation): Attach new signal. (xg_update_scrollbar_pos) (xg_update_horizontal_scrollbar_pos): Also set window dimensions for the event box. * src/xterm.c (x_scroll_bar_configure): New function. * src/xterm.h: Update prototypes.
* Implement customization of scroll bar colors on GTK 3Po Lu2022-03-111-0/+7
| | | | | | | | | | | | * src/gtkutil.c (xg_create_frame_widgets): Create CSS providers for scroll bars. (xg_finish_scroll_bar_creation): Attach created CSS providers. * src/xfns.c (x_set_scroll_bar_foreground): (x_set_scroll_bar_background): Put appropriate content into CSS providers. * src/xterm.c (x_free_frame_resources): Free CSS providers. * src/xterm.h (struct x_output): New fields for scroll bar stylesheet providers.
* Fix more uses of opaque Visual structurePo Lu2022-03-081-1/+1
| | | | | | | | | | | | * src/image.c (x_kill_gs_process): * src/xfaces.c (x_free_colors): (x_free_dpy_colors): * src/xfns.c (Fxw_display_color_p): (Fx_display_grayscale_p): (Fx_display_visual_class): * src/xterm.c (x_copy_color): * src/xterm.h (x_mutable_colormap): Stop using private fields of Visual.
* Correctly handle exposure in oldXMenuPo Lu2022-03-071-1/+1
| | | | | | | | | | | | * oldXMenu/Activate.c (XMenuActivate): Call set expose_func if no pane was found. (XMenuActivateSetExposeFunction): New function. * oldXMenu/XMenu.h: New typedef `expose_func'. Update prototypes. * src/xmenu.c (x_menu_expose_event): New function. (x_menu_show): Set expose event handler. * src/xterm.c (x_dispatch_event): Make `static' only on GTK. * src/xterm.h: Expose `x_dispatch_event' on no-toolkit builds.
* Improve color handling on colormapped displaysPo Lu2022-03-071-0/+6
| | | | | | | | | | | | | * src/xfns.c (select_visual): Set `visual_info' field whenever appropriate. (x_create_tip_frame, XDisplayCells): Don't access private fields of Visual. * src/xterm.c (x_color_cells, x_alloc_nearest_color_1): Use colormap_size instead of default cell count. (XTflash, x_bitmap_icon, x_term_init): * src/xterm.h (struct x_display_info, FRAME_X_VISUAL_INFO): Stop accessing private fields of Visual.
* Reduce non-toolkit scroll bar flickerPo Lu2022-03-061-0/+5
| | | | | | | | | | | | * src/xterm.c (x_scroll_bar_create): Initialize double buffer for scroll bar. (x_scroll_bar_set_handle) (x_scroll_bar_remove, x_scroll_bar_expose): Draw to back buffer instead. (x_scroll_bar_end_update): New function. (x_scroll_bar_clear): Fill the scroll bar with the background instead when double buffered. * src/xterm.h (struct scroll_bar): New field `x_drawable'.
* Add PropertyChangeMask to the standard event setPo Lu2022-03-011-0/+1
| | | | | * src/xfns.c (x_window): Remove special Motif code. * src/xterm.h (STANDARD_EVENT_SET): Add PropertyChangeMask.
* Intern server time property during terminal initializationPo Lu2022-03-011-1/+2
| | | | | | | | * src/xmenu.c (create_and_show_popup_menu): Use previously interned atom. * src/xterm.c (x_term_init): New atom `EMACS_SERVER_TIME_PROP'. * src/xterm.h (struct x_display_info): New field `Xatom_EMACS_SERVER_TIME_PROP'.
* Check if WM support for NET_WM_USER_TIME_WINDOW changed during updatesPo Lu2022-02-241-2/+4
| | | | | | | | * src/xterm.c (x_display_set_last_user_time): Update the user time window if window manager support changed. * src/xterm.h (struct x_display_info): New field `last_user_check_time'.
* Add support for _NET_WM_STATE_SHADEDPo Lu2022-02-241-4/+6
| | | | | | | | | | | | | | | | | | | * doc/lispref/frames.texi (Management Parameters): Document new frame parameter `shaded'. * etc/NEWS: Announce new frame parameter. * src/frame.c (frame_parms) [HAVE_X_WINDOWS]: New frame parameter `shaded'. (syms_of_frame): New symbol `shaded'. * src/xfns.c (x_frame_parm_handlers): Install handler `x_set_shaded'. * src/xterm.c (x_set_shaded): New frame parameter handler. (x_get_current_wm_state): New parameter `shaded'. All callers changed. (x_net_wm_state): (x_handle_net_wm_state): Handle shaded state. (x_term_init): Intern new atom `shaded'. * src/xterm.h: Update prototypes.
* Condition out things specific to some versions of the input extensionPo Lu2022-02-241-15/+28
| | | | | | | | | | | * src/xterm.c (x_free_xi_devices, x_init_master_valuators) (handle_one_xevent): Condition out code that isn't supposed to be run on the current input extension version. * src/xterm.h (struct xi_scroll_valuator_t): Make conditional on HAVE_XINPUT2_1. (struct xi_touch_point_t): Make conditional on HAVE_XINPUT2_2. (struct xi_device_t): Make individual fields conditional on the appropriate client-side input extension version.
* ; * src/xterm.h: Fix typo in recent change.Po Lu2022-02-221-4/+4
|
* Improve XInput2 version checkingPo Lu2022-02-221-0/+19
| | | | | | | | | | | | | | * configure.ac: Check for various important structures from all versions of libXi. * src/xfns.c (setup_xi_event_mask): * src/xwidget.c (x_draw_xwidget_glyph_string): * src/xterm.c (x_init_master_valuators, handle_one_xevent) (x_term_init): Replace XI version checks based on protocol headers with new constants. * src/xterm.h (HAVE_XINPUT2_1, HAVE_XINPUT2_2, HAVE_XINPUT2_3) (HAVE_XINPUT2_4): New definitions.
* Ignore modifier keys early when handling X key press eventsPo Lu2022-02-201-0/+3
| | | | | | | | | * src/xterm.c (handle_one_xevent): Ignore modifier keys earlier without going through the usual key lookup. (x_delete_terminal): Free recorded modifier map. (x_find_modifier_meanings): Record modifier map. * src/xterm.h (struct x_display_info): New field `modmap'.
* Ensure bad values don't leak into scroll valuators after DeviceChangePo Lu2022-02-141-0/+1
| | | | | | | | | | * src/xterm.c (xi_reset_scroll_valuators_for_device_id): New argument `pending_only'. (handle_one_xevent): Reset pending scroll valuators on XI_Enter and mark valuators updated via DeviceChanged events as pending. * src/xterm.h (struct xi_scroll_valuator_t): New field `pending_enter_reset'.
* Stop quering for Xinerama inside x_get_monitor_attributesPo Lu2022-02-131-0/+4
| | | | | | | | * src/xfns.c (x_get_monitor_attributes): Remove Xinerama check and use xinerama_supported_p instead. * src/xterm.c (x_term_init): Set `xinerama_supported_p' * src/xterm.h (struct x_display_info): New field `xinerama_supported_p'.
* Fix fallout from switch to 32-bit visualsPo Lu2022-02-111-7/+1
| | | | | | * src/xfns.c (x_decode_color): Make return type wide enough to hold any pixel value. * src/xterm.h (x_make_truecolor_pixel): Simplify.
* Add support for _NET_WM_USER_TIME_WINDOWPo Lu2022-02-091-1/+7
| | | | | | | | | | | * src/xterm.c (x_make_frame_visible): (x_display_set_last_user_time): Use and set user time window if the WM supports it. (x_term_init): Intern new atom. * src/xterm.h (struct x_display_info): New atom `_NET_WM_USER_TIME_WINDOW'. (struct x_output): New field `user_time_window'.
* Implement _NET_WM_USER_TIME protocolPo Lu2022-02-091-10/+4
| | | | | | | | | | | | * src/xterm.c (x_display_set_last_user_time): Set user time on the active window. (handle_one_xevent): Only set user time when the user actually interacted with Emacs. (x_make_frame_visible): Set user time if non-zero. (x_term_init): Intern `_NET_WM_USER_TIME'. * src/xterm.h (struct x_display_info): New field `Xatom_net_wm_user_time'. (x_display_set_last_user_time): Implement in xterm.c instead.
* Explictly specify whether or not to respect alpha-background on CairoPo Lu2022-02-091-2/+2
| | | | | | | | | * src/ftcrfont.c (ftcrfont_draw): Don't respect `alpha-background' if drawing cursor. (bug#53890) * src/xterm.c (x_set_cr_source_with_gc_foreground): (x_set_cr_source_with_gc_background): New parameters `respect_alpha_background'. All callers changed. * src/xterm.h: Update protoypes.
* Implement frame resize synchronization on GTK 3Po Lu2022-02-081-0/+3
| | | | | | | | | * src/xterm.c (XTframe_up_to_date): (handle_one_xevent): Use the GTK frame clock to implement frame resize synchronization. * src/xterm.h (struct x_output): New variable `xg_sync_end_pending_p'.
* Don't allow tooltips to be transient for override redirect windowsPo Lu2022-02-081-0/+2
| | | | | | | | | * src/xfns.c (Fx_show_tip): Delete WM_TRANSIENT_FOR if the child window is override-redirect. * src/xterm.c (x_term_init): Intern new atom. * src/xterm.h (struct x_display_info): New atom `Xatom_wm_transient_for'.
* Make menus work better on X toolkit builds with XInput 2Po Lu2022-02-071-0/+4
| | | | | | | | | | * src/xmenu.c (popup_get_selection): Translate some important XI2 events into events the toolkit can understand. (x_activate_menubar): (create_and_show_popup_menu): Clear grab regardless of reported status on Motif. * src/xterm.c (xi_device_from_id): Export function. * src/xterm.h: Update prototypes.
* Add support for EWMH extended frame synchronizationPo Lu2022-02-061-2/+6
| | | | | | | | | | | | | * src/xfns.c (Fx_create_frame): Populate both counter variables. * src/xterm.c (XTframe_up_to_date): (handle_one_xevent): Support extended synchronization. (x_free_frame_resources): Destroy extended counter. (x_term_init): Intern new atom _NET_WM_FRAME_DRAWN. * src/xterm.h (struct x_display_info): New atom `_NET_WM_FRAME_DRAWN'. (struct x_output): New fields for extended counter tracking. (FRAME_X_EXTENDED_COUNTER): New macro.
* Add support for basic syncing with the window manager on resizePo Lu2022-02-051-4/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is handled by GTK 3, so the code is disabled on that specific build. On other builds, this eliminates any unexposed part of a frame from showing up after a resize when `frame-resize-pixelwise' is t. * configure.ac: Check for the X Synchronization Extension if present. * src/Makefile.in (EMACS_CFLAGS): (LIBES): Add XSYNC_LIBS and XSYNC_CFLAGS. * src/xfns.c (append_wm_protocols): Declare `_NET_WM_SYNC_REQUEST' support if appropriate. (x_window): Adjust location of call to `append_wm_protocols' on Xt version to prevent it from being overwritten. (Fx_create_frame): Create basic counter. * src/xterm.c (XTframe_up_to_date): Set counter value to the one asked for by the window manager. (handle_one_xevent): Handle _NET_WM_SYNC_REQUEST. (x_free_frame_resources): Free frame counter if present. (x_term_init): Test for XSync and set fields accordingly. * src/xterm.h (struct x_display_info): New fields for XSync support and new atoms. (struct x_output): New fields for counter status. (FRAME_X_BASIC_COUNTER): New macro.
* Implement _NET_WM_PING protocolPo Lu2022-02-051-1/+1
| | | | | | | | | | * src/xfns.c (append_wm_protocols): New function. (x_window): Call `append_wm_protocols' after window creation. * src/xterm.c (handle_one_xevent): Handle _NET_WM_PING client messages. (x_term_init): Intern _NET_WM_PING atom. * src/xterm.h (struct x_display_info): New field `Xatom_net_wm_ping'.
* Make fringe bitmaps respect alpha-backgroundPo Lu2022-02-011-0/+1
| | | | | | * src/xterm.c (x_draw_fringe_bitmap): Respect alpha-background on non-overlay fringe bitmaps. * src/xterm.h (struct x_display_info): New field `alpha_mask'.
* Improve portability of alpha channel handling on TrueColor visualsPo Lu2022-01-311-4/+7
| | | | | | | | | | | | | | | | * src/xfns.c (select_visual): Always ask for a TrueColor visual. * src/xfont.c (xfont_draw): * src/xftfont.c (xftfont_draw): Test `alpha_bits' instead of n_planes. * src/xterm.c (x_fill_rectangle, x_clear_rectangle): Likewise. (x_query_colors, x_alloc_nearest_color): Remove code that hard-coded alpha mask. (x_term_init): Calculate alpha bits and offset and populate field appropriately. * src/xterm.h (struct x_display_info): New fields `alpha_bits' and `alpha_offset'. (x_make_truecolor_pixel): Stop hardcoding the value of the alpha mask.