Commit Graph
951 Commits
Author SHA1 Message Date
Federico Vitale 86e42e1c58 macos: refactor set_window_level 2024-01-21 14:06:01 -07:00
Federico Vitale 0080fec63d macos: remove level() function in window 2024-01-21 14:06:01 -07:00
rawnly d9387ed6e2 fmt: run fmt
Signed-off-by: rawnly <rawnly@users.noreply.github.com>
2024-01-21 14:06:01 -07:00
rawnly 18cb7e9765 macos: updated WindowLevel enum
removed wrong values and implemented `From<T>` trait

Signed-off-by: rawnly <rawnly@users.noreply.github.com>
2024-01-21 14:06:01 -07:00
rawnly ae67f85ea3 macos: added platform checks for ToggleFloatingWindow
Signed-off-by: rawnly <rawnly@users.noreply.github.com>
2024-01-21 14:06:01 -07:00
rawnly 8906d03851 macos: added floating window 2024-01-21 14:06:01 -07:00
Wez Furlong c4970b7fc8 xkbd: don't merge in modifiers, use only when missing
I think it will be safer to only take the flags from
the event in the case that the state reports zero
modifiers.

refs: https://github.com/wez/wezterm/issues/4776
closes: https://github.com/wez/wezterm/pull/4781
2024-01-21 13:11:36 -07:00
Jeffrey Knockel 1d4a407df9 x11: fix resize increments
Set atom with property (type) WM_NORMAL_HINTS (WM_SIZE_HINTS) instead of
WM_SIZE_HINTS (CARDINAL).
2024-01-21 10:10:59 -07:00
Wez Furlong bf07f6de0f Revert "deps: update to wgpu 0.19"
This reverts commit b4c5dc746d.
This reverts commit 3214610f16.
This reverts commit 3ec1cfba73.
This reverts commit 47590bbedc.
This reverts commit ea88dca296.
This reverts commit c269230b74.
This reverts commit 1484e2a673.
This reverts commit 6fd45c1223.
This reverts commit 9acc2ae6c5.

refs: https://github.com/wez/wezterm/issues/4825
refs: https://github.com/wez/wezterm/issues/4826
2024-01-21 09:51:58 -07:00
Wez Furlong 3214610f16 windows: final stretch 2024-01-20 20:51:27 -07:00
Wez Furlong 3ec1cfba73 windows: and maybe this fixes the build now! 2024-01-20 16:06:19 -07:00
Wez Furlong 47590bbedc windows: and another try! 2024-01-20 15:54:25 -07:00
Wez Furlong ea88dca296 windows: another run at fixing up the build 2024-01-20 15:37:38 -07:00
Wez Furlong c269230b74 macos: another run at fixing up the build 2024-01-20 15:36:47 -07:00
Wez Furlong 1484e2a673 macos: another wgpu related fixup 2024-01-20 12:58:59 -07:00
Wez Furlong 6fd45c1223 maybe fixup build for wgpu 0.19 on macos and windows 2024-01-20 12:55:33 -07:00
Wez Furlong 9acc2ae6c5 deps: update to wgpu 0.19 2024-01-20 12:09:52 -07:00
Wez Furlong c607c6a59c allow rgba for all window_frame colors
refs: https://github.com/wez/wezterm/issues/3580
2024-01-20 10:06:02 -07:00
Benoit de Chezelles 0466898af7 x11: Use modifiers from X event if non were detected by XKB
This is a working tentative at fixing text expansion/injection done by
Espanso by default, where XKB doesn't seem to detect the pressed
modifiers `Ctrl+Shift` before pressing `v`.

refs: #3840
2024-01-11 06:44:57 -07:00
Quan Tong f2a9c06247 honor the window_close_confirmation config option when quitting 2023-12-02 08:38:42 -07:00
ud2 4551903f5b macos: fix leak of Window and View objects 2023-10-29 18:39:30 -07:00
Haochen Tong 44c914c230 wayland: update SCTK to fix startup on newer compositors 2023-09-20 11:22:04 -07:00
Wez Furlong 0456719980 windows: fix build
Weirdly, the rust compiler is suddenly complaining about this,
when this file hasn't changed.

