1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-21 03:39:16 +03:00
Commit Graph

481 Commits

Author SHA1 Message Date
Wez Furlong
a514adfec0 windows: avoid ctrl normalization in the common case
in https://github.com/wez/wezterm/issues/767 CTRL-Tab was getting
incorrectly normalized to CTRL-i; that normalization is valid (Tab is
actually equivalent to CTRL-i as far as unix terminals are concerned)
but unwanted at this layer.

I suspect that this change will come back to haunt me in the future,
as keyboard input is a bit of a zoo.
2021-05-29 10:23:41 -07:00
Wez Furlong
030e517b43 deps: metrics 0.15 -> 0.16, cargo update 2021-05-24 07:57:03 -07:00
Wez Furlong
18ae2ccc8e window: log/retry self-pipe-writes
At the bottom of https://github.com/wez/wezterm/issues/815 is some
discussion about an apparent hang.

Let's make the self pipe writing a bit more robust and log to see
if that might be related.
2021-05-23 19:07:48 -07:00
Wez Furlong
f78190ec9c filedescriptor: remove anyhow from public interface
Use thiserror instead
2021-05-23 14:24:01 -07:00
Wez Furlong
a59e9b1706 update metrics 0.14 -> 0.15
closes: https://github.com/wez/wezterm/pull/778
2021-05-11 19:20:24 -07:00
Wez Furlong
5f5a48c830 tidy up log levels for wgpu 2021-05-09 10:59:48 -07:00
Wez Furlong
7cfbd133ac fixup warning in wgpu example 2021-05-09 08:20:03 -07:00
Wez Furlong
4e6f341f10 window: wayland support is no longer optional at build time 2021-05-08 17:48:58 -07:00
Wez Furlong
35351a97b4 x11: don't need to ref gl context in window any more
This is now managed by the client application
2021-05-08 15:05:07 -07:00
Wez Furlong
5f59bf25be window: tidy up infinite sleeps
refs: #770
2021-05-08 14:58:07 -07:00
Wez Furlong
4c847ff4ff window: remove now-dead bits on macos
refs: #770
2021-05-08 14:12:30 -07:00
Wez Furlong
5f612c17f5 windows: remove some now-dead code
refs: #770
2021-05-08 13:04:59 -07:00
Wez Furlong
7d301b91a7 x11/wayland: reduce frequency of core event loop
In an earlier incarnation we needed to wake up more often to paint,
but we now should have reliable event sources for all of the
invalidation cases and we can thus sleep for much longer in
the main event loop.

refs: #770
2021-05-08 12:59:33 -07:00
Wez Furlong
a884021074 window: remove Connection::schedule_timer
smol's Timer is used to replace this concept

refs: #770
2021-05-08 12:38:34 -07:00
Wez Furlong
325e755216 window: don't propagate errors from close notif channel
When a window is being destroyed we expect the receiver end
to be disconnected, so we don't want to break out of the
message loop if a couple of residual windows fail to notify.
2021-05-08 10:20:26 -07:00
Wez Furlong
453cfc1813 avoid a panic during shutdown 2021-05-08 09:36:20 -07:00
Wez Furlong
e81fb6e721 make alpha work on macos 2021-05-08 09:36:20 -07:00
Wez Furlong
0503abc63a fixup build on windows, make transparent 2021-05-08 09:36:20 -07:00
Wez Furlong
655eef271f fixup build on macos 2021-05-08 09:36:20 -07:00
Wez Furlong
058c3f612f add wgpu example 2021-05-08 09:36:19 -07:00
Wez Furlong
f4939c510b impl raw window handle on Window 2021-05-08 09:36:19 -07:00
Wez Furlong
c4e1f2434a add raw-window-handle impls 2021-05-08 09:36:19 -07:00
Wez Furlong
3d760653b4 window: macos: disable window restoration 2021-05-08 09:36:19 -07:00
Wez Furlong
a44607fb3f with_window inner from FnMut -> FnOnce
Not sure why it was FnMut, but this tidies up an awkward
option/take/unwrap thing in notify().
2021-05-08 09:36:19 -07:00
Wez Furlong
fb72338689 window: macos set gl layer placement to top-left 2021-05-08 09:36:19 -07:00
Wez Furlong
89dfeb69d6 tweak message pumping around paint on win32
It's not perfect; the revised code won't repaint immediate during
resize which can make the window a little "wobbly" during resize.
2021-05-08 09:36:19 -07:00
Wez Furlong
630d9d215b fixup build on windows
and correct the notify same thread optimization on unix
2021-05-08 09:36:19 -07:00
Wez Furlong
0f384b5c06 make window.notify more efficient on unix
avoid going through an extra queue if we already are in the right place
2021-05-08 09:36:19 -07:00
Wez Furlong
9fd04f6024 fixup linux build 2021-05-08 09:36:19 -07:00
Wez Furlong
5d037eae52 adjust gui layer for window changes 2021-05-08 09:36:19 -07:00
Wez Furlong
4d73448387 window: fixup build for macos 2021-05-08 09:36:19 -07:00
Wez Furlong
fe836da980 window: fixup build on windows 2021-05-08 09:36:19 -07:00
Wez Furlong
d56bfd0b7f window: separate gui window state from app state
Removes the callbacks type and replaces event dispatch with
an async capable channel.

