1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-27 02:25:28 +03:00
Commit Graph

903 Commits

Author SHA1 Message Date
Wez Furlong
77ea124094
eprintln -> log::trace
Avoid unconditionally logging this diagnostic message, so that
we don't fill up wherever stderr is logging to.

refs: #3564
2023-04-20 07:31:47 -07:00
Wez Furlong
e204f8ba49
wayland: set_cursor: use exactly the caller-provided serial
Don't fallback to some other serial.

In a new version of SCTK, it looks like the serial we pass should
be the serial from the time we entered the surface, rather than
the latest serial that we have.

In practice, this commit uses None for the serial which seems to
have better results, but may come back to haunt us until we upgrade
to the latest SCTK.

refs: https://github.com/wez/wezterm/issues/3334#issuecomment-1515141539
2023-04-19 10:55:47 -07:00
Wez Furlong
048e8dd1ba
wayland: fall back to 'default' for pointers that are not found
This allows for potentially listing multiple candidate cursor names,
like we do for x11, but doesn't add any.

Attempt to load default if our desired cursor is not found.

refs: https://github.com/wez/wezterm/issues/3334
2023-04-19 10:29:40 -07:00
Wez Furlong
21e19ca091
x11/wayland: improve non-latin ctrl/alt keypresses
For eg: RU layout, CTRL-S shouldn't result in ы in the context
of a terminal.

The approach taken here is similar to kitty; when the key combination
doesn't produce a definitive composed output, and when any of
ctrl/alt/super are present, we treat the keypress as though it were
the same as the one from the system default keymap.

The result is that ctrl-c now works like ctrl-c and alt-b and alt-f work
like their latin counterparts.

Hopefully there are no downsides to this!

refs: https://github.com/wez/wezterm/issues/2845
refs: https://github.com/kovidgoyal/kitty/issues/606
2023-04-19 09:37:58 -07:00
Wez Furlong
44eccffe0c
macos: fix font size issue when spawning on external monitor
The main part of the problem is that NSWindow::isZoomed lies to us
sometimes.

This is a relatively gross workaround.

Add missing invalidation after setting the content size; that prevents
janky when dragging the window between monitors.
Removed some redundant Dimensions computation from that method; nothing
ever read it.

refs: https://github.com/wez/wezterm/issues/3503
2023-04-18 10:35:58 -07:00
Wez Furlong
163dfd7d9a
windows: refine DwmExtendFrameIntoClientArea call 2023-04-17 06:33:02 -07:00
kingavatar
08e9be0df3
feat: calling extendframe function to get sheet of glass effect 2023-04-17 06:33:02 -07:00
Wez Furlong
c4145a464b
windows: more consistently enable/disable backdrop on older windows
When the user edits their config, this should stand a better chance
of the desired effect being enabled and not requiring a restart.

refs: #3528
2023-04-17 06:33:01 -07:00
kingavatar
eef5ffb0ce
feat: add acrylic accent color as config and other refactors 2023-04-17 06:33:01 -07:00
kingavatar
a0b625985e
feat: add systembackdrop like acrylic and mica for windows os
Added functionality which enables Setting SystemBackdrop for windows os like mica, Acrylic, tabbed.
2023-04-17 06:33:00 -07:00
Wez Furlong
f3ee5e57f0
x11/wayland: route modifier/led status change to window
refs: https://github.com/wez/wezterm/issues/3444
2023-04-16 20:37:45 -07:00
Wez Furlong
075388fbe5
add window:keyboard_modifiers() method 2023-04-16 19:53:32 -07:00
Wez Furlong
3f820b93d9
Fix win32 input mode encoding inconsistencies
This pulls in almost all of the original PR in #2235.
I skipped a dead key case that I recall being tricky:
I didn't want to break the non win32-input mode version
of that.

I'd be happy to have that case re-evaluated in a smaller
PR where we can focus on its details.

Co-authored-by: Dominik Kreutzer <kreudom@gmail.com>
2023-04-16 13:07:18 -07:00
Wez Furlong
6d3dee733f
windows: fix maximize button with OS titlebar
refs: #3499
2023-04-16 11:56:05 -07:00
Wez Furlong
f627d6d704
windows: improve hit test for integrated max button
refs: https://github.com/wez/wezterm/issues/3499

