Commit Graph
1160 Commits
Author SHA1 Message Date
Adam WilliamsandAdam Williams 51019f8e65 macos: Fix window border when opacity<1 and shadow enabled (#8038)
This was seemingly due to MacOS quirks, and was fixed by using
a slightly transparent bg color to fix WM composition.

refs: #5158

---
Co-authored-by: Adam Williams <adam.g.williams.nz@gmail.com>
2026-08-23 22:57:04 +02:00
PatrickandBenoit de Chezelles 35680af7a4 macos: Fix top row dragging window when decorations are hidden (#7967)
fixes #4522

---
Co-authored-by: Benoit de Chezelles <benoit.dechezelles@gmail.com>
2026-08-20 08:35:01 +02:00
Benoit de Chezelles 8c5af0db16 fmt 2026-08-19 01:14:35 +02:00
Benoit de Chezelles d7103b338a fixup! macos: Unify BOOL conversion behind from_yes_no/to_yes_no helpers 2026-08-18 23:45:49 +02:00
Benoit de Chezelles 2582d8b04a macos: Unify BOOL conversion behind from_yes_no/to_yes_no helpers
Introduce two small conversion fns to easily convert to/from objc' BOOL
type.

Update all places that benefits from this conversion to/from Rust-bool
to more easily compare & manipulate boolean values in logic/conditions.
2026-08-18 23:33:06 +02:00
JoelandDiego Dassie b65d09d212 fix(wayland): disable titlebar when TITLE decos not requested (#7601)
* fix: explicitly request no decorations in xdg calls
* wayland: Only disable decoration when TITLE decoration not requested
  Copied from 5ebe5f7db3779e071 by @ddss-kalpa

---------

Co-authored-by: Diego Dassie <diego.dassie@kalpa.it>
2026-08-03 04:10:42 +02:00
Benoit de Chezelles 2ef4bef4ac wayland: Update blur surface on window resize (#7939)
ref: #7937
2026-07-16 10:25:32 +02:00
Benoit de Chezelles d13ed704b2 fix: remove useless unsafe blocks around safe functions
As reported by `rustc` during compilation
2026-07-14 11:23:41 +02:00
1Capito1andBenoit de Chezelles 6f3d3d84f2 wayland: Support blur via ext-background-effect-v1 protocol (#7615)
* Add ext-background-effect-v1 support for wayland
* Deprecate `kde_window_background_blur`; use `wayland_window_background_blur`
* Update changelog (replace old kde… option entry with wayland…)

---------

Co-authored-by: Benoit de Chezelles <benoit.dechezelles@gmail.com>
2026-07-13 18:57:32 +02:00
Benoit de Chezelles c645d79a67 fix formatting 👀 2026-07-07 09:30:22 +02:00
Benoit de Chezelles 858a9c98a9 refactor(wayland): restructure drag-and-drop session handling
Introduce a session-based approach for drag-and-drop, replacing the
previous state management with a clearer DragAndDropSession type.
This improves readability and makes the lifecycle of a drag operation
more explicit.

- Replace DragAndDrop with Option<DragAndDropSession> in pointer state.
- Rename SurfaceAndOffer and SurfaceAndPipe to reflect their roles.
- Minor: adjust visibility and add doc comments for public types.
2026-07-03 00:34:36 +02:00
Benoit de Chezelles 5f0694571c wayland: Skip data device event to non-toplevel surfaces
refs: #7880
2026-07-03 00:34:36 +02:00
crimist 6ff5492866 wayland: fix protocol error when buffer size isn't a multiple of buffer_scale (#7746)
ref: #7333
2026-06-22 12:01:02 +02:00
Benoit de Chezelles 9edc0c09fc refactor(wayland): share one CopyPasteOffer across all windows (#7869)
Previously each window held its own CopyAndPaste (one per surface),
causing the data_device selection handler to broadcast the incoming
offer to every window on each clipboard change.

Since the compositor sends one selection event per client (not per
surface), a single shared CopyPasteOffer on WaylandState is sufficient.
The broadcast loop is replaced by a single confirm_selection() call.

Also add doc comments on all clipboard-related fields in WaylandState.

Assisted-by: Claude Sonnet 4.6; iterated, reviewed & tested manually

ref: #6685
2026-06-21 22:47:48 +02:00
Benoit de ChezellesandXeroOl 40daec8934 fix: Save wayland selection offer to every surface (#7863)
In Wayland, when something is copied to the clipboard, an "offer"
is given to every "device". WezTerm holds these offers in a
'CopyAndPaste' struct, and reads from the offer when the user presses
paste. WezTerm has one 'CopyAndPaste' for each window.

When WezTerm receives a data offer, it previously only saved it to
one 'CopyAndPaste' based on the active surface id.
With this change, it writes it to every CopyAndPaste.

Fixes #6685
Replaces #7034

---------

Co-authored-by: XeroOl <xerool@protonmail.com>
2026-06-16 00:20:39 +02:00
KOGA Mitsuhiro 900bab10d6 Fix RefCell borrow conflict when toggling IME on Windows (#7529)
* Fix RefCell borrow conflict when toggling IME on Windows

When IME is active, the `key` function was holding a borrow on the
window's inner RefCell while calling `TranslateMessage`. This Windows
API can trigger other window messages (like WM_SIZE) via
`CtfImeCreateInputContext`, which then attempt to borrow the same
RefCell, causing a panic with "RefCell already borrowed".

Similarly, `ime_set_context` was holding a borrow while calling
`DefWindowProcW`, which can also trigger recursive window messages.

Fix by dropping the borrow prior to triggering potentially recursive calls.

Fixes the crash that occurred when toggling IME (e.g., pressing
Hankaku/Zenkaku key) after splitting a pane on Windows.
2026-06-07 08:17:27 +01:00
Tautik AgrahariandBenoit de Chezelles 297637504a Fix 'the the' typos across doc & code files (#7769)
* docs: fix duplicate-word typos across doc files
* code: fix duplicate 'the the' typos across code files

Co-authored-by: Benoit de Chezelles <benoit.dechezelles@gmail.com>
2026-06-04 14:09:39 +02:00
Benoit de Chezelles 135b187fa8 Revert "Fix crash on hidpi with wayland (#6508)"
This reverts commit d1684d38e8.
2025-10-14 19:36:43 +01:00
I-Info c8a649684d fix: memory leak in macOS MetalLayer management
When using WebGPU front end, creating and closing windows will cause
VM:IOSurface memory leak, due to an unreleased object reference.

Also with some other trivial memory leak prevention measures.
2025-10-14 19:33:09 +01:00
Wez Furlong 514bb39a7d fixup some mismatched_lifetime_syntaxes warnings 2025-10-05 10:59:20 +01:00
Kaleb Olson c6f25ea3f9 Fix fractional scaling issues in hyprland 0.51.0 2025-10-05 10:51:28 +01:00
Rebecca Turner bf9a2aeeba Fix mismatched_lifetime_syntaxes warnings
Fixes a bunch of warnings like this:

```
warning: hiding a lifetime that's elided elsewhere is confusing
   --> window/src/os/macos/window.rs:670:23
    |
670 |     fn display_handle(&self) -> Result<DisplayHandle, HandleError> {
    |                       ^^^^^            ------------- the same lifetime is hidden here
    |                       |
    |                       the lifetime is elided here
    |
    = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
    = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
help: use `'_` for type paths
    |
670 |     fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError> {
    |                                                     ++++
```

This lint was added in Rust 1.89: https://github.com/rust-lang/rust/issues/141787
2025-09-09 07:05:12 -07:00
Chris Pick cfb1e9190f Prevent infinite loop in macOS' "Service" menu validation
The `WezTermAppDelegate` class was setting `NSWindow` as its parent.

This caused an infinite loop any time macOS's "Service" menu was
expanded becuase it would pass [`validRequestorForSendType:returnType:`]
(https://developer.apple.com/documentation/appkit/nsresponder/1524638-validrequestor)
messages along the full responder chain to [check for objects that are
eligible for services offered by other applications]
(https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/EventOverview/EventArchitecture/EventArchitecture.html#//apple_ref/doc/uid/10000060i-CH3-148895).

The [responder chain]
(https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/EventOverview/EventArchitecture/EventArchitecture.html#//apple_ref/doc/uid/10000060i-CH3-SW9)
would walk up to the `WezTermAppDelegate` which, since it was an
`NSWindow`, would walk back to `NSApp` which would walk to its delegate
(`WezTermAppDelegate`) and so on forever.


Change `WezTermAppDelegate`s parent class `NSObject` to prevent this
loop.

Fixes: https://github.com/wezterm/wezterm/issues/6738
Fixes: https://github.com/wezterm/wezterm/issues/6833
2025-07-23 08:15:24 +01:00
Chris Pick 85c587f9f3 Remove deprecated NSWindowFullScreenButton
Fixes #7080 to prevent null pointer dereference (and crash in debug
mode) on macOS.

`NSWindowFullScreenButton`
[is deprecated](https://developer.apple.com/documentation/appkit/nswindow/buttontype/fullscreenbutton?changes=__6_5&language=objc).
Removing it prevents a null pointer from being dereferenced and doesn't
otherwise impact behavior.

Confirmed that `window_decorations = "RESIZE"` sill works
[with rounded corners](https://github.com/wezterm/wezterm/issues/1034).
2025-07-13 13:51:09 +01:00
Wez Furlong 54675c9c35 window: fix use of deprecated objc2_core_graphics::CGColorCreateSRGB 2025-07-01 07:47:23 +01:00
Wez Furlong f54dd1b028 macos: don't try swrast fallback for mesa
We're not using; we only use either Metal via WebGpu (and thus
don't ever get into the egl code), or Egl via the native opengl
implementation.

So we can bail out of the loop with the swrast fallback like
we do on windows.

closes: https://github.com/wezterm/wezterm/issues/6819
2025-05-17 09:36:33 -07:00
parthandWez Furlong 4d6b83585f feat: Added support for window blur on KDE Wayland (#6905)
* added config flag for kde blur

* added deps for wayland-protocol-plasma

* added kde background blur

* keeping inner functions together

* updated docs with kde_blur

* added kde_blur ss to docs

* removed unneeded dep

* removed redundant default value for bool

Co-authored-by: Wez Furlong <wez@wezfurlong.org>

* updated default for kde_blur in config

Co-authored-by: Wez Furlong <wez@wezfurlong.org>

* Update docs/config/lua/config/kde_window_background_blur.md

Co-authored-by: Wez Furlong <wez@wezfurlong.org>

* Update blur logic in os/wayland/window.rs

Co-authored-by: Wez Furlong <wez@wezfurlong.org>

* simplified blur_manager creation in wayland/state.rs

Co-authored-by: Wez Furlong <wez@wezfurlong.org>

* removed unnecessary panic paths

Co-authored-by: Wez Furlong <wez@wezfurlong.org>

* removed unnecessary panic path

Co-authored-by: Wez Furlong <wez@wezfurlong.org>

* put the right screenshot for kde_blur

* fixed build issues

* reverted window/src/os/windows/window.rs

* fixed formatting

* Update window/src/os/windows/window.rs

---------

Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2025-05-04 06:29:27 -07:00
Jay Madden c0b29fef24 feat(macos): add support for titlebar background matching theme background on macos
closes: #6558
2025-03-08 17:13:37 -07:00
Ryan Zimmermanandvolskaya c6b67877b6 Add option to extend the osx non-native fullscreen behind the notch to the top of the screen (#5759)
* Adding an option (disabled by default) to disable the notch avoidance so you can use the full screen if your terminal config already handles the notch.

Co-authored-by: volskaya <38878482+volskaya@users.noreply.github.com>
2025-02-22 08:17:33 -07:00
Wez Furlong edcdefda3b workspace-ify the deps
There have been a couple of attempts at this in the past, which
had some usability warts in what I recall as an earlier, less
useful set of features overall.

Whether that was collective misunderstanding at the time, or things
have gotten better since then, now is a good time to adopt the workspace
dep syntax, because wezterm has many crates to keep on top of, and
automation like dependabot can't see a lot of them.

This will help to manage the versions of deps in wezterm centrally.

Let's try this out in CI: the Cargo.lock changes here are minimal
(eliminated a second version of base64 from one crate, terminal_size
from another, and removed an explicit dep on serde_derive) so
hopefully this sails through on !linux.

closes: https://github.com/wezterm/wezterm/pull/6668
2025-02-12 09:43:36 -07:00
dani162 23d643bab4 use surface height/width for client side decoration frame resizes 2025-02-09 15:58:48 -07:00
Wez Furlong 011ea313b6 rustfmt
refs: https://github.com/wezterm/wezterm/pull/6587
2025-02-08 19:22:10 -07:00
amadeusandWez Furlong fcae187b29 feat(macOS): add support to disable rounded corners on macOS (#6587)
* feat(macOS): add support to disable rounded corners on macOS

* Update wezterm-input-types/src/lib.rs

---------

Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2025-02-08 19:21:44 -07:00
Bowei Zhang ca671d649b fix: don't clear ime_last_event when a key is UP 2025-02-08 14:19:32 -07:00
MaeIsBad d1684d38e8 Fix crash on hidpi with wayland (#6508) 2025-02-08 13:33:12 -07:00
Aliaksandr Truš 80b9ffd14c fix(wayland): fix issue with tiled and maximized window
Potential fix for #6262
2025-02-08 13:26:35 -07:00
Jared Baur 444ed2309a wayland: prevent setting cursor when window is not focused 2025-02-08 13:22:54 -07:00
Wez Furlong b6ec0b03d6 macos: suppress warnings from legacy objc crate
This is a PITA. The objc crate does some stuff that spews warnings
everywhere that the sel! and msg_send! macros are used.

That crate is not currently maintained

There is a fork of the crate which resolves the spew, but we also
use the cocoa crate which pulls in the original crate

The new fork is not compatible with cargo workspace patching.

There is an alternative objc2 crate with a nicer, more type-safe
API, but the API changes to migrate are pretty huge: I just lost
a couple of hours on this and still hadn't gotten past the migrating
the NSMenu stuff over.

So, the approach here is to simply ignore the warnings in the modules
that use the objc crate.

This will need to be fixed by someone someday, but that day is not
today.

refs: https://github.com/SSheldon/rust-objc/issues/125
2025-02-07 22:23:22 -07:00
Bowei Zhang 7145a8ffaf chore: resolve nit from linter 2025-02-07 19:07:08 -07:00
Wez Furlong 11c4b11669 s,wez/wezterm,wezterm/wezterm,
I moved the repo to an org of its own. Update various things
to reference the new location.
2025-02-07 13:08:01 -07:00
occupyhabit 72e723187c chore: remove redundant words in comment
Signed-off-by: occupyhabit <wangmengjiao@outlook.com>
2024-12-04 07:49:30 -07:00
Cosimo Matteini a7ff718c7c wayland: reimplement maximize and restore
It was removed with wayland reimplementation in #4777
2024-11-28 10:58:03 -07:00
Anthony M. Cook 0983ae90d6 Mark wayland-backend as optional dependency (#6342)
* Mark wayland-backend as optional dependency

Fixes #6315

https://github.com/wez/wezterm/commit/09ac8c53777ac6de61b757292f5dc4da80322bbd introduced the `wayland-backend` dependency, but did not mark it as optional, this prevented the build from successfully completing on X11 systems without Wayland development libraries.
2024-10-31 23:51:12 -07:00
Wez Furlong da0a738169 rustfmt 2024-09-22 09:11:22 -07:00
Wez Furlong d7938cb6b2 wayland: handle left/right tiling too
refs: https://github.com/wez/wezterm/pull/5897
2024-09-22 09:10:15 -07:00
Aliaksandr Truš c75d300f6f feat: implement toggle_fullscreen and hide for Wayland
closes https://github.com/wez/wezterm/pull/5897
2024-09-22 09:04:43 -07:00
Aliaksandr Truš 16a8bcdd89 fix(wayland): match inner window and window frame sizes 2024-09-22 08:06:10 -07:00
Wez Furlong da3df95114 deps: glium to 0.35
Not sure that this has any impact on us, as the changelog says
that the only change upstream was that glutin was updated.
We don't use glium with glutin, so probably a NOP?
2024-09-15 08:17:51 -07:00
Wez Furlong 09ac8c5377 wgpu -> 22.1
Tested on X11 and Wayland via weston and seems to work

closes: https://github.com/wez/wezterm/pull/5814
2024-09-15 05:56:56 -07:00
Gracjan GóreckiandWez Furlong 137a97bf65 #5518: handling panic in copy_and_paste.rs line 105 (#6004)
* #5518: handling panic in copy_and_paste.rs line 105

Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2024-09-14 10:48:35 -07:00