| Commit message (Collapse) | Author | Age | Lines |
| ... | |
| |
|
|
|
| |
Compiles and runs, but mouse, clipboard and other things have been
disabled.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the client is capturing the mouse, selection can only be done by
holding done shift.
This is why a lot of selection functions are no-ops if selection isn't
currently enabled.
However, there are many cases where we actually need to modify the
selection. In particular, selection_cancel().
Thus, only check for enabled selection when we're dealing with user
input.
Bonus: this also fixes a bug where an ongoing selection were finalized
as soon as the user released shift, even if he was still holding down
the mouse button.
|
| | |
|
| | |
|
| |
|
|
|
| |
An empty initializer still ensures the entire object is
zero-initialized.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before, we converted each axis event's scroll amount to an integer and
scrolled that many lines.
However, axis events are speed sensitive - very slow scrolling will
result in events with a scroll amount that is < 1.0.
For us, this meant we never scrolled a single line. You could slow
scroll all day if you wanted, and still we would never scroll a single
line.
Fix this by aggregating the scroll amount from axis events until the
scroll amount is > 1.0, and then scroll.
|
| | |
|
| |
|
|
|
|
|
|
| |
This enables user mappings for the left mouse button with click count
> 3
I.e. it is now possible to create custom quad-click mappings (except
we don't yet support this in footrc).
|
| | |
|
| |
|
|
|
|
|
|
| |
They aren't really user configurable. At least not yet.
However, with this, we now handle raw key codes just like the normal
key bindings. Meaning, e.g. ctrl+g, ctrl+a, ctrl+e etc now works while
searching with e.g. a russian layout.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before, when looking for a matching user key binding, we only
matched *symbols*.
This means that the physical keys that generate a specific key binding
is layout dependent. What's worse, it may not even be possible to
generate the key binding at all.
Russian is one such layout, where all the "normal" (us) symbols are
replaced.
By using raw key codes, we can get around this - the key code has a
direct mapping to the physical key.
However, matching raw key codes **only** doesn't always make sense
either. For now, match **both** symbols _and_ key codes. Symbols take
precedence.
TODO: we might have to make this configurable _per binding_.
Note: 'search' mode still uses mostly hardcoded shortcuts that still
have this problem (i.e. ctrl+g doesn't work with a russian layout).
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sway 1.4 is better than 1.2, in that we always have keyboard focus
when we get a keyboard_key() event.
That however is because it doesn't send keyboard_leave() on e.g. a TTY
switch.
Still, this is good enough - foot handles this and doesn't crash. We
are also able to process input without having to refocus the window.
And, Sway master (what will become Sway 1.5) has fixed this for real -
we now get a keyboard_leave() and pointer_leave() event on a TTY
switch. And the corresponding enter events when switching back.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
A button may only be mapped to a single action. Detect when the user
tried to map the same button to multiple actions and error out.
To clear a binding (for example, to free up a button from the default
bindings), one can set the action it is bound to to
`NONE` (e.g. `primary-paste=NONE`).
|
| |
|
|
|
|
|
|
|
|
| |
* New config section, "mouse-bindings", where bindings are defined on
the form "action=BTN_<name>
* pointer_button() handler now scans the bindings list instead of
hardcoding primary-paste to BTN_MIDDLE.
* The implementation handles single- double- and triple clicks in the
bindings, but there is currently no way to define anything but a
single-click binding in the configuration.
|
| |
|
|
| |
These actions are by default not bound to anything.
|
| | |
|
| | |
|
| |
|
|
| |
No default bindings defined yet, though.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
New actions defined and implemented:
* scrollback up/down
* font size up/down/reset
* spawn terminal
Break out key combo parsing to a new function,
parse_key_binding_for_action(). This function parses a string
containing one or more space separated key combo definitions on the
form (mod1+mod2+...+key), where key is a XKB key name (e.g. KP_Add).
Convert all hardcoded key bindings to configuration based
bindings. These still cannot actually be configured by the user, but
at least lives in the conf struct.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds initial support for defining key and mouse bindings that are
applied in different terminal modes/states.
For example, there are two arrays dealing with key and mouse bindings
in the "normal" mode. Most bindings will go here.
There's also an array for "search" mode. These bindings will be used
when the user has started a scrollback search.
In the future, there may be a model selection mode as well. Or maybe
"search" and "modal selection" will be combined into a single
"keyboard" mode. We'll see.
Since the keyboard bindings depend on the current XKB keymap,
translation from the user specified key combination string cannot be
done when loading the configuration, but must be done when we've
received a keymap from the wayland server.
We should explore if it's possible to load some kind of default keymap
just to be able to verify the validity of the key combination strings
at configuration load time, to be able to reject the configuration at
startup.
A couple of key bindings have been added as proof of concept.
Mouse bindings aren't handled at all yet, and is likely to be
re-written. For example, we can probably translate the configuration
strings at configuration load time.
|
| |
|
|
|
|
|
|
|
|
| |
Handle the CSDs and the search box the same way we handle the main
grid; when we need to redraw them, call
render_refresh_{csd,search}(). This sets a flag that is checked after
each FDM iteration. All actual rendering is done here.
This also ties the commits of the Wayland sub-surfaces to the commit
of the main surface.
|
| |
|
|
| |
This fixes repainting issues on mutter.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The user can now configure the following:
* Whether to prefer CSDs or SSDs. But note that this is only a hint to
the compositor - it may deny our request. Furthermore, not all
compositors implement the decoration manager protocol, meaning CSDs
will be used regardless of the user configuration (GNOME/mutter
being the most prominent one).
* Title bar size and color, including transparency
* Border size and color, including transparency
Also drop support for rendering the CSDs inside the main surface.
|
| |
|
|
|
| |
100ms was a bit low and prevented double-tap on touchpads from
working.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
When the user left-clicks the title-bar, we start a timer. When the
timer has elapsed, we initiate a 'move' operation.
However, if the user clicked, and then started dragging right away,
there was a very visible lag since we waited for the timeout before
starting the move.
Now, on a pointer motion event we detect a running 'move' timer, and
abort it and instead start the 'move' operation right away.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
This ensures the user has time to double-click to toggle the maximized
state.
|
| |
|
|
| |
Use the 'user data' pointer from the wayland surface instead.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
That is, change to correct cursor, and do resize correctly.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
This should reduce the risk of mixing up an input timestamp with the
corresponding rendered frame.
|
| | |
|
| | |
|
| |
|
|
| |
This reverts commit 84739d78c626ad12543417dc1e3038abd6a4e2d5.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Note that scroll button release events are not actually sent to the
client, but this makes the code more correct, logically.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
Bind ctrl+shift+return to it
|
| | |
|
| |
|
|
| |
This makes the cursor stay unblinking while typing.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
This is the problem with void* user data pointers in callbacks...
|
| | |
|
| | |
|
| |
|
|
| |
And update xcursor. This is currently not necessary, but doesn't hurt.
|
| | |
|
| |
|
|
|
|
| |
And update xcursor. This is necessary since we may still have mouse
focus. But without keyboard focus, we don't display the 'text'
xcursor.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Sway 1.2 has been seen to send pointer_button events without first
having sent pointer_enter.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When we receive a keyboard_key or pointer_motion event without first
having received a keyboard_enter or pointer_enter event (that being
the "sway bugs" part), we generally don't know _which_ terminal window
the event was intended for.
However, if we only have *one* window open (always the case for a
regular 'foot' process, or when there's a single footclient connected
to a foot server process), then obviously we can "guess" which window
the event was intended for... so do that.
Now, the only time the event is ignored is when we're a server process
with more than one window open (= more than one footclient connected).
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
I.e. what we're effectively doing is *not* repeating modifier
keys.
Besides being the "right" thing to do, this also works around another
Sway 1.2 bug, where being in a focused foot window and then switching
to a vt and back would cause us to be stuck in an endless key repeat
loop that would only stop when unfocusing, focusing back and then
unfocusing once again.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sway 1.2 has been seen sending keyboard_key() events without first
sending a keyboard_enter() event.
This can be triggered by:
1. start a foot terminal
2. unfocus it (move focus to another window)
3. switch to a vt
4. switch back to sway
5. focus the foot terminal
At this point, Sway will *not* send the keyboard_enter() event, but
instead send a keyboard_key() event.
(furthermore, if you now unfocus the window again, sway will send a
keyboard_leave() event, still without having sent a keyboard_enter()
event).
Sway has _also_ been seen crashing in wl_pointer_motion(). Though this
was in a build without proper debug information, everything points to
a similar issue - i.e. sway is sending a motion event without first
having sent an enter event.
Workaround this by detecting this and logging a warning the first time
it happens. The event is then ignored.
|
| |
|
|
|
|
|
| |
This fixes an assertion when holding in ctrl+shift+c (copy to
clipboard); subsequent "presses" would set the clipboard serial to 0,
which we would then assert on in the next iteration when we tried to
cancel the previous copy.
|
| |
|
|
|
|
|
|
| |
This happens on Sway when exiting a screen locker. Or at least that's
when we see the problem; it's unclear if the event occurs when
starting the screen locker, or when exiting it. Or maybe its both.
Anyway, don't try to unfocus a NULL-terminal.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 739c5cf7f026bd7792f94276e8d6b2587a6ff597.
The original commit stated:
Not sure why these were added here; they don't appear to be
needed (we're writing to the client - it's up to the client to echo
stuff, in which case we redraw as usual).
But, client output doesn't cause a scrollback/view reset.
|
| |
|
|
|
|
| |
Not sure why these were added here; they don't appear to be
needed (we're writing to the client - it's up to the client to echo
stuff, in which case we redraw as usual).
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Instead of passing the terminal to the wayland callbacks, pass a
'struct wayland' pointer.
|
| | |
|
| | |
|