but isn't the cause of it
2023-04-16 11:37:58 -07:00
Wez Furlong
0bb9a2896e
keyboard: populate caps and num lock on windows 2023-04-15 15:22:40 -07:00
Wez Furlong
f5d8e52094
keyboard: fixup build on win32 2023-04-15 15:06:23 -07:00
Wez Furlong
7ff88280f3
keyboard fixup build on x11/wayland 2023-04-15 15:00:03 -07:00
Wez Furlong
3c40846d95
keyboard: move led status to separate enum 2023-04-15 14:52:54 -07:00
Wez Furlong
5311bb657e
macos: populate caps lock state, report num lock presses
macos doesn't have a num lock concept, so there is no num lock state
reported in modifiers. wezterm doesn't emulate that state because it
cannot guarantee to observe all key presses and correctly track it.
2023-04-10 16:38:53 -07:00
Ron Waldon-Howe
0eeca6c2c5
fix(wayland): register frame callback then commit (fixes #3468) (#3485)
fix(wayland): register frame callback then commit (fixes #3468)

Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2023-04-10 09:10:38 -07:00
Wez Furlong
f4995511e2
keyboard: improve support for numpad buttons
We were missing encoding of these for the base xterm encoding
(I haven't daily driven a keyboard with a numpad in over 10 years!).

Improve mapping for the kitty protocol.

refs: https://github.com/wez/wezterm/issues/3478
2023-04-09 12:28:30 -07:00
Wez Furlong
b646c36e34
refactor: tidy up some logging 2023-04-09 12:26:32 -07:00
Wez Furlong
2dcf7ad98d
keyboard: plumb more modifier+state information through
This commit teaches the termwiz layer about positional modifiers,
and expands our modifier concept to also pass through led states
such as caps lock and num lock.

Those aren't actually keyboard modifiers, but the state is useful
to recognize.

Adjust the shift key normalization so that we don't uppercase
alpha characters when both SHIFT and CAPS_LOCK are held.
This processing will remove both SHIFT and CAPS_LOCK in that
situation.

Add a method to KeyEvent that will undo the OS keyboard layer
normalization of positional to generic modifier key presses.
eg: the OS may map LeftControl -> Control, but we actually
prefer to have LeftControl so if we can unambiguously reverse
that mapping, we do so.

refs: #3476
refs: #3475
2023-04-09 10:34:53 -07:00
Wez Furlong
69ae847273
windows: fix: mess up full screen mode on config reload
refs: https://github.com/wez/wezterm/issues/3439
2023-04-08 11:24:25 -07:00
Wez Furlong
9e03d24402
windows: fix warning; mut not required here 2023-04-08 11:12:38 -07:00
Wez Furlong
36d5307b80
wayland: fix webgpu invalidation issue
For whatever reason, it appears as though the wayland
frame event stuff is unreliable when used with webgpu,
so we simply avoid using it.

refs: https://github.com/wez/wezterm/issues/3126
2023-04-07 22:15:07 -07:00
Wez Furlong
a5e89cda3d
windows: speculative fix for recursive borrow
refs: https://github.com/wez/wezterm/issues/3425
2023-04-07 09:29:20 -07:00
Jalil David Salamé Messina
b32863cc2f fix(clippy): Implement From instead of Into
Implementing `From` is prefered as this also implements the `Into` trait, may
not be desireable for code size/compilation time reasons.
2023-04-03 08:31:12 -07:00
Wez Furlong
c7ee705eaf
windows: fix INTEGRATED_BUTTONS|RESIZE 2023-04-01 08:32:24 -07:00
Wez Furlong
8a6e207f18
rustfmt 2023-04-01 07:46:31 -07:00
Wez Furlong
b74da54a70
x11: fix INTEGRATED_BUTTONS|RESIZE
Shouldn't show the native titlebar in that case
2023-04-01 07:26:14 -07:00
Wez Furlong
2168709836
minor tidy up of hover handling for maximize button
Remove an unsafe global variable and replace with a member variable
that works similarly to the drag tracking.

Doing this from a mac... may not compile on a windows box!
2023-03-31 23:10:12 -07:00
Wez Furlong
8b03890b8b
macos: correctly synthesize WindowState::MAXIMIZED 2023-03-31 22:06:22 -07:00
Wez Furlong
422ae51577
allow using Gnome and Windows styles on macos.
Rename macos to MacOsNative to make its intended purpose clearer
2023-03-31 20:35:26 -07:00
Wez Furlong
fb4e5b0f7b
macos: fixup window_decorations w/ INTEGRATED_BUTTONS+RESIZE
Our docs strongly suggest that RESIZE be kept in the mask, so let's
ensure that it continues to work.
2023-03-31 20:13:51 -07:00
YuraIz
bcd1b03569
integrated-title-bar: Use snap layouts for any maximize button 2023-03-31 19:55:13 -07:00
YuraIz
eab21a669d
integrated-title-bar: Improve windows support 2023-03-31 19:53:45 -07:00
YuraIz
01aeb506c0
integrated-title-bar: Update config options
and rename the "FANCY" option to "INTEGRATED_BUTTONS"
2023-03-31 19:51:46 -07:00
Yuri Izmer
e354791c34
integrated-title-bar: Add macOS support 2023-03-31 19:45:28 -07:00
YuraIz
fc7a8a8914
integrated-title-bar: Add x11 support 2023-03-31 19:45:28 -07:00
YuraIz
93308317d7
integrated-title-bar: Add windows support 2023-03-31 19:44:19 -07:00
Wez Furlong
d1c2257bd8
macos: fix CTRL key behavior when use_ime=true
refs: https://github.com/wez/wezterm/pull/2435
refs: https://github.com/wez/wezterm/issues/2771
refs: https://github.com/wez/wezterm/issues/2630
2023-03-30 21:49:48 -07:00
Gkirito
63676c30d2
refactor(config & macos/windows): rename window_background_blur to macos_window_background_blur 2023-03-24 19:04:15 -07:00
Gkirito
1b24ff1abf
feat(config & window): use CGSSetWindowBackgroundBlurRadius to set background blur on macos 2023-03-24 19:04:15 -07:00
Wez Furlong
c38d160918
macos: be precised about matching cocoa BOOL
Weirdly, this worked for me on my mac, but not in CI

refs: #3340
2023-03-23 20:12:43 -07:00
Wez Furlong
448a9fe78a
macos: don't treat command line args as .command scripts
Weird behavior from macos; the command line:

`wezterm start vim hello`

would result in macos requesting `vim` and `hello` be opened
as "documents" which would route each of those to the .command
script handling flow and spawn a window for each; running:

`vim ; exit` in one
`hello ; exit` in another

in addition to the normal handling of that command line.

This commit resolves this by igoring document opening
requests until after the application is fully launched.

I tested this by trying to open a .command script with
this new build and verified that that continued to work.

refs: #3340
2023-03-23 19:21:42 -07:00
Noé Froidevaux
073ea55a4c
Fix transparent title bar on macOS with window_decorations = "RESIZE|MACOS_FORCE_DISABLE_SHADOW" (#3330)
Fix transparent title bar
2023-03-22 18:03:25 -07:00
Jalil David Salamé Messina
d541e2e13d fix(clippy): Remove closures where possible
- Removes closures and function calls for types that implement default:

  ```rust
  // Change
  let _my_str = get_str().unwrap_or(String::new);
  // To
  let _my_str = get_str().unwrap_or_default();
  ```

- Uses the `.cloned()/.copied()` methods where possible
- Use function pointer instead of simple closure

May improve performace, as closures generate more code, and this might
unlock some inlining opportunities.
2023-03-19 08:41:38 -07:00
Jalil David Salamé Messina
191aacc7d7 fix(clippy): Use faster methods on Iterators
- Use `find` instead of `position(..).next()`
- Use `any` instead of `position(..).next().is_some()/.is_none()`
- Use `first/next` instead of `get(0)/nth(0)`
- Prefer `for` loops over `while let` loops on iterators

May improve performance.
2023-03-19 07:29:23 -07:00