Commit graph

5059 commits

Author SHA1 Message Date
Daniel Eklöf
9d5ab91b6a
kitty: initial support for “report alternate key”
In this mode, the “shifted” and “base layout” keys are added to the
CSIs, as sub-parameters to the “key” parameter.

Note that this PR only implements the “shifted” key, not the “base
layout key”.

This is done by converting the original XKB symbol to it’s
corresponding UTF-32 codepoint. If this codepoint is different from
the one we use as “key” in the CSI, we add it as a sub-parameter.

Related to #319
2021-12-08 17:54:37 +01:00
Daniel Eklöf
a1c9635ed8
Merge branch 'kitty-report-associated-text'
Related to #319
2021-12-08 17:54:10 +01:00
Daniel Eklöf
21fe01099c
kitty: only emit plain text on key press- and repeat events
That is, release events always generate CSIs
2021-12-08 17:53:01 +01:00
Daniel Eklöf
e9a762f8a1
kitty: add ISO_Level{3,5}_Shift keys 2021-12-08 17:53:00 +01:00
Daniel Eklöf
69f97446fa
kitty: composed characters with “report associated text”
The generic input handler now converts the composed character to it’s
UTF-32 equivalent. This means we now provide a valid UTF-32 codepoint
for both composed characters, and non-composed (plain-text)
characters.

Use this in the kitty protocol to simplify the logic around composed
characters, by simply treating them as plain text.
2021-12-08 17:53:00 +01:00
Daniel Eklöf
78666d248a
kitty: implement “report associated text”
In this mode, key events that generate text now add a third CSI
parameter, indicating the actual codepoint.

Remember that we always use the *unshifted* key in the CSI
escapes. With this mode, those CSI escapes now also included the text
codepoint. I.e. what would have been emitted, had we not generated a
CSI escape.

As far as I can tell, this mode has no effect unless “report all keys
as escape sequences” is enabled (reason being, without that, there
aren’t any text events that generate CSIs - they’re always emitted
as-is).

Note that Kitty itself seems to be somewhat buggy in this mode. At
least on Wayland, with my Swedish layout. For example ‘a’ and ‘A’ does
generate the expected CSIs, but ‘å’ and ‘Å’ appears to be treated as
non-text input.

Furthermore, Kitty optimizes away the modifier parameter, if no
modifiers are pressed (e.g. CSI 97;;97u), while we always emit the
modifier (CSI 97;1;97u).

Related to #319
2021-12-08 17:53:00 +01:00
Daniel Eklöf
21e62442fd
Merge branch 'uri-range-erase-overwrite-crash' 2021-12-08 17:52:24 +01:00
Daniel Eklöf
2e8c9c2fe5
grid: reload pointers into the uri range vector after inserting
Inserting elements into the URI range vector typically triggers a
vector resize. This is done using realloc(). Sometimes this causes the
vector to move, thus invalidating all existing pointers into the
vector.
2021-12-08 17:41:29 +01:00
Daniel Eklöf
de0898821e
Merge branch 'kitty-kbd-report-all-keys-as-escape-codes'
Related to #319
2021-12-06 21:59:43 +01:00
Daniel Eklöf
0e2d8429c0
input: kitty: add support for “report all keys as escape codes” 2021-12-06 19:49:52 +01:00
Daniel Eklöf
73baa4cf5f
Merge branch 'ensure-cell-dimensions-are-non-zero'
Closes #830
2021-12-06 19:47:32 +01:00
Daniel Eklöf
a62e3cdb3d
Merge branch 'kitty-kbd-event-types'
Related to #319
2021-12-04 21:59:10 +01:00
Daniel Eklöf
06c72fc8c3
term: ensure cell dimensions are non-zero
Closes #830
2021-12-04 18:41:36 +01:00
Daniel Eklöf
20c887b996
changelog: move entry to ‘unreleased’ 2021-12-04 18:32:18 +01:00
Daniel Eklöf
93a8f51b75
input: kitty: merge handling of plain-text and composed characters
All plain-text and composed characters are now printed as-is, in a
single place.

