1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 15:04:36 +03:00
Commit Graph

200 Commits

Author SHA1 Message Date
Wez Furlong
fc53b3969a rustfmt 2019-12-01 15:24:03 -08:00
Wez Furlong
b3f23bbf4a fixup some build and test warnings 2019-12-01 13:35:34 -08:00
Wez Furlong
0edceea972 fix compilation on macos 2019-12-01 10:16:14 -08:00
Wez Furlong
3059488753 window: wayland: round up for pixel->surface conversion 2019-12-01 09:32:35 -08:00
Wez Furlong
d53553491a window: wayland: tidy up some scaling code 2019-12-01 09:26:46 -08:00
Wez Furlong
f15f556054 wayland: add config option to avoid using it
Just in case!
2019-12-01 07:56:41 -08:00
Wez Furlong
70f09ef1b4 fix window size calculation when scaling changes
I noticed that we were relatively undersized for newly created
windows; there were two problems:

1. We weren't propagating the old rows and cols counts through
   to the speculative resize.
2. The speculative resize wasn't implemented on wayland, and
   needs a surprising amout of work to actually make the resize
   take effect.
2019-11-30 21:27:03 -08:00
Wez Furlong
1960655915 window: wayland: fix segfault on shutdown 2019-11-30 17:35:58 -08:00
Wez Furlong
c1fc335115 window: wayland: implement mouse cursor changing 2019-11-30 17:08:53 -08:00
Wez Furlong
fb54329f6b window: wayland: tidy up some debugging 2019-11-30 13:32:45 -08:00
Wez Furlong
18d9fabe9f window: wayland: don't lose keystrokes after clicking titlebar 2019-11-30 13:30:37 -08:00
Wez Furlong
317d3105bc window: wayland: fix routing of point and data events
Like the keyboard, the point and data related events are seat
centric and we need to manage our own routing to windows.
2019-11-30 13:05:19 -08:00
Wez Furlong
29a6c62b6c window: wayland: fix routing of keyboard events
The seat is a global thing, so we need to track the active
surface and route events to the appropriate window.
2019-11-30 10:00:34 -08:00
Wez Furlong
2d6d54bfab window: wayland: scale scroll values by dpi factor
Otherwise it feels eg: twice as hard to scroll when the factor is
set to 2x.
2019-11-30 07:52:00 -08:00
Wez Furlong
718b1fb535 window: wayland: make dpi values for sw and gl the same
Make the numbers consistent with each other
2019-11-30 07:29:24 -08:00
Wez Furlong
9d1b253379 window: wayland: more clearly distinguish inactive titlebar 2019-11-29 22:18:16 -08:00
Wez Furlong
1f11c82751 window: wayland: improve mouse event processing latency
Use a similar queueing technique as with the window size events
2019-11-29 22:03:36 -08:00
Wez Furlong
9085f118d5 window: tidy up some debug prints around selection 2019-11-29 19:16:37 -08:00
Wez Furlong
c3447930b7 window: wayland: queue Configure/Resize/Close events
This makes eg: window resizing a bit more smooth and responsive
2019-11-29 18:51:47 -08:00
Wez Furlong
2475969eca window: enable egl support for wayland 2019-11-29 18:05:09 -08:00
Wez Furlong
c03eda1279 window: fixup clipboard on macos 2019-11-29 12:47:56 -08:00
Wez Furlong
2b795aa08d window: fix build and clipboard on Windows 2019-11-29 12:32:30 -08:00
Wez Furlong
478d1f53bc window: bring back our own x11 clipboard handling
revives the guts of the x11 clipboard code from back in
d69c718a73
2019-11-29 12:18:52 -08:00
Wez Furlong
4ef20480c5 wayland: implement clipboard
This was honestly a PITA because of its complexity.  The `clipboard`
crate (now dropped as a dep) didn't support wayland, so I looked at
the `smithay-clipboard` crate, which caused all of my input to become
laggy just by enabling it--even without actually copying or pasting!

Both of those crates try to hide a number of details of working with
the clipboard from the embedding application, but that works against
our window crate implementation, so I decided to integrate it into
the window crate using Futures so that the underlying IPC timing and
potential for the peer to flake out are not completely hidden.

This first commit removes the SystemClipboard type from wezterm
and instead bridges the window crate clipboard to the term crate
Clipboard concept.

The clipboard must be associated with a window in order to function
at all on Wayland, to we place the get/set operations in WindowOps.

