Commit graph

2848 commits

Author SHA1 Message Date
张小白
df57754baf
windows: Publish nightly (#24800)
The installer, uninstaller, and the Zed binary files are all signed
using Microsoft’s newly launched Trusted Signing service. For
demonstration purposes, I have used my own account for the signing
process.

For more information about Trusted Signing, you can refer to the
following links:
- [Microsoft Security Blog: Trusted Signing is in Public
Preview](https://techcommunity.microsoft.com/blog/microsoft-security-blog/trusted-signing-is-in-public-preview/4103457)
- [Overview of Azure Trusted
Signing](https://learn.microsoft.com/en-us/azure/trusted-signing/overview)

**TODO:**

- [x] `InnoSetup` script to setup an installer
- [x] Signing process
- [x] `Open with Zed` in right click context menu (by using sparse
package)
- [x] Integrate with `cli`
  - [x] Implement `cli` (#25412)
  - [x] Pack `cli.exe` into installer
- [x] Implement auto updating (#25734)
  - [x] Pack autoupdater helper into installer
- [x] Implement dock menus
  - [x] Add `Recent Documents` entries (#26369)
  - [x] Make `zed.exe` aware of sigle instance (#25412)
  - [x] Properly handle dock menu events (#26010)
- [x] Handle `zed://***` uri

**Materials needed:**

- [ ] Icons
  - [ ] App icon for all channels (#9571)
- [ ] Associated file icons, at minimum a default icon
([example](https://github.com/microsoft/vscode/tree/main/resources/win32))
  - [ ] Logos for installer wizard
  - [ ] Icons for appx
- [x] Code signing
- [x] Secrets: AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET,
ACCOUNT_NAME, CERT_PROFILE_NAME
- [x] Other constants: ENDPOINT, Identity Signature (i.e. `CN=Junkui
Zhang, O=Junkui Zhang, L=Wuhan, S=Hubei, C=CN`)





![屏幕截图 2025-02-13
205132](https://github.com/user-attachments/assets/925ec5b2-c8f4-4f0e-8666-26e30278eb3d)



https://github.com/user-attachments/assets/4f1092b4-90fc-4a47-a868-8f2f1a5d8ad8



Release Notes:

- N/A

---------

Co-authored-by: Kate <kate@zed.dev>
Co-authored-by: localcc <work@localcc.cc>
Co-authored-by: Peter Tripp <peter@zed.dev>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2025-07-09 08:57:03 +08:00
Smit Barmase
3a247ee947
project panel: Add indent guides for sticky items (#34092)
- Adds new trait `StickyItemsDecoration` in `sticky_items` which is
implemented by `IndentGuides` from `indent_guides`.

<img width="347" alt="image"
src="https://github.com/user-attachments/assets/577748bc-13f6-41b8-9266-6a0b72349a18"
/>

Release Notes:

- N/A
2025-07-09 05:28:25 +05:30
Alisina Bahadori
925464cfc6
Improve terminal rendering performance (#33345)
Closes #18263

Improvements:

• **Batch text rendering** - Combine adjacent cells with identical
styling into single text runs to reduce draw calls
• **Throttle hyperlink searches** - Limit hyperlink detection to every
100ms or when mouse moves >5px to reduce CPU usage
• **Pre-allocate collections** - Use `Vec::with_capacity()` for cells,
runs, and regions to minimize reallocations
• **Optimize background regions** - Merge adjacent background rectangles
to reduce number of draw operations
• **Cache selection text** - Only compute terminal selection string when
selection exists

Release Notes:

- Improved terminal rendering performance.

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-07-08 09:05:01 -06:00
Smit Barmase
1f3575ad6e
project_panel: Only show sticky item shadow when list is scrolled (#34050)
Follow up: https://github.com/zed-industries/zed/pull/34042

- Removes `top_slot_items` from `uniform_list` in favor of using
existing `decorations`
- Add condition to only show shadow for sticky item when list is
scrolled and scrollable

Release Notes:

- N/A
2025-07-08 14:22:24 +05:30
Ben Kunkle
de9053c7ca
keymap_ui: Add ability to edit context (#34019)
Closes #ISSUE

Adds a context input to the keybind edit modal. Also fixes some bugs in
the keymap update function to handle context changes gracefully. The
current keybind update strategy implemented in this PR is
* when the context doesn't change, just update the binding in place
* when the context changes, but the binding is the only binding in the
keymap section, update the binding _and_ context in place
* when the context changes, and the binding is _not_ the only binding in
the keymap section, remove the existing binding and create a new section
with the update context and binding so as to avoid impacting other
bindings

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2025-07-07 16:44:19 +00:00
张小白
c99e42a3d6
windows: Properly handle surrogates (#34006)
Closes #33791

Surrogate pairs are now handled correctly, so input from tools like
`WinCompose` is properly received.

Release Notes:

- N/A
2025-07-07 20:21:48 +08:00
Smit Barmase
6efc5ecefe
project_panel: Add Sticky Scroll (#33994)
Closes #7243

- Adds `top_slot_items` to `uniform_list` component to offset list
items.
- Adds `ToPosition` scroll strategy to `uniform_list` to scroll list to
specified index.
- Adds `sticky_items` component which can be used along with
`uniform_list` to add sticky functionality to any view that implements
uniform list.


https://github.com/user-attachments/assets/eb508fa4-167e-4595-911b-52651537284c

Release Notes:

- Added sticky scroll to the project panel, which keeps parent
directories visible while scrolling. This feature is enabled by default.
To disable it, toggle `sticky_scroll` in settings.
2025-07-07 08:32:42 +05:30
Alvaro Parker
44d1f512f8
Use /usr/bin/env to run bash restart script (#33936)
Closes #33935

Release Notes:

- Use `/usr/bin/env` to launch the bash restart script
2025-07-05 00:27:21 +00:00
Ben Kunkle
4e6b7ee3ea
keymap_ui: Hover tooltip for action documentation (#33862)
Closes #ISSUE

Show the documentation for an action when hovered. As a bonus, also show
the humanized command palette name!

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2025-07-03 16:35:20 +00:00
Jason Lee
f34a7abf17
gpui: Add shadow_xs, shadow_2xs and fix shadow values to match Tailwind CSS (#33361)
Release Notes:

- N/A

---

https://tailwindcss.com/docs/box-shadow

| name | value |
| -- | -- |
| shadow-2xs | box-shadow: var(--shadow-2xs); /* 0 1px rgb(0 0 0 / 0.05)
*/ |
| shadow-xs | box-shadow: var(--shadow-xs); /* 0 1px 2px 0 rgb(0 0 0 /
0.05) */ |
| shadow-sm | box-shadow: var(--shadow-sm); /* 0 1px 3px 0 rgb(0 0 0 /
0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1) */ |
| shadow-md | box-shadow: var(--shadow-md); /* 0 4px 6px -1px rgb(0 0 0
/ 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1) */ |
| shadow-lg | box-shadow: var(--shadow-lg); /* 0 10px 15px -3px rgb(0 0
0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1) */ |
| shadow-xl | box-shadow: var(--shadow-xl); /* 0 20px 25px -5px rgb(0 0
0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1) */ |
| shadow-2xl | box-shadow: var(--shadow-2xl); /* 0 25px 50px -12px rgb(0
0 0 / 0.25) */ |

## Before

<img width="1112" alt="SCR-20250625-nnxn"
src="https://github.com/user-attachments/assets/3bd44938-5de8-4d67-b323-c444b023a4b6"
/>

## After

<img width="1112" alt="SCR-20250625-nnrt"
src="https://github.com/user-attachments/assets/a5bf2401-f808-4712-9cc6-299f530f9165"
/>
2025-07-03 09:50:26 -03:00
张小白
cdb7564d89
windows: More precise handling of WM_SETTINGCHANGE and appearance updates (#33829)
This PR adds more fine-grained handling of the `WM_SETTINGCHANGE`
message.
Plus, we now only trigger the `appearance_changed` callback when the
actual window appearance has changed, rather than calling it every time.


Release Notes:

- N/A
2025-07-03 17:27:27 +08:00
Ben Kunkle
6cd4dbdea1
gpui: Store action documentation (#33809)
Closes #ISSUE

Adds a new `documentation` method to actions, that is extracted from doc
comments when using the `actions!` or derive macros.

Additionally, this PR adds doc comments to as many action definitions in
Zed as possible.

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2025-07-02 21:14:33 -04:00
Sunli
4fdda8d5a1
gpui: Improve path rendering & global multisample anti-aliasing (#29718)
Currently, the rendering path required creating a texture for each path,
which wasted a large amount of video memory. In our application, simply
drawing some charts resulted in video memory usage as high as 5G.

I removed the step of creating path textures and directly drew the paths
on the rendering target, adding post-processing global multi-sampling
anti-aliasing. Drawing paths no longer requires allocating any
additional video memory and also improves the performance of path
rendering.

Release Notes:

- N/A

---------

Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-07-02 09:41:42 -07:00
Hilmar Wiegand
9dc3ac9657
gpui: Make screen capture dependency optional (#32937)
Add `screen-capture` feature to gpui to enable screen capture support.  The motivation for this is to make dependencies on scap / x11 / xcb optional.

Release Notes:

- N/A

---------

Co-authored-by: Michael Sloan <michael@zed.dev>
2025-07-02 10:15:06 -06:00
Daniel Sauble
f000dfebd2
Add page up/down bindings to the Markdown preview (#33403)
First time contributor here. 😊

I settled on markdown::MovePageUp and markdown::MovePageDown to match
the names the editor uses for the same functionality.

Closes #30246

Release Notes:

- Support PgUp/PgDown in Markdown previews
2025-07-02 12:14:34 +03:00
Sunli
bff5d85ff4
gpui: Add the windows-manifest feature to embed manifest, enable by default (#32440)
Gpui's build.rs will embed a manifest file into the Windows binary, but
sometimes we want to customize it, so I added a feature called
`no-windows-manifest` to disable this behavior.

Release Notes:

- N/A
2025-07-01 13:00:14 +02:00
maan2003
49bc2e61da
gpui: Fix slow scrolling in lists (#33608)
matches editor element's behavior


https://github.com/user-attachments/assets/f70912e1-5adb-403b-a98c-63e2e89929ac


- in first version editor scrolls like 1.5 pages, but agent panel only
scrolls half a page.
- in second version, agent panel also scrolls like 1.5 pages.

Release Notes:

- Fixed skipping of some scroll events in the non-uniform list UI element, which fixes slow scrolling of the agent panel.
2025-07-01 00:44:19 -06:00
Michael Sloan
f022a13091
Add #[serde(deny_unknown_fields)] to action structs that didn't have it (#33679)
Release Notes:

- N/A
2025-07-01 00:20:02 +00:00
Michael Sloan
c74ecb4654
Warn about unknown fields when editing settings json (#33678)
Closes #30017

* While generating the settings JSON schema, defaults all schema
definitions to reject unknown fields via `additionalProperties: false`.

* Uses `unevaluatedProperties: false` at the top level to check fields
that remain after the settings field names + release stage override
field names.

* Changes json schema version from `draft07` to `draft_2019_09` to have
support for `unevaluatedProperties`.

Release Notes:

- Added warnings for unknown fields when editing `settings.json`.
2025-06-30 23:34:25 +00:00
Mikayla Maki
7609ca7a8d
Sketch in a table for the keybindings UI (#32436)
Adds the initial semblance of a keymap UI. It is currently gated behind the `settings-ui` feature flag. Follow up PRs will add polish and missing features.

Release Notes:

- N/A

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>
Co-authored-by: Anthony <anthony@zed.dev>
2025-06-30 19:25:11 -04:00
Michael Sloan
5fafab6e52
Migrate to schemars version 1.0 (#33635)
The major change in schemars 1.0 is that now schemas are represented as
plain json values instead of specialized datatypes. This allows for more
concise construction and manipulation.

This change also improves how settings schemas are generated. Each top
level settings type was being generated as a full root schema including
the definitions it references, and then these were merged. This meant
generating all shared definitions multiple times, and might have bugs in
cases where there are two types with the same names.

Now instead the schemar generator's `definitions` are built up as they
normally are and the `Settings` trait no longer has a special
`json_schema` method. To handle types that have schema that vary at
runtime (`FontFamilyName`, `ThemeName`, etc), values of
`ParameterizedJsonSchema` are collected by `inventory`, and the schema
definitions for these types are replaced.

To help check that this doesn't break anything, I tried to minimize the
overall [schema
diff](https://gist.github.com/mgsloan/1de549def20399d6f37943a3c1583ee7)
with some patches to make the order more consistent + schemas also
sorted with `jq -S .`. A skim of the diff shows that the diffs come
from:

* `enum: ["value"]` turning into `const: "value"`
* Differences in handling of newlines for "description"
* Schemas for generic types no longer including the parameter name, now
all disambiguation is with numeric suffixes
* Enums now using `oneOf` instead of `anyOf`.

Release Notes:

- N/A
2025-06-30 21:07:28 +00:00
Kirill Bulatov
e37ef2a991
Use more generic error messages in gpui (#33651)
Follow-up of https://github.com/zed-industries/zed/pull/32537

Release Notes:

- N/A
2025-06-30 13:40:31 +00:00
alphaArgon
1d684c8890
Add shadow back for blurred/transparent window on macOS (#27403)
Closes #15383
Closes #10993

`NSVisualEffectView` is an official API for implementing blur effects
and, by traversing the layers, we **can remove the background color**
that comes with the view. This avoids using private APIs and aligns
better with macOS’s native design.

Currently, `GPUIView` serves as the content view of the window. To add
the blurred view, `GPUIView` is downgraded to a subview of the content
view, placed at the same level as the blurred view.

Release Notes:

- Fixed the missing shadow for blurred-background windows on macOS.

---------

Co-authored-by: Peter Tripp <peter@zed.dev>
2025-06-28 09:50:54 +03:00
Piotr Osiewicz
985dcf7523
chore: Bump Rust version to 1.88 (#33439)
Goodies in this version:
- if-let chains 🎉
- Better compiler perf for Zed
(https://github.com/rust-lang/rust/pull/138522)

For more, see: https://releases.rs/docs/1.88.0/

Release Notes:

- N/A

---------

Co-authored-by: Junkui Zhang <364772080@qq.com>
2025-06-26 20:54:19 +02:00
Michael Sloan
90c893747c
gpui: Prevent the same action name from being registered multiple times (#33359)
Also removes duplicate `editor::RevertFile` and `vim::HelixDelete`
actions

Release Notes:

- N/A
2025-06-26 06:24:14 +00:00
Michael Sloan
dfdeb1bf51
linux: Don't insert characters if modifiers other than shift are held (#33424)
Closes #32219 #29666

Release Notes:

- Linux: Now skips insertion of characters when modifiers are held. Before, characters were inserted if there's no match in the keymap.
2025-06-25 17:11:59 -06:00
Michael Sloan
aae4778b4e
gpui: Add more flushing of x11 requests (#33407)
Flushes should happen after sending messages to X11 when effects should
be applied quickly. This is not needed for requests that return replies
since it automatically flushes in that case.

Release Notes:

- N/A
2025-06-25 19:46:15 +00:00
Matin Aniss
e5c812fbcb
gpui: Dynamic element arena (#32079)
Implements a chunking strategy for the element arena that allows it to
grow dynamically based on allocations, it is initialised with a single
chunk of a total size of 1 mebibyte. On allocation of data with a size
greater than the remaining space of the current chunk a new chunk is
created.

This reduces the memory allocation from the static 32 mebibytes, this
especially helps GPUI applications that don't need such a large element
arena and even Zed in most cases. This also prevents the panic when
allocations ever exceed the element arena.

Release Notes:

- N/A

---------

Co-authored-by: Michael Sloan <michael@zed.dev>
2025-06-25 13:29:13 -06:00
waffle
f738fbd4f8
gpui: Disable rounding in the layout engine (#31836)
Rounding broke (among other things, probably) pixel-perfect image
rendering with non-power-of-two scaling factor.

An example which reproduces the problem can be found
[here](https://github.com/WaffleLapkin/gpui_taffy_rounding_whyyyyy).

How it looks with `gpui` from `main`:
![2025-05-31
11:34:25+CEST](https://github.com/user-attachments/assets/2cb19312-6ba6-4e80-8072-f89ddedff77b)

How it looks with this patch:
![2025-05-31
11:35:28+CEST](https://github.com/user-attachments/assets/114b52a9-58c0-4600-871c-a20eceb7179e)

Both screenshots are made on kde+wayland with magnification using kde's
built-in magnification (`Meta`+`+`, `Meta`+`-`). Note that screenshot
apps have a high chance of lying 🙃

The image itself is 400 by 300 pixels of red/green checkerboard pattern
made specifically to exaggerate scaling issues.

Release Notes:

- N/A
2025-06-24 20:28:57 +00:00
Michael Sloan
9427526a41
gpui: Clear the element arena after presenting the frame (#33338)
This is an easy way to shave some microseconds off the critical path for
frame rendering. On my machine this reduces typical frame rendering
latency by ~100 microseconds, probably quite a bit more on slower
machines.

Here is how long it typically takes to drop elements from the arena,
from a fairly brief run:


![image](https://github.com/user-attachments/assets/65cfd911-eccf-4393-887d-8cad2cd27148)

Release Notes:

- N/A
2025-06-24 19:43:33 +00:00
Ben Kunkle
deb2564b31
gpui: Add keybind metadata API (#33316)
Closes #ISSUE

Adds a very simple API to track metadata about keybindings in GPUI,
namely the source of the binding. The motivation for this is displaying
the source of keybindings in the [keymap
UI](https://github.com/zed-industries/zed/pull/32436).

The API is designed to be as simple and flexible as possible, storing
only a `Option<u32>` on the bindings themselves to keep the struct
small. It is intended to be used as an index or key into a table/map
created and managed by the consumer of the API to map from indices to
arbitrary meta-data. I.e. the consumer is responsible for both
generating these indices and giving them meaning.

The current usage in Zed is stateless, just a mapping between constants
and User, Default, Base, and Vim keymap sources, however, this can be
extended in the future to also track _which_ base keymap is being used.

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2025-06-24 16:07:45 +00:00
Michael Sloan
24c94d474e
gpui: Simplify Action macros + support doc comments in actions! (#33263)
Instead of a menagerie of macros for implementing `Action`, now there
are just two:

* `actions!(editor, [MoveLeft, MoveRight])`
* `#[derive(..., Action)]` with `#[action(namespace = editor)]`

In both contexts, `///` doc comments can be provided and will be used in
`JsonSchema`.

In both contexts, parameters can provided in `#[action(...)]`:

- `namespace = some_namespace` sets the namespace. In Zed this is
required.

- `name = "ActionName"` overrides the action's name. This must not
contain "::".

- `no_json` causes the `build` method to always error and
`action_json_schema` to return `None`
and allows actions not implement `serde::Serialize` and
`schemars::JsonSchema`.

- `no_register` skips registering the action. This is useful for
implementing the `Action` trait
while not supporting invocation by name or JSON deserialization.

- `deprecated_aliases = ["editor::SomeAction"]` specifies deprecated old
names for the action.
These action names should *not* correspond to any actions that are
registered. These old names
can then still be used to refer to invoke this action. In Zed, the
keymap JSON schema will
accept these old names and provide warnings.

- `deprecated = "Message about why this action is deprecation"`
specifies a deprecation message.
In Zed, the keymap JSON schema will cause this to be displayed as a
warning. This is a new feature.

Also makes the following changes since this seems like a good time to
make breaking changes:

* In `zed.rs` tests adds a test with an explicit list of namespaces. The
rationale for this is that there is otherwise no checking of `namespace
= ...` attributes.

* `Action::debug_name` renamed to `name_for_type`, since its only
difference with `name` was that it

* `Action::name` now returns `&'static str` instead of `&str` to match
the return of `name_for_type`. This makes the action trait more limited,
but the code was already assuming that `name_for_type` is the same as
`name`, and it requires `&'static`. So really this just makes the trait
harder to misuse.

* Various action reflection methods now use `&'static str` instead of
`SharedString`.

Release Notes:

- N/A
2025-06-24 04:34:51 +00:00
Matin Aniss
a067c16c82
windows: Use drop target helper (#33203)
It now utilises the
[`IDropTargetHelper`](https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-idroptargethelper)
in drag and drop events to render the proper item drop cursor icon which
includes the thumbnail when available and action text. Also swaps the
drop effect from `DROPEFFECT_LINK` to `DROPEFFECT_COPY` to match other
Windows application behaviour.

Example of drop icon

![example_drop](https://github.com/user-attachments/assets/4f8ea86c-929a-4813-9f8e-b3553ecf4d6e)

Release Notes:

- N/A

---------

Co-authored-by: 张小白 <364772080@qq.com>
2025-06-23 13:30:21 +00:00
Matin Aniss
1a6c1b2159
windows: Fix window close animation (#33228)
Implements a workaround which removes the `WS_EX_LAYERED` style from the
window right before closing it which seems to fix the window close
animation not playing.

Release Notes:

- N/A
2025-06-23 21:13:53 +08:00
张小白
272fc672af
windows: Dialog QoL improvements (#33241)
Just like in the previous PR #33230, we need to properly set up modal
windows to make them work as expected.

Before this PR, when you opened an "Open File" or "Save File" dialog,
clicking the main window would steal focus from the modal, even though
the main window wasn’t actually interactive.

With this PR, clicking the main window while a modal is open does
nothing — as it should — until the modal is closed.

#### Before



https://github.com/user-attachments/assets/9c6bdff0-1c46-49c1-a5ff-751c52c7d613

#### After



https://github.com/user-attachments/assets/8776bd28-85ff-4f32-8390-bcf5b4eec1fe





Release Notes:

- N/A
2025-06-23 11:02:00 +00:00
张小白
28f56ad7ae
windows: Avoid setting the mouse cursor while the window is disabled (#33230)
Don’t set the mouse cursor when the window is disabled, it causes issues
with modal dialogs.

Release Notes:

- N/A
2025-06-23 05:59:10 +00:00
Artem Zhurikhin
67ac80bd19
linux: Fix KeePassXC integration via org.freedesktop.Secrets (#33026)
Closes #29956

Unlike GNOME Keyring, KeePassXC locks individual secrets in addition to
the entire database when configured to ask for confirmation for access
requests by DBus clients. As such, before the secret is read it should
be unlocked by the client.

Tested against both KeePassXC and GNOME Keyring, and with this patch Zed
successfully logs in and fetches the API keys from the Secret Service.

Release Notes:

- Fixed KeePassXC integration via org.freedesktop.Secrets
2025-06-22 18:57:45 -06:00
Hiroki Tagato
ac30a8b0df
Improve FreeBSD support (#33162)
This PR contains a set of changes for improving FreeBSD support (#15309,
#29550) and is a kind of follow up to the PR #20480 which added an
initial support for FreeBSD.

A summary of changes is as follows:
- Add some more freebsd conditionals which seem missing in the previous
PR.
- Implement `anonymous_fd()` and `current_path()` functions for FreeBSD.
- Improve detection of FreeBSD in telemetry and GPU detection.
- Temporarily disable LiveKit/WebRTC support to make build succeed.
- Remove support for flatpak since it is Linux-only packaging format.

Adding `RUSTFLAGS="-C link-dead-code"` does not seem necessary anymore.
It builds fine without the flag.

Known issues:
- Integrated terminal is painfully laggy and virtually unusable in my
environment. This might be specific to my setup.
- I cannot input Japanese using IME. When I type characters, they appear
on the screen. But when I hit return key, they disappears. Seems the
same issue as #15409.

My environment is MATE desktop on X11 on FreeBSD 14.2 on Intel Core
i5-7260U integrated graphics.

P.S. For those who might be interested, a work-in-progress FreeBSD port
and binary packages are available at
https://github.com/tagattie/FreeBSD-Zed

Release Notes:

- N/A

---------

Co-authored-by: Peter Tripp <peter@zed.dev>
2025-06-22 16:23:17 -04:00
张小白
5244085bd0
windows: Fix wrong glyph index being reported (#33193)
Closes #32424

This PR fixes two bugs:

* In cases like `fi ~~something~~`, the `fi` gets rendered as a
ligature, meaning the two characters are combined into a single glyph.
The final glyph index didn’t account for this change, which caused
issues.
* On Windows, some emojis are composed of multiple glyphs. These
composite emojis can now be rendered correctly as well.

![屏幕截图 2025-06-22
161900](https://github.com/user-attachments/assets/e125426b-a15e-41d1-a6e6-403a16924ada)

![屏幕截图 2025-06-22
162005](https://github.com/user-attachments/assets/f5f01022-2404-4e73-89e5-1aaddf7419d9)


Release Notes:

- N/A
2025-06-22 11:14:58 +00:00
Smit Barmase
7812985d3c
linux: Fix blurry rendering on Wayland when using fractional scaling (#33087)
Closes #25195

In Wayland, To create buffer size (`renderer.update_drawable_size`), we
convert logical pixels to device pixels by taking the scale factor into
account. Later, we also let the compositor know the logical pixels we
want to use for our app (`viewport.set_destination`). Then, the
compositor takes our buffer and tries to scale it to fit the viewport
size we provided. If this is accurate, we see perfect rendering. If our
buffer size is not accurate (off by 1px in this case), the compositor
scales our buffer to fit the viewport size. This causes blur.

To make sure we set correct buffer size for renderer as same as what
compositor is going to use, we needs to use rounding instead of truncate
when converting logical pixels to device pixels. It's not super clear
from docs, what exact algorithm it uses but it says it uses rounding and
seems to fix issue for me if we follow that for our buffer.

From https://wayland.app/protocols/fractional-scale-v1:
> If a surface has a surface-local size of 100 px by 50 px and wishes to
submit buffers with a scale of 1.5, then a buffer of 150px by 75 px
should be used and the wp_viewport destination rectangle should be 100
px by 50 px.
>
> For toplevel surfaces, the size is **rounded halfway away from zero**.
The rounding algorithm for subsurface position and size is not defined.

Tested on:
- [x] Gnome
- [x] KDE
- [ ] ~Sway~ (Need to investigate this more for Sway)

Release Notes:

- Fixed blurry rendering on Wayland when using fractional scaling for
Gnome and KDE.

Co-authored-by: Julia Ryan p1n3appl3@users.noreply.github.com
Co-authored-by: Antonio Scandurra me@as-cii.com
2025-06-20 21:22:08 +05:30
张小白
c02e249ecb
windows: Simplify the logic of handle_get_min_max_info_msg (#33102)
Release Notes:

- N/A
2025-06-20 12:52:37 +00:00
张小白
f8a0eb5a8c
Fix capslock on windows (#33093)
The new feature doesn't work well on windows

Release Notes:

- N/A
2025-06-20 10:57:00 +00:00
张小白
4da58188fb
windows: Fix client area is treated as non-client area when window is fullscreen (#32916)
Closes #32909

Release Notes:

- N/A
2025-06-18 02:19:36 +00:00
Michael Sloan
9bdfd1e98a
gpui: Fix pending keys dispatch path panic (#32891)
For me this is a panic that started occurring today in my use of Zed.
The repro is to type `ctrl-x` to start a pending key sequence and then
close the collab side panel with the mouse. The issue is that
dispatching the action based on pending keystrokes uses the same
`DispatchNodeId` as when the 1 second timer was started.
`DispatchNodeId` is not stable across frames. This also means that the
wrong `DispatchNodeId` can be used in the non-panicing case, potentially
causing the action to not occur.

The mystery here is why did this only start happening now in my use of
Zed, and why isn't it showing up in the panics dashboard / issue
reports.

Panic looks like

```
{
  "thread": "main",
  "payload": "index out of bounds: the len is 467 but the index is 1861",
  "location_data": {
    "file": "crates/gpui/src/key_dispatch.rs",
    "line": 519
  },
  "backtrace": [
    "zed::reliability::init_panic_hook::{{closure}}::he1d8257b19b16eec+155265758",
    "std::panicking::rust_panic_with_hook::h33b18b24045abff4+128544307",
    "std::panicking::begin_panic_handler::{{closure}}::hf8313cc2fd0126bc+128543530",
    "std::sys::backtrace::__rust_end_short_backtrace::h57fe07c8aea5c98a+128537145",
    "__rustc[95feac21a9532783]::rust_begin_unwind+128542669",
    "core::panicking::panic_fmt::hd54fb667be51beea+9456688",
    "core::panicking::panic_bounds_check::h1a9bf3d94de0fc80+9457170",
    "gpui::key_dispatch::DispatchTree::dispatch_path::hce77d277881569bf+73992023",
    "gpui::app::App::spawn::{{closure}}::hb1e79bbbdead3012+73687056",
    "async_task::raw::RawTask<F,T,S,M>::run::hd13f66f99bb24bbd+70694231",
    "<gpui::platform::linux::x11::client::X11Client as gpui::platform::linux::platform::LinuxClient>::run::h5a92ddaaf9a06dd1+74465138",
    "gpui::platform::linux::platform::<impl gpui::platform::Platform for P>::run::hd19ac52b2d94268e+74064525",
    "gpui::app::Application::run::hee83110c717a5af0+151862692",
    "zed::main::hca7e2265584c4139+153307630",
    "std::sys::backtrace::__rust_begin_short_backtrace::h2e04f4034c2d82c5+153146899",
    "std::rt::lang_start::{{closure}}::h91cf1ca0eeae23ae+154454121",
    "std::rt::lang_start_internal::h418648f91f5be3a1+128467809",
    "main+153326748",
    "__libc_start_call_main+25056432783818",
    "__libc_start_main_impl+25056432784011",
    "_start+12389486"
  ],
  "app_version": "0.190.6",
  "app_commit_sha": "9a2dcbbe24",
  "release_channel": "stable",
  "target": "x86_64-unknown-linux-gnu",
  "os_name": "Linux X11",
  "os_version": "ubuntu 24.04",
  "architecture": "x86_64",
  "panicked_on": 1750185799233,
  "system_id": "abae7201-61fb-442b-922b-202071ae81c0",
  "installation_id": "69a0fb9a-11a2-4065-ad8c-b281e68525ad",
  "session_id": "bc5b5f2f-e4c3-44a8-948e-c0550a2e2ef2"
}
```

Release Notes:

- Fixed a rare panic / potential incorrect action dispatch when a
pending keysequence is applied after the 1 second timer elapsing.
2025-06-18 01:40:59 +00:00
Michael Sloan
aa1b2d74ee
x11: Improve error handling (#32913)
Continuing this work from a while back in #21079, now greatly aided by
agent + sonnet 4. With this change, there are now only a few spots that
explicitly panic, though errors during initialization will panic.

Motivation was this recent user panic in `handle_event`, figured fixing
all this use of unwrap was a great use of the agent.

> called `Result::unwrap()` on an `Err` value: X11 GetProperty for
_NET_WM_STATE failed.

Release Notes:

- N/A
2025-06-18 01:40:17 +00:00
Maxim Zaks
90aa99bb14
Add Caps Lock support (#30470)
Closes #21700

Release Notes:

- Added caps lock support and show a warning if the user is entering an
SSH password with Caps Lock enabled

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
Co-authored-by: 张小白 <364772080@qq.com>
2025-06-18 00:43:33 +00:00
Michael Sloan
2539d57ac7
wayland: Avoid reloading cursor theme on every cursor style change (#32832)
Release Notes:

- N/A
2025-06-17 04:27:02 +00:00
Michael Sloan
c95e2a2f1d
linux: Add mouse cursor icon name synonyms (#32820)
Most of the default icon sets on Ubuntu do not use the names that were
there. To fix, using the icon synonyms from the chromium source. This
will probably fix some of the linux mouse cursor issues tracked in
#26141

Also adds a note in the load failure logs mentioning that misconfigured
`XCURSOR_PATH` may be the issue. I ran into this because [the alacritty
snap incorrectly sets
XCURSOR_PATH](https://github.com/snapcrafters/alacritty/issues/21).

On X11 also adds:

* Caching of load errors to log once for missing cursor icons.

* Fallback on default cursor icon. This way if there was a transition
from a non-default icon to a missing icon it doesn't get stuck showing
the non-default icon.

Leaving release notes blank as I have other mouse cursor fixes and would
prefer to just have one entry in the release notes.

Release Notes:

- N/A
2025-06-17 03:39:10 +00:00
Michael Sloan
baad66c740
wayland: Hopefully fix a panic recenty added in #32784 (#32808)
Release Notes:

- N/A
2025-06-16 16:57:42 +00:00
Michael Sloan
4733f188da
linux: Only call on_keyboard_layout_change when layout name changes (#32784)
Release Notes:

- N/A
2025-06-16 05:35:19 +00:00