Also fix handling of “generic” keys when emitted as escapes; don’t use
the raw XKB symbol as key in the escape, convert it to a unicode code
point first. For many symbols, these are the same. But not
all.

For now, we fallback to using the symbol as is if XKB fails to convert
it to a codepoint. Not sure if we should simply drop the key press
instead.

Composed characters also need special treatment; we can’t use the
symbol as is, since it typically refers to the last key
pressed (i.e. not the composed character). And, that key is
also (usually) a special “dead” key, which cannot be converted to a
unicode codepoint.

So, what we do is convert the generated utf8 string, and (try to)
convert it to a wchar. If it succeeds, use that. If not, fallback to
using the XKB symbol (as above).
2021-12-04 18:32:07 +01:00
Daniel Eklöf
660626118a
input: reset compose state on key *releases*, not presses 2021-12-04 18:32:07 +01:00
Daniel Eklöf
6b9b03b8dd
input: kitty: treat repeating == pressed when report-events is off 2021-12-04 18:32:06 +01:00
Daniel Eklöf
4e5d1b5c79
changelog: kitty: report events 2021-12-04 18:32:06 +01:00
Daniel Eklöf
1df94f1468
input: kitty: add support for the “report event” mode (0b10) 2021-12-04 18:32:06 +01:00
Daniel Eklöf
0193f5bd9b
input: don’t ignore key release events
Before this, key release events stopped the repeat timer, and then
returned.

Now, we run through the entire function. Most things are still only
done on key press events. But, the goal here is to get to the keyboard
protocol functions (and the kitty protocol in particular), and call
them on release events too.

This is in preparation for the kitty protocol mode 0b10, report event
types.
2021-12-04 18:32:06 +01:00
Daniel Eklöf
81233e092c
pgo: stub get_current_modifiers() 2021-12-04 18:29:58 +01:00
Daniel Eklöf
ecfff42300
Merge branch 'configure-select-override-mods' 2021-12-04 18:27:03 +01:00
feeptr@codeberg.org
a6c543a32c improve documentation for [mouse-bindings].selection-override-modifiers 2021-12-04 16:22:33 +00:00
feeptr@codeberg.org
a15c6025ec config: improve error reporting when selection-override-modifiers conflict with mouse bindings 2021-12-04 01:33:25 +00:00
Daniel Eklöf
a9eb71d2f9
install: add UTF-8 locate to runtime deps 2021-12-03 22:46:09 +01:00
Daniel Eklöf
67b8dc9d1e
install: update instructions on how to manually compile the terminfo 2021-12-03 22:44:35 +01:00
feeptr@codeberg.org
9e111118d6 config: move button_map out of value_to_mouse_combos for reuse
this mapping is only available here or in libevdev (libevdev_event_code_get_name) and it's simpler to factor it out here
2021-12-02 18:47:43 -05:00
feeptr@codeberg.org
b52cd67467 config, doc, changelog: move selection-override-modifiers to [mouse-bindings] and validate other case
specifically, check for conflicts both when mouse bindings are set and when the selection-override-modifiers setting itself is set
2021-12-02 18:47:41 -05:00
feeptr@codeberg.org
46cadee80f config: parse 'none' as empty modifiers value 2021-12-02 18:47:07 -05:00
feeptr@codeberg.org
300acda813 changelog: list new mouse.selection-override-modifiers option 2021-12-02 23:47:04 +00:00
feeptr@codeberg.org
fade19b512 doc: document select-override-mods 2021-12-02 18:44:08 -05:00
feeptr@codeberg.org
a4d53bdf88 config, input: allow configuring select-override modifiers 2021-12-02 18:44:08 -05:00
Daniel Eklöf
281127cae1
changelog: add new ‘unreleased’ section 2021-12-02 20:36:09 +01:00
Daniel Eklöf
647ab9578a
Merge branch 'releases/1.10' 2021-12-02 20:35:44 +01:00
Daniel Eklöf
46994a3e25
meson: bump version to 1.10.2 2021-12-02 20:26:59 +01:00
Daniel Eklöf
5a59bbdb71
changelog: prepare for 1.10.2 2021-12-02 20:26:42 +01:00
Daniel Eklöf
f9da959aa9
Merge branch 'master' into releases/1.10 2021-12-02 20:25:19 +01:00
Daniel Eklöf
758b0205db
Merge branch 'osc4-dont-modify-rgb-colors'
Closes #678
2021-12-01 20:08:23 +01:00
Daniel Eklöf
a3016a6cc9
osc-4: don’t update the color of cells with RGB fg/bg colors
OSC 4/104 changes the 256-color palette. We also run a pass over the
visible cells, and update their colors.