This makes it a bit simpler to model some of the window internals,
and to prepare for a wgpu enabled future.

This changes have been tested only on linux so far.
2021-05-08 09:36:19 -07:00
Chris
2add312c5c
Allow VoidSymbol keycode to be seen by wezterm (#759)
* allow voidsymbol for key code

* update docs, cleanup

* cleanup and fmt of files

* remove unnecessary inputs
2021-05-07 07:54:24 -07:00
Wez Furlong
e400f2f524 fixup build on windows
refs: https://github.com/wez/wezterm/issues/695
2021-05-03 21:40:20 -07:00
Wez Furlong
b2b0b8b011 fixup build on linux
refs: https://github.com/wez/wezterm/issues/695
2021-05-03 21:09:08 -07:00
Wez Furlong
0df755b8f0 window: set_inner_size now returns Future<Dimensions>
This should help us reason about whether a resize respected
our request.

This may break linux and windows builds, will fixup once
this is pushed.

refs: https://github.com/wez/wezterm/issues/695
2021-05-03 20:49:22 -07:00
Wez Furlong
772991a1f0 window: remove WindowOpsMut trait
It doesn't serve any purpose and makes it awkward to make
a change in a later commit.

refs: https://github.com/wez/wezterm/issues/695
2021-05-03 20:26:33 -07:00
Wez Furlong
e4d45de9ec cargo fmt 2021-05-02 12:59:31 -07:00
Wez Furlong
6a5582f45a fixup tests for new_window async change 2021-05-02 12:43:00 -07:00
Wez Furlong
6919630810 refactor: new_window is now async
This doesn't really change anything, but it makes it a little
simpler to integrate wgpu in a later commit.
2021-05-02 12:05:28 -07:00
Wez Furlong
45262c3091 macos: fix numpad enter key reporting
refs: https://github.com/wez/wezterm/issues/739
2021-04-27 07:39:10 -07:00
Wez Furlong
ff7f097fb9 macos: fix "reflected" mouse x coordinate values
We were getting abs() of the backing-rect-adjusted value, so we need to
restore the sign to avoid what should be logically cell position "-1"
being treated as cell position "1" and so on.

With this change, the logic in the gui layer successfully clamps the x
coordinate to zero when trying to drag left off the window.
2021-04-23 18:31:44 -07:00
Wez Furlong
aea4fd5020 macos: ensure window is always miniaturizable
We need to keep the miniaturizable flag in even when there is no
titlebar, otherwise the miniaturize action has no effect.
2021-04-15 18:12:14 -07:00
Wez Furlong
2bb0e4e797 macos: use alternative cursor hiding technique
NSCursor hide/unhide must be perfectly balanced otherwise
the cursor can vanish unexpectedly when the mouse leaves
the window, and not come back.

So, let's use NSCursor:setHiddenUntilMouseMoves instead; it's
not 100% fulfilling the promise of the API, but it's close enough
and should avoid the permanent invisibility issue.

refs: https://github.com/wez/wezterm/issues/618
2021-04-10 14:30:06 -07:00
Wez Furlong
1415d16c9f window: x11: explicitly set titles in utf8
closes: https://github.com/wez/wezterm/issues/673
2021-04-10 07:44:51 -07:00
Wez Furlong
16e7457049 x11: notice dynamic changes to Xft.dpi
This commit allows the x11 window implementation to detect changes
in the DPI that occur after a window is created.

These can occur when changing desktop resolution or when changing
the accessibility option for "Large Text" in gnome.

In order to avoid continually polling for the value on every resize,
we look for the `_GTK_EDGE_CONSTRAINTS` atom in our property change
notifications.  This seems to be sent at least as often as the
dpi/scaling changes.

It's also worth noting that some dpi changes don't generate resize
events, so we can't just read the dpi value on every resize, because
we'd miss some of those changes.

Part of this commit changes the font scaling logic: previously
we'd keep a notion of "dpi scale" to apply.  That dates from an
earlier time in wezterm where we didn't think that we knew an
actual dpi value.

The way that worked was that we'd compare our current guestimate
of the DPI against what we though the baseline OS dpi should be to
produce a scaling factor.

On X11 that dpi value is global and we'd effectively always produce
a revised scaling factor of 1 after we'd set up the initial window.

This commit changes that logic to just pass down the actual DPI value
to the font code.  That DPI value already accounts for HiDPI scaling
so this is hopefully a NOP change for the other systems.

refs: https://github.com/wez/wezterm/issues/667
2021-04-09 09:23:25 -07:00
Wez Furlong
7a17ae833f macos: add logging around NSOpenGLPixelFormat
This just makes it easier to see when this is slowing things down.

refs: https://github.com/wez/wezterm/issues/452
2021-04-03 20:08:57 -07:00
Wez Furlong
1658627e2c macos: the event loop would keep running until mouse moved after quit
On macos, once all panes were closed, the GUI would request that the app
stop, but it wouldn't actually exit until a UI event occurred.

This was mostly noticeable when running debug builds from another
terminal.

Calling NSApp::abortModal is sufficient to knock us out of that state.
2021-04-03 14:57:20 -07:00
Wez Furlong
7deb215303 macos: recognize CTRL-Tab
macOS only sends key up events for this, so we remap them to
key down events.

closes: https://github.com/wez/wezterm/issues/630
2021-04-03 11:29:03 -07:00