aboutsummaryrefslogtreecommitdiff
path: root/selection.h (follow)
Commit message (Collapse)AuthorAgeLines
* seat: use separate 'enter' serials for keyboard and mouseDaniel Eklöf2020-07-09-1/+1
|
* multi-seat: improve handling of multiple (mouse) pointersDaniel Eklöf2020-07-09-1/+1
| | | | | | | | * xcursor always set for all pointers * xcursor sometimes not updated when it should be * mouse grabbed state wasn't per seat, but global (i.e. "does at least one seat enable mouse grabbing") * selection enabled state wasn't per seat
* multi-seat: re-enable selection support (excluding OSC 52)Daniel Eklöf2020-07-08-13/+22
|
* selection: handle viewport wrap around correctlyDaniel Eklöf2020-05-19-0/+3
| | | | | When the viewport wraps around, the selection points may be "incorrect".
* term: scrolling: hopefully fix all selection/scrolling related crashesDaniel Eklöf2020-05-17-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When scrolling, there are a couple of cases where an existing selection must be canceled because we cannot meaningfully represent it after scrolling. These are when the selection is (partly) inside: * The top scrolling region * The bottom scrolling region * The new lines scrolled in. I.e. re-used lines For the scrolling regions, the real problem is when the selection crosses the scrolling region boundary; a selection that is completely inside a scrolling regions _might_ be possible to keep, but we would need to translate the selection coordinates to the new scrolling region lines. For simplicity, we cancel the selection if it touches the scrolling region. Period. The last item, newly scrolled in lines is when the selection covers very old lines and we're now wrapping around the scrollback history. Then there's a fourth problem case: when the user has started a selection, but hasn't yet moved the cursor. In this case, we have no end point. What's more problematic is that when the user (after scrolling) moves the cursor, we try to create a huge selection that covers mostly empty (NULL) rows, causing us to crash. This can happen e.g. when reverse scrolling in such a way that we wrap around the scrollback history. The actual viewport in this case is something like `-n - m`. But the selection we'll end up trying to create will be `m - (rows - n)`. This range may very well contain NULL rows. To deal with this, we simply cancel the selection.
* selection/render: sync cells' 'selected' bit before renderingDaniel Eklöf2020-05-16-0/+1
| | | | | | | | | | | | | | | | | | | | | | | For performance reasons, we track whether a cell is selected or not using a bit in a cell's attributes. This makes it easy for the renderer to determine if the cells should be rendered as selected or not - it just have to look at the 'selected' bit instead of doing a complex range check against the current selection. This works nicely in most cases. But, if the cell is updated, the 'selected' bit is cleared. This results in the renderer rendering the cell normally, i.e. _not_ selected. Checking for this, and re-setting the 'selected' bit when the cell is updated (printed to) is way too expensive as it is in the hot path. Instead, sync the 'selected' bits just before rendering. This isn't so bad as it may sound; if there is no selection this is a no-op. Even if there is a selection, only those cells whose 'selected' bit have been cleared are dirtied (and thus re-rendered) - these cells would have been re-rendered anyway.
* selection: on_row_in_view() -> on_rows_in_view(), and now takes a rangeDaniel Eklöf2020-05-16-1/+1
| | | | | This allows us to check the selection once when scrolling, instead of once for each scrolled in line.
* selection: add selection_extend()Daniel Eklöf2020-04-04-0/+1
| | | | | | | | | | | | | | This function extends an existing selection in the following way: If the extension point is *before* the upper boundary of the current selection, extend the selection upwards. If the extension point is *after* the bottom boundary of the current selection, extend the selection downwards. If the extension point is *inside* the current selection, shrink the selection such that the new size is maximized. This means we move the *closest* start/end point from in the current selection.
* selection: track selection type; normal or block selectionDaniel Eklöf2020-01-03-1/+2
|
* selection: document the asynchronous behavior of text_from_{primary,clipboard}Daniel Eklöf2019-11-05-1/+17
|
* selection: text_from_{clipboard,primary}: add 'done' callbackDaniel Eklöf2019-11-05-3/+4
| | | | | | | | This callback is *always* called, including when there has been an error. This is in preparation for making text_from_{clipboard,primary} asynchronous.
* osc: implement copy/paste to/from primaryDaniel Eklöf2019-08-09-1/+9
|
* input: don't paste from primary if client is mouse trackingDaniel Eklöf2019-08-09-0/+1
|
* selection/input: triple click selects an entire rowDaniel Eklöf2019-08-06-0/+1
|
* term: cancel selection when scrolling wrapsDaniel Eklöf2019-08-05-0/+1
| | | | | | | | | | If we scroll enough, we'll eventually end up wrapping around the entire scrollback buffer. At this point, a selection is no longer valid, so cancel it. Note: this was very obvious when scrolling in the alt screen, since its scrollback buffer is what you see on the screen (i.e. it has no scrollback).
* selection: mark-word using spaces only as word separatorDaniel Eklöf2019-08-05-1/+3
| | | | | When the user double-clicks with ctrl pressed, we now select the word under the cursor using spaces only as word separator.
* selection: add text_from_clipboard()Daniel Eklöf2019-07-19-0/+4
| | | | | This function reads data from the clipboard, and calls a user-provided callback for each chunk of clipboard data.
* selection: add text_to_clipboard()Daniel Eklöf2019-07-19-0/+2
| | | | This function takes a string and makes it available to the clipboard.
* selection: implement double-click-to-select-wordDaniel Eklöf2019-07-17-0/+1
|
* selection: implement copy *to* primaryDaniel Eklöf2019-07-11-1/+1
|
* selection: add support for pasting *from* primaryDaniel Eklöf2019-07-11-0/+1
|
* selection: add selection_from_primary() API (stub for now)Daniel Eklöf2019-07-11-0/+1
|
* selection: add support for pasting from clipboardDaniel Eklöf2019-07-11-0/+2
|
* selection: initial copy-to-clipboard functionalityDaniel Eklöf2019-07-11-0/+5
|
* selection: spell 'finalize' correctlyDaniel Eklöf2019-07-11-1/+1
|
* selection: add a selection APIDaniel Eklöf2019-07-11-0/+8