Clearing ime_text before interpretKeyEvents makes hasMarkedText()
answer NO while a composition is active. AppKit consults it when
applying text that an input method commits during the key event,
and discards commit text arriving together with a function key.
Korean IMEs finalize the composing syllable when an arrow key is
pressed, so that syllable was lost instead of being committed.
ime_text is maintained by setMarkedText/insertText/unmarkText, so
removing the pre-clear leaves the state correct.
refs: #6907
update_selection_owner asserted ownership using self.copy_and_paste.time
That field only advances on key and button events delivered to that
particular window, so a window the user has not touched recently carries
a timestamp that predates the selection's lastTimeChanged.
The X server ignores SetSelectionOwner in that case, so the assertion was
previously dropped.
Use X's CURRENT_TIME constant instead which is always accepted.
This mirrors what focus() already does for the same underlying reason.
refs: #5917
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>
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.
* 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>
* 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>
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.
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
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>
* 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.
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.
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
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
* 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>
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
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