This was previously done by comparing the actual color of the cell,
with the “old” color in the palette. If they matched, the cell was
updated.

This meant that cells with an RGB color (i.e. not a palette based
color) was also updated, _if_ its color matched the palette color.

Now that each cell tracks its color *source*, we can ignore all
non-palette based cells.

Note that this still isn’t perfect: if the palette contains multiple
entries with the same color, we’ll end up updating the “wrong” cells.

Closes #678
2021-12-01 20:07:53 +01:00
Daniel Eklöf
1619e83c13
input: always update the xcursor shape in pointer enter/motion events
Now that term_xcursor_update_for_seat() takes the current surface into
account (i.e. doesn’t assume the cursor is over the main grid),
there’s no longer any need to call render_xcursor_set() directly.

Thus, we can simply call term_xcursor_update_for_seat() on **all**
pointer enter and motion events. As long as we take care to update the
internal state to reflect the, possibly new, current surface before
doing so.

Also make sure to **always** reset the seat’s “current” xcursor
pointer on pointer leave events. This is done without actually sending
anything to the compositor, but is necessary to ensure that we *do*
send a request to update the xcursor on the next pointer enter event.
2021-12-01 20:04:01 +01:00
Daniel Eklöf
63e8b1b292
input: fix debug log format specifier; ‘count’ is a size_t 2021-12-01 20:03:18 +01:00
Daniel Eklöf
1752745fcf
pgo: add stub for xcursor_for_csd_border() 2021-11-30 22:43:41 +01:00
Daniel Eklöf
b3029234af
term: xcursor_update_for_seat(): BUG on xcursor == NULL 2021-11-30 22:25:32 +01:00
Daniel Eklöf
fce13c4106
input: make csd_data variable ‘const’ 2021-11-30 22:15:13 +01:00
Daniel Eklöf
59e6285037
term: xcursor_update_for_seat(): remove duplicate check for term->is_searching 2021-11-30 22:14:05 +01:00
Daniel Eklöf
bfbb4b0830
term: xcursor_update_for_seat(): remove switch default case
Let the compiler catch missing enum values
2021-11-30 22:12:56 +01:00
Daniel Eklöf
fd82fb81fa
changelog: window-menu 2021-11-30 22:12:17 +01:00
Daniel Eklöf
90cfdcf1a5
Merge branch 'window-menu' 2021-11-30 22:10:27 +01:00
Daniel Eklöf
55f592b210
Merge branch 'csd-border-render-glitch'
Closes #823
2021-11-29 21:09:15 +01:00
Daniel Eklöf
3afe317e46
render: fix csd border rendering glitch when width > 5px
CSD borders are always *at least* 5px. If url.border-width=0, those
5px are all fully transparent (and act as interactive resize handles).

As csd.border-width increases, the number of transparent pixels
decrease. Once csd.border-width >= 5, the border is fully opaque.

When csd.border-width > 5, then width of the border is (obviously)
more than 5px. But, when rendering the opaque part of the border, we
still used 5px for the invisible part, which caused some pixman
rectangles to have negative x/y coordinates.

This resulted in rendering glitches due to overflows in pixman when
rendering the borders.

The fix is to ensure the total border size is always at least, but
not *always* 5px. That is, set it to max(5, csd.border-width).

This patch also fixes an issue where the CSD borders were not
dimmed (like the titlebar) when the window looses input focus.

Closes #823
2021-11-29 19:32:49 +01:00