Daniel Eklöf
33744ebe63
input: fix 'unused variable' warning (release builds)
2020-02-29 15:29:58 +01:00
Daniel Eklöf
73133c10ee
input: cleanup
2020-02-29 15:29:00 +01:00
Daniel Eklöf
e496d81f4d
input: don't update xcursor on keyboard enter/leave
...
I'm not sure why I added this in the first place... our cursor doesn't
depend on keyboard focus.
Furthermore, with CSDs, we may get keyboard enter events for the CSD
surfaces, and these should definitely *not* update the xcursor
as if it was inside the main surface.
2020-02-29 13:04:18 +01:00
Daniel Eklöf
43b07b122a
input: csd: add a small delay before initiating a move
...
This ensures the user has time to double-click to toggle the maximized
state.
2020-02-29 12:56:04 +01:00
Daniel Eklöf
c917a74f48
wayland: remove all usages of wayl_terminal_from_surface()
...
Use the 'user data' pointer from the wayland surface instead.
2020-02-29 12:13:58 +01:00
Daniel Eklöf
43c0551806
wayland: store pointer to window instance in all surfaces
2020-02-29 12:09:28 +01:00
Daniel Eklöf
1091d1c078
input: reset mouse state on pointer leave
2020-02-29 12:08:59 +01:00
Daniel Eklöf
4ee5a81d1a
input: toggle maximized state when double-clicking the title bar
2020-02-29 11:56:16 +01:00
Daniel Eklöf
7b51d6919d
input: handle double/triple click state regardless of surface
2020-02-29 11:55:43 +01:00
Daniel Eklöf
d48a789412
input: handle CSD border corners correctly
...
That is, change to correct cursor, and do resize correctly.
2020-02-29 09:32:22 +01:00
Daniel Eklöf
d863ea8a46
input: temporary code to trigger maximize/minimize
2020-02-26 13:23:11 +01:00
Daniel Eklöf
c0e3db1712
input: wip: trigger move/resize when left-clicking CSD
2020-02-25 20:31:13 +01:00
Daniel Eklöf
551170d940
input: pointer-motion/button: ignore actions in non-main surfaces
2020-02-24 22:42:04 +01:00
Daniel Eklöf
7b18f8394e
input: pointer-leave: reset 'active-surface' in terminal
2020-02-24 22:41:46 +01:00
Daniel Eklöf
d303084a81
input: pointer-enter: differentiate between the surfaces
2020-02-24 22:40:24 +01:00
Daniel Eklöf
d804bc8579
term: resize: pre-calculate right/bottom margins
2020-02-24 18:38:11 +01:00
Daniel Eklöf
e5253ca737
input: fix xcursor getting stuck
...
Apparently, a frame callback for the cursor surface is *never*
triggered if we get a pointer-leave event *before* the callback is
triggered. At least on Sway 1.4.
This caused the cursor being stuck, and never updating once this state
was reached.
Fix by destroying the cursor frame callback on pointer-leave.
2020-02-15 19:02:43 +01:00
Daniel Eklöf
8716430450
input: ctrl+= increases font size, not resets it
2020-02-10 21:57:55 +01:00
Daniel Eklöf
1b81c700f9
input: hook ctrl+{=,0} to term_font_size_reset()
2020-02-08 17:58:06 +01:00
Daniel Eklöf
7ca8f85cd0
input: hook ctrl+{plus/KP-Add/minus/KP-Subtract} to term_font_size_{increase,decrease}
2020-02-08 14:09:28 +01:00
Daniel Eklöf
d6ea676ef2
presentation: store input timestamp in a per-commit context
...
This should reduce the risk of mixing up an input timestamp with the
corresponding rendered frame.
2020-01-21 18:51:04 +01:00
Daniel Eklöf
a3d919a90d
input: implement metaSendsEscape and eightBitMeta
2020-01-20 18:45:14 +01:00
Daniel Eklöf
c645a4b180
input: reset XKB compose state on keyboard leave
2020-01-14 19:32:02 +01:00
Daniel Eklöf
3a108499ce
Revert "input: generate key down events on keyboard-enter"
...
This reverts commit 84739d78c6 .
2020-01-14 19:28:37 +01:00
Daniel Eklöf
84739d78c6
input: generate key down events on keyboard-enter
2020-01-13 19:59:18 +01:00
Daniel Eklöf
c80cbc9a79
input: reset modifier state on keyboard-leave
2020-01-13 19:58:57 +01:00
Daniel Eklöf
53a437007e
input: comments
2020-01-11 18:59:46 +01:00
Daniel Eklöf
fed0e5c853
input: keymap_lookup: only do lookup, don't sent to client
2020-01-11 18:40:27 +01:00
Daniel Eklöf
e658fe3da7
input: add a switch-based function that translates XKB keysym to escape data
2020-01-11 18:18:31 +01:00
Daniel Eklöf
8efedc9655
input: break out keymap lookup to a separate function
2020-01-11 17:55:45 +01:00
Daniel Eklöf
040a1cd00d
input: scroll: call term_mouse_up() once, after all term_mouse_down()
...
Note that scroll button release events are not actually sent to the
client, but this makes the code more correct, logically.
2020-01-04 21:35:38 +01:00
Daniel Eklöf
d706e68280
selection: track selection type; normal or block selection
2020-01-03 23:29:45 +01:00
Daniel Eklöf
4be3c04999
input: keyboard-leave: move comment to where it belongs
2020-01-02 19:30:34 +01:00
Daniel Eklöf
e9325b958f
term: rename term_focus_{in,out} -> term_kbd_focus_{in,out}
2020-01-02 19:29:42 +01:00
Daniel Eklöf
4ecb0ecf4d
wayland: rename focused/moused to kbd_focus/mouse_focus
2020-01-02 15:58:52 +01:00
Daniel Eklöf
5a07419096
wayland: optionally use the presentation time protocol to measure input lag
...
This adds a flag, -p,--presentation-timings, that enables input lag
measuring using the presentation time Wayland protocol.
When enabled, we store a timestamp when we *send* a key to the
slave. Then, when we commit a frame for rendering to the compositor,
we request presentation feedback. We also store a timestamp for when
the frame was committed.
The 'presented' callback then looks at the input and commit
timestamps, and compares it with the presented timestamp.
The delay is logged at INFO when the delay was less than one frame
interval, at WARN when it was one frame interval, and at ERR when it
was two or more frame intervals.
We also update statistic counters that we log when foot is shut down.
2019-12-31 15:39:40 +01:00
Daniel Eklöf
57de9feaa5
term: term_spawn_new(): new function, spawns a new foot/footclient process
...
Bind ctrl+shift+return to it
2019-12-21 15:27:17 +01:00
Daniel Eklöf
81840b4e8e
cursor blink: move reset to pty input
2019-12-19 07:23:58 +01:00
Daniel Eklöf
66b948750e
input: restart cursor blink on keyboard input
...
This makes the cursor stay unblinking while typing.
2019-12-16 21:33:44 +01:00
Daniel Eklöf
f1c876884a
input: discard canceled compose sequences
2019-12-02 21:32:09 +01:00
Daniel Eklöf
fbeb1e9610
term: mouse reporting functions no longer take modifier state
...
The mouse reporting functions are called from input when we receive
Wayland mouse events.
We used to pass the current keyboard modifier (shift, alt, ctrl, etc)
to the terminal functions.
This however is wrong, since we may receive Wayland mouse events
without having keyboard focus. When we don't have keyboard focus, the
modifier state doesn't apply to us.
Remove the modifier arguments from the terminal mouse reporting
functions. These functions now read this state directly instead, but
only when the terminal instance in question has keyboard focus.
2019-11-30 17:11:00 +01:00
Daniel Eklöf
664041d04f
input: doh! mouse_scroll: first argument to keyboard_key() is a struct wayland
...
This is the problem with void* user data pointers in callbacks...
2019-11-30 16:54:41 +01:00
Daniel Eklöf
6aa14ccdfc
input: mouse_scroll: cache XKB_KEY_Up and XKB_KEY_Down
2019-11-30 16:48:58 +01:00
Daniel Eklöf
841e20b75b
input: update xcursor on terminal with *keyboard* focus when modifiers change
2019-11-30 12:02:45 +01:00
Daniel Eklöf
2c12549f93
input: pointer-leave: reset moused *before* doing anything else
...
And update xcursor. This is currently not necessary, but doesn't hurt.
2019-11-29 22:13:19 +01:00
Daniel Eklöf
6947928a7f
input: pointer-enter: add debug log
2019-11-29 22:12:54 +01:00
Daniel Eklöf
6b9837056e
input: keyboard_leave: reset focused *before* doing anything else
...
And update xcursor. This is necessary since we may still have mouse
focus. But without keyboard focus, we don't display the 'text'
xcursor.
2019-11-29 22:11:41 +01:00
Daniel Eklöf
2956a7d472
input: keyboard/pointer_leave: warn if we didn't see corresponding enter event
2019-11-28 19:47:00 +01:00
Daniel Eklöf
a319cc813c
input: keyboard/pointer_enter: assert surface != NULL
2019-11-28 19:46:27 +01:00
Daniel Eklöf
0dd37f0a36
terminal: use the 'text' xcursor pointer whenever selection is possible
2019-11-28 19:35:47 +01:00