Skip to content

keyboard: Delete selections correctly with delete_surrounding

Jonas Dreßler requested to merge verdre/gnome-shell:delete-surrounding into main

Apparently the region to delete that we have to pass to delete_surrounding() starts at anchor, and ends at cursor, so if "anchor < cursor" the offset must be 0. In the other case "anchor > cursor", the offset must therefore be at "-distance_between_anchor_and_cursor", ie "cursor - anchor".

This fixes the deletion of selections with gtk4 clients (it doesn't seem like there's any other client out there which reports selection anchor and cursor correctly).

Merge request reports