1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-27 12:23:46 +03:00
Commit Graph

238 Commits

Author SHA1 Message Date
Wez Furlong
75eb16bec4 move spawn_task into a new promise::spawn module 2020-01-16 03:50:48 -08:00
Wez Furlong
ac3ccab1c5 window: adopt async_task for spawn_task 2020-01-16 01:31:28 -08:00
Wez Furlong
256b4e6da8 fix pollable_channel to be non-blocking on Windows
Upgrade filedescriptor to 0.7 to use the portable helper for
setting non-blocking mode, and enable non-blocking mode on Windows.
2020-01-15 21:30:14 -08:00
Wez Furlong
ad2f724416 bump some versions 2020-01-09 22:39:34 -08:00
Wez Furlong
9670fc3fdf macos: fix minimum scroll wheel tick
macos generates fractional distance values for the mouse wheel,
with one tick starting at 0.1.  We were truncating this to a 0 row
move, which meant that you'd need to build up some acceleration to
move the rows when all you really wanted was a single tick.

This commit changes things so that we round up to at least 1.0 in this
situation.
2020-01-06 10:44:43 -08:00
Wez Furlong
180a991760 macos: add use_ime option to disable the IME
The IME stuff on macos tends to swallow repeats for some keys.
Ugh.  So this commit adds an option to disable the use of the IME.

Switching away from it effectively inverts the meanging of backspace
and delete (because our method is no longer called by the IME), so
we need to check for that and remap it.  Ugh.

Ugh.
2020-01-05 22:54:59 -08:00
Wez Furlong
59de97034a belt and suspenders to clip the copy region
a debug assertion triggers for me on macos because we were trying
to copy out of bounds.  This makes the copy routine safe again.
2020-01-05 17:58:14 -08:00
Wez Furlong
bda0a3b5fe windows: remove DoubleClick from input enums
double clicks weren't registering correctly with the new selection
logic.  Tell windows that we're doing all our own click counting
and simplify the logic.
2020-01-05 16:16:06 -08:00
Wez Furlong
048495b651 Fix x11 compilation due to bad semver bump in xcb-util
Force using xcb-util 0.2.1 precisely because 0.2.2 pulls in a
conflicting major version of xcb (0.8 -> 0.9).

It's a non-trivial upgrade: the types around xkb are different
and features need to be specified in the manifest to enable compilation
of the things that we depend upon.

In addition, xkbdcommon, on which we depend, requires xcb 0.8 and
results in pulling in two conflicting versions of the crates.

It's a bit of a painful situation and will require some effort to
figure out how to upgrade the xcb dependency, when we're ready for that.

refs: https://github.com/meh/rust-xcb-util/issues/12
2020-01-05 15:51:48 -08:00
Wez Furlong
400c8aa66d remove explicit dirty manipulation from Renderable
This commit leaves mux domains broken for the moment,
but also simplifes the implementation of the renderable interface.
2020-01-05 14:37:17 -08:00
Wez Furlong
d8701dc771 instrument executor spawn delay 2020-01-05 14:37:17 -08:00
Wez Furlong
e424a4ce6c x11: improve default wheel distance per tick
On x11 we'd get just a single line per scroll wheel tick.
Contrast with Wayland where we get multiple.

This config change makes us feel more snappy by default on X11.

I'd like to make this configurable using the live configuration
infra, but we don't currently have a way for this crate to see
that config, so this just changes the default to be "better".

refs: https://github.com/wez/wezterm/issues/92
2020-01-02 11:32:26 -08:00
Wez Furlong
b5e410e843 wayland: normalize clipboard to unix line endings on copy 2020-01-02 11:08:16 -08:00
Wez Furlong
0db15ecaf4 wayland: fix spurious resize event on focus change
The resize event would be fine except that it happens to trigger
the scroll position to reset to the bottom.
2020-01-02 11:03:12 -08:00
Wez Furlong
4b4683b1af fix focus messages on Windows
Use SETFOCUS/KILLFOCUS rather than ENABLE.

