aboutsummaryrefslogtreecommitdiffstats
path: root/src/xterm.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fix core string lookup with modifiers on XI2Po Lu2022-04-151-0/+10
| | | | | * src/xterm.c (handle_one_xevent): Clean modifiers from xkey.state before giving it to XLookupString.
* Fix calls to XKB functions without testing for server supportPo Lu2022-04-151-6/+9
| | | | | | * 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.
* Keep track of keyboard state during drag and dropPo Lu2022-04-141-7/+48
| | | | | | | | | | * 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.
* Minor fixes to menus on XI2Po Lu2022-04-141-10/+39
| | | | | | | | | | | | | | * 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'.
* Ignore XdndPosition events triggered by the wrong mouse buttonPo Lu2022-04-141-0/+2
| | | | | * src/xterm.c (x_dnd_send_position): Don't send if button is set but not a scroll wheel button.
* Add support for Xdnd features introduced after version 5Po Lu2022-04-141-10/+83
| | | | | | * src/xterm.c (x_dnd_send_position, x_dnd_update_state) (handle_one_xevent): Add support for sending button and keyboard state during DND.
* ; * src/xterm.c (x_term_init): Fix whitespace.Eli Zaretskii2022-04-131-19/+19
|
* Move raw event selection on GTK+ 2 to a more appropriate placePo Lu2022-04-131-0/+25
| | | | | | | * 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.
* Fix input availability detection during visible-bellPo Lu2022-04-131-1/+13
| | | | | * src/xterm.c (XTflash): Exit pselect loop also if input becomes available on f's display connection.
* Fix bit rot in the XEmbed codePo Lu2022-04-131-4/+14
| | | | | | | | * 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-1/+25
| | | | | | | | | * 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'.
* Fix detection of Meta key in some casesPo Lu2022-04-121-2/+5
| | | | | * src/xterm.c (x_find_modifier_meanings): Set found_meta_p correctly.
* Fix some confusing names in xterm.cPo Lu2022-04-121-40/+40
| | | | | * src/xterm.c (enum xm_targets_table_byte_order): Rename to `xm_byte_order'. All uses changed.
* Disallow drag and drop inside a menu-entryPo Lu2022-04-121-5/+21
| | | | | | | | * 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.)
* * src/xterm.c (frame_set_mouse_pixel_position): Avoid server grab.Po Lu2022-04-121-3/+4
|
* Fix selecting text and releasing the mouse buttons above the toolbarPo Lu2022-04-121-2/+13
| | | | | * src/xterm.c (handle_one_xevent): Don't send ButtonRelease events to tool bars if there is no selected tool bar item.
* Fix IM event source attribution on GTKPo Lu2022-04-111-0/+12
| | | | | | | * src/xterm.c (handle_one_xevent): Set pending times on GTK as well. * src/gtkutil.c (xg_widget_key_press_event_cb): Respect pending keystroke time on XI2.
* * src/xterm.c (handle_one_event): Make event attribution more accurate.Po Lu2022-04-111-1/+6
|
* Attribute filtered events to the right source devicePo Lu2022-04-101-0/+74
| | | | | | | | * 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'.
* Add missing details to filter event on XI2Po Lu2022-04-101-0/+9
| | | | | * src/xterm.c (handle_one_xevent): Pass coordinates when translating XI2 key events to core key events.
* Update XI2 device use on slave attachment and detachmentPo Lu2022-04-101-0/+20
| | | | | * src/xterm.c (handle_one_xevent): Update whether device is a master device when it's detached or attached.
* Try harder to own DND selectionsPo Lu2022-04-101-8/+16
| | | | | | | * src/xterm.c (x_dnd_do_unsupported_drop): Fix computation of local value. (x_dnd_begin_drag_and_drop): Try to own the selection if we do have a local value.
* Avoid sync when allowing touch events in handle_one_xeventPo Lu2022-04-091-12/+10
| | | | | | * src/xterm.c (handle_one_xevent): Don't catch errors around XIAllowTouchEvents. (x_error_handler): Ignore Device errors here instead.
* Handle hierarchy events for updating scroll valuators correctlyPo Lu2022-04-091-72/+153
| | | | | | | | | | | * src/keyboard.c (gen_help_event, kbd_buffer_store_help_event): Make sure to initialize the event buffer correctly. * src/xterm.c (xi_populate_device_from_info): New function. (x_init_master_valuators): Factor out most of the valuator tracking code to that function. (handle_one_xevent): Handle device enable and disable events in a more detailed fashion.
* Fix DND leave events not being sent to toplevel after returning framePo Lu2022-04-091-0/+69
| | | | | | * src/xterm.c (x_dnd_update_state, handle_one_xevent): Make sure to send leave events to the previous toplevel when cancelling to return a frame.
* Minor cleanups in X Windows drag-and-drop codePo Lu2022-04-091-5/+6
| | | | | | | | * src/keyboard.c (kbd_buffer_get_event): Don't dereference f if nil when generating mouse motion event. * src/xterm.c (x_dnd_send_enter, x_dnd_send_position) (x_dnd_send_leave, x_dnd_send_drop, x_send_scroll_bar_event): Use NoEventMask instead of 0.
* Fix source reporting for focus in and focus out eventsPo Lu2022-04-091-0/+11
| | | | | * src/xterm.c (handle_one_xevent): Report source name for FocusIn and FocusOut events.
* Clean up XI2 scroll valuator tracking codePo Lu2022-04-091-37/+28
| | | | | | * src/xterm.c (x_get_scroll_valuator_delta): Accept a pointer to a device instead of the device id. (handle_one_xevent): Pass the previously found device.
* Fix subpixel AA with alpha-background on Cairo on XPo Lu2022-04-091-4/+10
| | | | | | * xterm.c (x_set_cr_source_with_gc_foreground) (x_set_cr_source_with_gc_background): Set operator back to OVER if alpha-background isn't to be respected.
* Fix pacifying gcc -Wanalyzer-null-dereferencePaul Eggert2022-04-081-1/+1
| | | | | * src/xterm.c (handle_one_xevent): Use eassume not eassert. eassert (X)’s suppress_checking does not let GCC assume X.
* Ignore input extension errors caused by grabbingPo Lu2022-04-081-0/+18
| | | | | * src/xterm.c (x_error_handler): Ignore GrabDevice and UngrabDevice errors.
* Make device reporting work for tool bar clicksPo Lu2022-04-081-2/+3
| | | | | | | | | * src/dispextern.h: Update prototyupes. * src/xdisp.c (handle_tool_bar_click): Pass Qt to that function instead. (handle_tool_bar_click_with_device): New function. * src/xterm.c (handle_one_xevent): Pass device to tool bar click logic.
* * src/xterm.c (handle_one_xevent): Fix build warning on non-GTK builds.Po Lu2022-04-081-1/+4
|
* Expose the name of an event's input device to LispPo Lu2022-04-071-18/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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'.
* Fix error when calling DND movement tracking functionPo Lu2022-04-071-1/+6
| | | | | | * src/xterm.c (x_dnd_begin_drag_and_drop): Verify x_dnd_movement_x and x_dnd_movement_y are wholenums before caling posn-at-x-y.
* * src/xterm.c (xm_write_targets_table): Remove extra XGrabServer pair.Po Lu2022-04-071-2/+0
|
* Fix DND bugs on GTKPo Lu2022-04-071-3/+7
| | | | | * src/xterm.c (handle_one_xevent): Don't let some client messages reach the toolkit.
* Fix sending unsupported drops when there is no target but a toplevelPo Lu2022-04-071-0/+17
| | | | | * src/xterm.c (handle_one_xevent): Send unsupported drops to last seen toplevel if no target was found.
* Return an appropriate action when performing unsupported dropPo Lu2022-04-071-1/+6
| | | | | * src/xterm.c (x_dnd_send_unsupported_drop): Set action to XdndActionPrivate.
* Get rid of extra sync looking up window through XTranslateCoordinatesPo Lu2022-04-061-4/+27
| | | | | | * src/xterm.c (x_dnd_get_wm_state_and_proto): Return proxy as well. (x_dnd_get_target_window): Use that proxy.
* Move some X11 drag and drop processing to LispPo Lu2022-04-061-37/+89
| | | | | | | | | | | | | | | * 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.
* Prevent races when trying to set Motif drag windowPo Lu2022-04-061-1/+7
| | | | | * src/xterm.c (xm_get_drag_window): Grab temp connection when setting the drag window.
* ; * src/xterm.c: Improve commentary.Po Lu2022-04-061-6/+18
|
* * src/xterm.c (x_dnd_send_unsupported_drop): Also handle TEXT target.Po Lu2022-04-061-0/+1
|
* Preserve contents of PRIMARY when sending unsupported dropPo Lu2022-04-061-1/+4
| | | | | * src/xterm.c (x_dnd_send_unsupported_drop): Set local value of PRIMARY to the preexisting selection value, if any.
* * src/xterm.c (handle_one_xevent): Assert that hold_quit is present instead.Po Lu2022-04-061-2/+3
|
* Pacify gcc -Wanalyzer-null-dereferencePaul Eggert2022-04-051-1/+2
| | | | | | * src/xterm.c (handle_one_xevent): Don’t dereference HOLD_QUIT if it’s null. Potential problem found with gcc 11.2.1 20220127 (Red Hat 11.2.1-9), when configured with --enable-gcc-warnings.
* Mark some data during drag-and-dropPo Lu2022-04-051-1/+29
| | | | | | | | | | | | | 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.
* Allow dropping text to the root windowPo Lu2022-04-051-20/+24
| | | | | | | * src/xterm.c (x_dnd_send_unsupported_drop): Allow dropping to the root window. (handle_one_xevent): Send unsupported drops to the last toplevel instead of the target window.
* Add support for dragging text onto windows that don't support any DND protocolPo Lu2022-04-051-68/+219
| | | | | | | | | | | | | | | | * 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.