This commit effectively breaks the keyboard on the other window
environments; will fix those up in follow on commits.
2019-11-29 12:17:52 -08:00
Wez Furlong
c84a3f6c4c window: wayland: refresh decorations more proactively 2019-11-28 09:56:25 -08:00
Wez Furlong
00b9f188f3 window: improve avx bounds check 2019-11-28 09:00:13 -08:00
Wez Furlong
21284ce6d5 window: allow wayland and x11 to co-exist
This is a pretty gross and coarse "smash them together" commit.
There is some redundancy between the two connection and window
impls that I'd like to unify later, but this lets us build with
support for both systems for now.
2019-11-28 08:55:14 -08:00
Wez Furlong
edbdda697a window: wayland: clean up window lifecycle and shutdown 2019-11-28 00:46:42 -08:00
Wez Furlong
eb953a511c window: wayland: improve keyboard mapping 2019-11-28 00:22:56 -08:00
Wez Furlong
c63766ffe2 window: wayland: input mostly working, and hidpi output
Some key mappings are not done yet (arrows!) and need to make
opengl work, but this can run a basic wezterm with the software
renderer under wayland.
2019-11-27 22:00:44 -08:00
Wez Furlong
51ada155df window: initial wayland render support 2019-11-27 16:39:00 -08:00
Wez Furlong
517084ff2f clippy 2019-11-24 07:20:41 -08:00
Wez Furlong
10a0006eaf window: fix build for examples post mouse coords changes 2019-11-23 16:46:46 -08:00
Wez Furlong
bbe9c6e14b window: Windows: allow dragging by the tab bar 2019-11-23 16:43:25 -08:00
Wez Furlong
ef0f53ab7b window: Windows: fix mouse screen coordinates 2019-11-23 16:00:27 -08:00
Wez Furlong
a28e4c0e1e allow dragging by the tab bar on macOS 2019-11-23 14:05:39 -08:00
Wez Furlong
349a24ccd9 allow dragging by tab bar on linux
This works with X11 on fedora, but the window movement is ignored
by the xwayland machinery on chromeos.
2019-11-23 11:46:03 -08:00
Wez Furlong
01eaa7db08 window: adopt Point for mouse coordinates
and allow them to be signed again
2019-11-23 08:48:09 -08:00
Wez Furlong
14fbf43485 promise: more properly implement Future::poll
The future won't ever complete if you don't connect the waker
from the context!

Prove this out by making the windowops functions async and
verifying them in the async example
2019-11-23 08:16:12 -08:00
Wez Furlong
152874dd23 window: fixup the async example for stable async 2019-11-23 08:16:12 -08:00
Wez Furlong
4e1cfe01a8 linux: fix potentially busy loop
I introduced this issue with the recent rate limiting changes.  If we
generated sufficient events to fill the pipe buffer and trigger an
EAGAIN on the write side of the pipe, we'd end up in a state where epoll
would continually wake us up to deal with it, but because we gated
reading from the pipe on having entries in the queue we could decide
that there was nothing to do and leave the pipe unread.

This commit adjusts things so that we always try to read some data from
it.

This is OK because we're using the pipe to knock the main thread out of
a sleep rather than as the definitive count of events.
2019-11-22 14:06:17 -08:00
Wez Furlong
95900dc0a5 add some debug to SpawnQueue::has_any_queued
I'm seeing occasional 100% cpu usage on my linux system and I'm
not sure if its just because I'm running a stale binary.
I added this (commented out in this commit, but live on my local
system) debug print to help understand it.
2019-11-22 07:08:22 -08:00
Wez Furlong
a5ece82d69 fix compilation on macos
refs: https://github.com/wez/wezterm/issues/65
2019-11-21 18:31:02 -08:00
Wez Furlong
6787512d62 avoid busy looping over the spawn queue
Refs: https://github.com/wez/wezterm/issues/65
2019-11-21 18:20:59 -08:00
Wez Furlong
06da330087 add low pri spawn queue
Refs: https://github.com/wez/wezterm/issues/65
2019-11-21 18:20:17 -08:00
Wez Furlong
b3032f8a5a window: macos: yes starvation fix
Similar to b83a63126c, this helps
to avoid starving the gui events.

Refs: Refs: https://github.com/wez/wezterm/issues/65
2019-11-21 17:34:01 -08:00
Wez Furlong
b83a63126c fix a starvation issue on linux/x11 systems
The `SpawnQueue::run_impl` would loop until it had exhausted
all queued items.  This prevents returning to the main loop
and resulted in the UI hanging while eg: `yes` was running,
and could also block accepting keyboard input, which is
pretty bad.

In addition, the queue implementation could fill up a pipe
and block the write side while it held a lock, which in
turn would prevent the read side from making room for the
write to succeed!

This commit changes the behavior on linux to change the wakeup
behavior of the queue from having a 1:1 relationship between
enqueue:wakeup to n:m where n and m are both >= 1.  This is
sufficient to wake a sleeping gui thread.  The gui thread
can then pop and process a single item at a time, interleaved
with dispatching the gui events.

The result is a bit more responsive, however, there is no
backpressure from the gui to the read side, so if the read
side is eating 2MB/s of data and the GUI side is processing
less than this, then an interrupt signal may still take a
few seconds to take effect.

I have mixed feelings about adding backpressure, because
I'm not sure that it is worth actually rendering all of
the parsed output text when there is a lot of it.

I need to follow up and verify these changes on macOS
and Windows too.

Refs: https://github.com/wez/wezterm/issues/65
2019-11-21 16:53:01 -08:00
Wez Furlong
6289c08a4e Adopt CSI u modifier encoding for keypresses
See http://www.leonerd.org.uk/hacks/fixterms/ for the specification.

Refs: https://github.com/wez/wezterm/issues/63
2019-11-16 13:38:03 -08:00
Wez Furlong
58d4a0a020 remove local workaround for core-foundation UB issue
My fixes landed upstream in 0a3ac83c1b
and are released already to crates.io
2019-11-13 00:05:55 -08:00
Wez Furlong
3ec3caf8f4 fix type in callback definition 2019-11-11 20:23:38 -08:00