Closes: https://github.com/wez/wezterm/issues/93
2019-12-31 17:28:51 -08:00
Wez Furlong
b4b24aacca suppress warning 2019-12-30 11:11:41 -08:00
Wez Furlong
3f2e29b024 macos: fix keyboard repeat issue with backspace
wtf?  Not sure why this only impacted backspace
2019-12-30 11:09:19 -08:00
Wez Furlong
d58f1ff5dc Implement focus_change for macos
Refs: https://github.com/wez/wezterm/issues/93
2019-12-30 10:32:12 -08:00
Wez Furlong
a396a64550 Revert "wayland: implement focus_change callback"
This reverts commit bfa8d0c207,
which proved not to be needed because it was already covered
by the `KeyboardEvent::Enter` and `KeyboardEvent::Leave` handling.
2019-12-30 08:35:52 -08:00
Wez Furlong
bfa8d0c207 wayland: implement focus_change callback
Refs: https://github.com/wez/wezterm/issues/93
2019-12-29 17:17:46 -08:00
Jeremy Fitzhardinge
fce215f10f Enable focus for Windows.
Untested; passes a `cargo check`, but I'm not sure whether I've got the right
event for focus.
2019-12-29 16:58:15 -08:00
Jeremy Fitzhardinge
71acd7d2a9 Add focus tracking for Wayland 2019-12-29 16:58:15 -08:00
Jeremy Fitzhardinge
6558230c9f Implment focus_change for X11 2019-12-29 16:58:15 -08:00
Jeremy Fitzhardinge
69ed1e7aed Add focus_change to WindowCallbacks 2019-12-29 16:58:15 -08:00
Wez Furlong
bd0859bef6 Make it possible to more easily tweak atlas padding 2019-12-28 11:55:42 -08:00
Wez Furlong
0e568ea161 wayland: reduce CPU utilization by correctly handling Refresh
On a Fedora 31 system running Wayland I noticed that wezterm and
the compositor were running pretty hot on their respective CPU
cores.

It turned out that we had a lot of
[Refresh](https://docs.rs/smithay-client-toolkit/0.6.4/smithay_client_toolkit/window/enum.Event.html#variant.Refresh)
events being generated and consumed. We were treating this as needing
a full paint so we'd be effectively continually running the opengl
paint cycle over and over.

The docs for that event say that it is intended to refresh the client
decorations so let's focus it towards that instead.  This does bring
the CPU usage back down to intended levels.

I believe this hot CPU usage to be compositor-dependent: this is the
first I've seen of it out of 4 different Wayland environments!
2019-12-27 08:48:00 -08:00
Wez Furlong
f493139305 clippy 2019-12-21 23:13:26 -08:00
Wez Furlong
3750337b30 window: wayland: improve handling of initial scale notification
1f81a064ed added support for noticing
that the dpi scale was not 1 on startup, but the timing of this
signal was different between the opengl and software renderers.

When using the software renderer, we'd end up computing a scaling
change with a pre-change pixel size but adjusted by a post-post
scaling factor, and that effectively caused the window to halve
its size on startup.

This commit improves things by also tracking the dpi in our locally
stored dimensions.
2019-12-21 22:35:23 -08:00
Wez Furlong
1f81a064ed wayland: avoid appearing blurry on startup on scaled displays
@sunshowers mentioned to me that the window appeared blurry on a hidpi
display on startup, and was fixed by changing focus in a tiling window
manager.

I could replicate this using weston with scaling set to 2; the issue was
that the initial scale factor change event wasn't fully propagated and
bubbled up as a resize event to the terminal layer.

This commit taps into the dpi change event and forces it to be
interpreted as a window configuration change, resulting in more crisp
text.
2019-12-19 23:05:17 -08:00
Wez Furlong
ff4f0add98 clippy 2019-12-15 08:50:12 -08:00
Wez Furlong
52dfce6c4e more mac + windows build tweaks 2019-12-14 22:38:24 -08:00
Wez Furlong
c6e4d31e47 maybe fix mac build for real 2019-12-14 22:20:50 -08:00
Wez Furlong
c87a1c3b03 maybe fixup compilation on macos and windows 2019-12-14 22:10:08 -08:00
Wez Furlong
9a2c7a1485 failure -> anyhow + thiserror 2019-12-14 21:43:05 -08:00
Wez Furlong
51c2646eee fonts: remove some unused code and fixup some warnings 2019-12-14 12:29:38 -08:00
Wez Furlong
a9b0197075 fonts: add an Allsorts shaper
Adds the ability to specify `--font-shaper Allsorts` and use that
for metrics and shaping.

It is sufficient to expand things like ligatures, but there's something
slightly off about how the metrics are computed and they differ slightly
from the freetype renderer, which leads to some artifacts when rendering
with opengl.

One of my tests is to `grep message src/main.rs` to pull out the line
that has a selection of emoji.  The heart emoji is missing from that
line currently.

Refs: https://github.com/wez/wezterm/issues/66
2019-12-14 08:46:06 -08:00
Jeremy Fitzhardinge
0558662813 Convert chit-chat into info
I assume it was being printed as error from a mass conversion to the logging framework.
2019-12-06 15:11:42 -08:00
Wez Furlong
d4ab211190 PendingMouse and CopyAndPaste now impl Debug 2019-12-04 19:45:13 -08:00
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