```
error[E0283]: type annotations needed
    --> window\src\os\windows\window.rs:2398:26
     |
2398 |         if vk <= u8::MAX.into() {
     |               --         ^^^^
     |               |
     |               type must be known at this point
     |
     = note: cannot satisfy `u32: PartialOrd<_>`
help: try using a fully qualified path to specify the expected types
     |
2398 |         if vk <= <u8 as Into<T>>::into(u8::MAX) {
     |                  ++++++++++++++++++++++       ~

error[E0283]: type annotations needed
    --> window\src\os\windows\window.rs:2415:32
     |
2415 |         if leader.1 <= u8::MAX.into() && key.1 <= u8::MAX.into() {
     |                     --         ^^^^
     |                     |
     |                     type must be known at this point
     |
     = note: cannot satisfy `u32: PartialOrd<_>`
help: try using a fully qualified path to specify the expected types
     |
2415 |         if leader.1 <= <u8 as Into<T>>::into(u8::MAX) && key.1 <= u8::MAX.into() {
     |                        ++++++++++++++++++++++       ~

```
2023-08-21 06:00:51 -07:00
Ovidiu IonescuandOvidiu Ionescu 9c215e15fd fix: issue 3935 handle F13-F24 (#3937)
* fix: issue 3935 handle F13-F24

* Added F13-F24 in kitty mode

* fix: replace trailing ~ with u in escape sequence

* fix: patch ending char for function keys

---------

Co-authored-by: Ovidiu Ionescu <ovidiu@ionescu.net>
2023-08-06 10:22:14 -07:00
Wez Furlong 06dd8e4a79 macos: populate effective_dpi in wezterm.gui.screens
refs: #4096
2023-08-06 10:11:05 -07:00
Wez Furlong 1bbd56d469 wayland: return effective_dpi in wezterm.gui.screens
Note that this also does not respect dpi_by_screen; this is for
consistency in behavior and reported values.

Once we can produce the correct overridden value in
dispatch_pending_event, we can update these functions to return
the same data.

refs: #4096
2023-08-06 09:31:11 -07:00
Wez Furlong 06046c4319 x11: return effective_dpi in wezterm.gui.screens
refs: #4096
2023-08-06 09:26:06 -07:00
Wez Furlong 2a7167a0ef fix some warnings 2023-08-06 09:18:40 -07:00
Wez Furlong 6ccbc723ba wezterm.gui.screens: add optional effective_dpi field
This commit implements it for Windows. The other systems
report None for now.
2023-08-06 09:18:40 -07:00
Wez Furlong b11691dda7 windows: support dpi_by_screen option
refs: #4096
2023-08-06 08:43:33 -07:00
Wez Furlong ef94fc8405 wayland: respond to config.dpi changes faster
This is a baby step towards handling dpi_by_screen.
I don't want to do the actualy per-screen stuff here;
it touches stuff around the edges of SCTK and there is a pending,
significant, rewrite of that code needed to upgrade to a more
recent version of SCTK + wayland-protocols, and I don't want to waste
my effort on the intermediate state.
https://github.com/wez/wezterm/issues/3996#issuecomment-1636830740

refs: #4096
2023-08-06 07:52:37 -07:00
Wez Furlong ede7e846f4 x11: respect config.dpi_by_screen
Maintain a cache of the positions of the various named screens,
and use that to resolve the screen of the current window, and
from there we can resolve the correct dpi_by_screen screen.

Make dpi and dpi_by_screen config changes generate a resize
event with the updated dpi.

refs: #4096
2023-08-05 22:25:06 -07:00
Wez Furlong f7f253ec28 macos: add config.dpi_by_screen config option
Allows specifying the precise dpi to use on a per-screen basis:

```lua
return {
  dpi_by_screen = {
    ["Built-in Retina Display"] = 144,
  },
}
```

The screen names are the same as those returned from
`wezterm.gui.screens()`.

Changing either `dpi` or `dpi_by_screen` in the config will now cause
the window to be immediately resized/adjusted to the changed dpi
override.

Ultimately, I'd like to deprecate `dpi` in favor of `dpi_by_screen`,
but can't do that until this functionality is ported to windows, x11
and wayland.

refs: #4096
2023-08-05 20:48:59 -07:00
Wez Furlong 33187d0e79 macos: fonts: use full list of user fallback languages
The hope was that this would find more fonts, but it doesn't actually
help for this case.

refs: https://github.com/wez/wezterm/issues/4099
2023-08-05 17:33:59 -07:00
Wez Furlong d1d4db20be cargo update
Transitive deps now require rust 1.71, so update for that, as well
as some other minor changes required by transitive deps.
2023-07-30 20:09:15 -07:00
Wez Furlong cbccbd3478 wayland: speculative fix for reading keymap from a pipe on chromebook
refs: #3958
2023-07-10 20:19:20 -07:00
Wez Furlong 2035ad4de3 x11: remove diagnostic print of kbd layouts
It seems that the library is a bit wonky; see:
https://github.com/wez/wezterm/issues/3882#issuecomment-1628359441
for an example of a segv around this
2023-07-10 07:37:51 -07:00
Wez Furlong 046443c107 windows: fix build
"Something changed" somewhere in the deps that broke type inference for
these cases.  Just use explicit types for the `as` portions.
2023-07-10 07:07:50 -07:00
Jacob Malloy 6154cf21c4 Fixed: Middle mouse drag MacOS
Added event selector to objc class for the otherMouseDragged event.
2023-07-10 06:34:20 -07:00
Wez Furlong f901dfbf68 deps: tiny-skia -> 0.11 2023-07-09 18:28:48 -07:00
Wez Furlong f09992f704 x11/wayland: fix ctrl-key for latin layouts
This is fixing a regression introduced by the fix for #2845.
The resolution for this is relatively straightforward, but took a bit
of effort to plumb.

Previously:
* CTRL/ALT/SUPER-modified keys with no explicit expansion would end
  up just taking the US layout version of the key.  That worked well
  for the intended problem with non-latin layouts, but for eg: German
  layouts it caused expansion to totally the wrong thing

Now:
* CTRL/ALT/SUPER-modified keys which effectively expand to non-ascii
  text (eg: cyrillic "Es") now take the equivalent key press from the
  US layout (which would be "c" in the "Es" case).  For European
  layouts this heuristic seems to avoid unexpected effects, but could
  do with some validation from native users.

To support this, the xkb code splits the `Keyboard` struct out from
some of the higher level logic and introduces a `KeyboardWithFallback`
struct that is built out of the user-selected keyboard layout, and
the fallback keyboard.  Now the fallback keyboard is fed the same
key inputs as the selected keyboard to correctly model the key
combinations.

refs: #3610
refs: #3933
2023-07-09 12:28:34 -07:00
Omar Sandoval 7373a4990b Fix copy mode on Wayland
On Wayland, copy mode often doesn't actually update the clipboard.
Specifically, it only works one time after a pointer enter or pointer
button event, then doesn't work again until the next event.

This is because the Wayland protocol serial number in
CopyAndPaste::last_serial is only updated by pointer enter and pointer
button events. So, subsequent copies using only the keyboard reuse the
same serial number and get ignored. last_serial used to be updated for
keyboard events, too, but that was (accidentally?) dropped in commit
0a00ffe98b.

Commit 0a00ffe98b also added another
last_serial to WaylandConnection which is updated for keyboard events
but isn't used anywhere as far as I can tell.

So, to fix this bug, let's get rid of CopyAndPaste::last_serial and
replace it with WaylandConnection::last_serial, which is now updated for
pointer and keyboard events.

closes: #3843
2023-07-03 10:45:47 -07:00
Wez Furlong 95e44f2199 Fix dbus value parsing issue by upgrading zbus/zvariant crate
Error message I've been seeing the past couple of days:

Unable to resolve appearance using xdg-desktop-portal: invalid value:
string "()", expected at least one field signature between `(` and `)`:
invalid value: string "()", expected at least one field signature
between `(` and `)`
2023-05-30 06:27:29 -07:00
Wez Furlong 7e2b7ca84d deps: update tiny-skia
closes: https://github.com/wez/wezterm/pull/3794
2023-05-28 20:18:00 -07:00
Wez Furlong 4ae176dd8a try scaling down images that don't fit in the texture atlas
When trying to display a 4k image there is a high chance that
we'll run out of texture space and then render with no images
displayed.

This commit changes the binary yes/no allow-images into a a series
of attempts: display at natural size, scale down by 2, 4, then 8,
then give up on images.

While looking at this, I noticed that we had a TOCTOU in the blob lease
stuff in the case where we might very quickly try the handle the same
image in succession, and end up deleting a file out from under a live
lease.

I've put in place a simple bandaid for that, but it's probably worth
revisiting the concurrency model for that.
2023-05-19 08:57:38 -07:00
Ye Sijun c154eb2d8a reimpl and remove clipboard_macos
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-05-07 11:05:55 -07:00
Wez Furlong dc2cd706dc macos: remove about dialog
Replace it with a menu item that shows the version number, and
that you can click to copy the version number.

closes: https://github.com/wez/wezterm/issues/3507
2023-04-24 11:08:18 -07:00
Wez Furlong 26090da81e deps: tiny-skia -> 0.9 2023-04-24 09:13:44 -07:00
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