Commit Graph

1826 Commits

Author SHA1 Message Date
Andrew Lygin
1b4c82dc2c
Fix next/prev shortcuts handling in the File Finder (#9785)
This PR fixes the unexpected File Finder behaviour described in
https://github.com/zed-industries/zed/pull/8782#issuecomment-2018551041

Any change of the modifier keys except for the release of the initial
modifier keys now prevents opening the selected file.

Release Notes:

- N/A
2024-03-25 14:06:37 -07:00
Paul
4789c02a19
X11: Double click (#9739)
This copies the logic from #9608 to the X11 client.

Fixes #9707.

Release Notes:
- N/A

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-25 11:44:31 -07:00
RoblKyogre
030e299b27
Fix key repeat after releasing a different key on Wayland (#9768)
Quick fix that fixes key repeat not working when releasing a different
key than the current one being held

Don't really know much rust yet, so unsure this is the best way to
handle this, but this does seem like a good starting point to get at
least a tad familiar with it

Release Notes:
- N/A
2024-03-25 11:44:24 -07:00
白山風露
6231df978b
Windows: fix initial active status (#9694)
Separate from #9451

On Windows, a new window may already active immediate after creation.

Release Notes:

- N/A

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-03-25 11:44:18 -07:00
Ezekiel Warren
78dc458231
windows: Mouse wheel coordinates fix (#9749)
mouse scroll wasn't working unless the window was maximized or in the
top left corner because the Windows wheel events give screen coordinates

Release Notes:

- N/A
2024-03-25 11:14:51 -07:00
Raunak Raj
2646ed08e7
linux: Implement restart and app_path (#9681)
Added `restart` and `app_path` method for linux platform which was
marked as `//todo(linux)`


Release Notes:

- N/A
2024-03-25 11:14:29 -07:00
Daniel Zhu
569a7234fd
Handle first click on Zed window (#9553)
Fixes #4336
2024-03-25 10:52:18 -07:00
白山風露
5361a4d72d
Windows: Better cursor (#9451)
Moved `SetCursor` calls to `WM_SETCURSOR`, which occurs when OS is
requires set cursor.

Release Notes:

- N/A
2024-03-25 10:06:52 -07:00
Waffle Maybe
eec8660759
Use .is_some_and() instead of .is_some() && .unwrap() (#9704)
That's nicer & more readable.

(I just noticed that this looks weird while trying to understand why zed
changes my cursor, so decided to make a quick fix (btw the issue with
the cursor is that zed always loads cursor named "default" on wayland))

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-03-25 11:11:35 -04:00
Piotr Osiewicz
a7047f67fb
chore: Revert "gpui: update dependencies" (#9774)
Reverts zed-industries/zed#9741

/cc @niklaswimmer it looks like that PR change broke our rendering of
avatars (as @bennetbo found out) - they have a blue-ish tint now, which
I suppose might have to do with change between BGRA and RGBA. I'm gonna
revert it for now, let's reopen it though.


![image](https://github.com/zed-industries/zed/assets/24362066/3078d9c6-9638-441b-8b32-d969c46951e0)

Release Notes:

- N/A
2024-03-25 15:27:16 +01:00
Niklas Wimmer
7f9355e11f windows: update text system to new cosmic version
The same changes have been used on linux here 5003504031
and here 34832d49b09071846ff6f55f8ca1df019980a1df.

Signed-off-by: Niklas Wimmer <mail@nwimmer.me>
2024-03-25 13:03:57 +01:00
Niklas Wimmer
6a22c8a298 gpui: Update image dependency
The latest update to resvg bumped some transitive dependencies
which lead to duplicates. The update to the image dependency
unifies most of their versions again.

Most notably, gif and kurbo are still duplicated, which is best fixed
downstream however.

Signed-off-by: Niklas Wimmer <mail@nwimmer.me>
2024-03-25 13:03:57 +01:00
Niklas Wimmer
007acc4bc2 gpui: Update cosmic-text and resvg dependency
This unifies the rustybuzz dependency to the same version.

Signed-off-by: Niklas Wimmer <mail@nwimmer.me>
2024-03-25 13:03:57 +01:00
Niklas Wimmer
97f1d61a4a gpui: make build dependencies mac only
This removes bindgen and cbindgen from the dependency graph on non-macos
systems, improving compile times on those systems.

Signed-off-by: Niklas Wimmer <mail@nwimmer.me>
2024-03-25 13:03:57 +01:00
Niklas Wimmer
50ab60b9f0 gpui: update ashpd and open dependency
The ashpd update removes the dependency on an older zbus version which
decreases compile times.

Signed-off-by: Niklas Wimmer <mail@nwimmer.me>
2024-03-25 13:03:57 +01:00
Bennet Bo Fenner
ce57db497e
chat panel: Fix tooltips not working for links (#9691)
Closes #9418 

Noticed a difference in the `cx.set_tooltip(...)` calls between `div`
and `InteractiveText`. `div` calls `cx.set_tooltip(...)` inside
`after_layout`, but `InteractiveText` was calling this inside `paint`. I
believe as #9012 was merged, we need to call `cx.set_tooltip` inside
`after_layout`, as inserting inside `paint` does not seem to be
supported anymore.

I moved the code for setting the tooltip to `after_layout` and hovering
over links inside the chat seems to bring up the tooltips again.

Before:

See https://github.com/zed-industries/zed/issues/9418#issue-2189398784

After:


![image](https://github.com/zed-industries/zed/assets/53836821/a623164c-1ce0-40d7-bc53-020f176fba4a)


Release Notes:

- Fixed tooltip not showing up when hovering over links inside the chat
panel ([#9418](https://github.com/zed-industries/zed/issues/9418))
2024-03-22 14:47:57 +01:00
张小白
ae6f138b6c
Fix compute_width_for_char (#9643)
Release Notes:

- N/A
2024-03-22 09:10:42 +01:00
Daniel Zhu
441677c90a
Fix typo (mimized -> minimized) (#9674) 2024-03-21 16:14:31 -07:00
张小白
4183805a39
windows: fix window activate action (#9664)
Now, the window activation event can be triggered correctly. As shown in
the video, when the window is activated, the caret blinks; when the
window loses activation due to me clicking on the PowerShell window, the
caret stops blinking.



https://github.com/zed-industries/zed/assets/14981363/4c1b2bec-319d-4f21-879e-5a0af0a00d8e



Release Notes:

- N/A
2024-03-21 15:24:17 -07:00
张小白
1e543b9755
windows: implement IME caret movement and editing while composing (#9659)
https://github.com/zed-industries/zed/assets/14981363/598440f7-0364-4053-9f44-710291f8aa92



Release Notes:

- N/A
2024-03-21 12:10:22 -07:00
Mikayla Maki
e07192e4e3
Implement is_minimized for macOS (#9651)
Release Notes:

- N/A
2024-03-21 09:36:54 -07:00
张小白
d89905fc3d
Fix IME window position with scale factor greater than 1.0 (#9637)
In #9456 I forgot to handle this...

Release Notes:

- N/A
2024-03-21 09:31:43 -07:00
白山風露
e1d1d575c3
Windows: Fix XButton direction (#9629)
Release Notes:

- N/A
2024-03-21 09:31:19 -07:00
张小白
3fd62a2313
windows: display icon (#9571)
Now `Zed` can display icons. The image below shows the icon of the
`zed.exe` file and the icon in the right-click properties.

![Screenshot 2024-03-20
181054](https://github.com/zed-industries/zed/assets/14981363/8f1ccc7f-aab0-46cf-8c32-a3545ba710a3)

I used the `crates\zed\resources\app-icon@2x.png` file to generate the
`.ico` file. Due to some blank space around the logo in the original
file, the logo appears slightly smaller on Windows compared to other
software.

![Screenshot 2024-03-20
181155](https://github.com/zed-industries/zed/assets/14981363/874c5ed3-6796-428c-9a91-f91231bb6510)

The current `.ico` file contains logo files of multiple sizes: 16x16,
24x24, 32x32, 48x48, 64x64, 96x96, 128x128, 256x256, 512x512.

Release Notes:

- N/A
2024-03-21 09:30:01 -07:00
白山風露
f179158913
windows: Avoid recording minimized position to database (#9407)
Minimizing window records strange position to DB. When Zed is restarted,
the window goes far away.
<img width="975" alt="image"
src="https://github.com/zed-industries/zed/assets/6465609/98dbab71-fdbb-4911-b41a-9c3e498e5478">

So I fixed.

Release Notes:

- N/A
2024-03-21 09:15:16 -07:00
白山風露
f88f1bce20
Windows: Not logging frequent WM_PAINTs (#9566)
The logging of WM_PAINT for each frame was not very meaningful, so it
was eliminated.
Other logging levels were also reduced to trace.

Release Notes:

- N/A

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-21 09:11:33 -07:00
Mikayla Maki
0b019282c3
Wayland: double click (#9608)
This PR builds off of an earlier version of
https://github.com/zed-industries/zed/pull/9595, rearranges some of the
logic, and removes an unused platform API.

Release Notes:

- N/A

---------

Co-authored-by: apricotbucket28 <agustin.nicolas.marcos@outlook.com>
2024-03-20 19:22:47 -07:00
Andrew Lygin
5602c48136
Action release handlers (#8782)
This PR adds support for handling action releases &mdash; events that
are fired when the user releases all the modifier keys that were part of
an action-triggering shortcut.

If the user holds modifiers and invokes several actions sequentially via
shortcuts (same or different), only the last action is "released" when
its modifier keys released.

~The following methods were added to `Div`:~
- ~`capture_action_release()`~
- ~`on_action_release()`~
- ~`on_boxed_action_release()`~

~They work similarly to `capture_action()`, `on_action()` and
`on_boxed_action()`.~

See the implementation details in [this
comment](https://github.com/zed-industries/zed/pull/8782#issuecomment-2009154646).

Release Notes:

- Added a fast-switch mode to the file finder: hit `p` or `shift-p`
while holding down `cmd` to select a file immediately. (#8258).

Related Issues:

- Implements #8757 
- Implements #8258
- Part of #7653 

Co-authored-by: @ConradIrwin
2024-03-20 18:43:31 -06:00
Mikayla Maki
91ab95ec82
Fix bugs in linux text system (#9604)
Supersedes https://github.com/zed-industries/zed/pull/9579 by manually
including it.

Release Notes:

- N/A
2024-03-20 15:27:56 -07:00
白山風露
b1feeb9f29
Windows: Refactoring (#9580)
Aggregate `DefWindowProc` calls with individual handler return value as
`Option<isize>`

Release Notes:

- N/A
2024-03-20 13:36:28 -07:00
Ezekiel Warren
d5e0817fbc
windows: Fix title bar height when maximized (#9449)
screenshots and description incoming

## title bar when window is maximized
| before | after |
| ---    | ---   |
|
![image](https://github.com/zed-industries/zed/assets/1284289/075a943d-54db-4b71-9fa0-15f823255182)
|
![image](https://github.com/zed-industries/zed/assets/1284289/39a1d381-fcfd-4651-aab4-231a8ec3bd99)
|

## ~~caption buttons at 200%~~
~~buttons are now properly responsive at different scales~~
~~closes #9438~~
~~proper scale factor handling in follow up PR (possibly #9440)~~

<details>
  <summary>out of date image</summary>


![scale-factor](https://github.com/zed-industries/zed/assets/1284289/299d37b8-0d2e-4f2e-81db-2fff6fc59a62)
</details>

should be fixed by https://github.com/zed-industries/zed/pull/9456


Release Notes:

- N/A
2024-03-19 20:54:00 -07:00
张小白
85c294da9a
windows: Implement app_version (#9410)
#### Call `app_version`:

![Screenshot 2024-03-16
011821](https://github.com/zed-industries/zed/assets/14981363/9e618e49-fee2-4e7a-b884-6b0be05a0c95)

#### `Zed.exe` info:

![Screenshot 2024-03-16
011856](https://github.com/zed-industries/zed/assets/14981363/2b17a5df-ad38-42d0-8396-53680d77101d)


Release Notes:

- N/A
2024-03-19 12:40:57 -07:00
Luke Jones
cfa0fc96f0
wayland: change some borrow_mut to borrow, reduce borrow scopes, fix two crashes (#9306)
Release Notes:

- N/A
2024-03-19 12:40:09 -07:00
张小白
086f4e63c5
windows: Properly handle DPI (#9456)
As I mentioned before, there are the following issues with how GPUI
handles scale factors greater than 1.0:
1. The title bar buttons do not function correctly, with minimizing
button performing maximization and maximizing button performing closure.
2. As discussed in #8809, setting a scale factor greater than 1.0 causes
GPUI's drawing content to be pushed off the screen.

This PR introduces `LogicalSize` and `PhysicalSize` to differentiate
between coordinate systems for proper GPUI rendering, and now scale
factors above 1.5 are working correctly.

`Zed` with a scale factor equals 1.5, and change between different scale
factors:



https://github.com/zed-industries/zed/assets/14981363/3348536d-8bd3-41dd-82f6-052723312a5b



Release Notes:

- N/A
2024-03-19 12:39:36 -07:00
apricotbucket28
2c36652be2
wayland: fix handling of non-discrete scroll events (#9548)
https://github.com/zed-industries/zed/pull/9103 broke touchpad scrolling
on Wayland
This PR correctly filters the `Axis` to handle all non-discrete scroll
events (see
https://wayland.app/protocols/wayland#wl_pointer:enum:axis_source)

Should fix https://github.com/zed-industries/zed/issues/9525

Release Notes:

- N/A
2024-03-19 12:25:10 -07:00
Antonio Scandurra
2ea333fff6
Insert hitbox if div contains tooltip (#9545)
Release Notes:

- Fixed a bug that would cause certain tooltips to not show up
(preview-only).
2024-03-19 19:02:59 +01:00
Ezekiel Warren
ac6c4f3ca8
windows: fix 'space' keystroke keydown event (#9476)
the space key was being reported as key " " which didn't allow it to be
used in keybindings

Release Notes:

- N/A
2024-03-19 10:35:28 -07:00
Mikayla Maki
fd0071f2af
Add an animation to the LSP checking indicator (#9463)
Spinner go spinny.

Extra thanks to @kvark for helping me with the shaders.



https://github.com/zed-industries/zed/assets/2280405/9d5f4f4e-0d43-44d2-a089-5d69939938e9


Release Notes:

- Added a spinning animation to the LSP checking indicator

---------

Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
2024-03-19 10:16:18 -07:00
Kyle Kelley
56bd96bc64
Image viewer (#9425)
This builds on #9353 by adding an image viewer to Zed. Closes #5251.

Release Notes:

- Added support for rendering image files
([#5251](https://github.com/zed-industries/zed/issues/5251)).

<img width="1840" alt="image"
src="https://github.com/zed-industries/zed/assets/836375/3bccfa8e-aa5c-421f-9dfa-671caa274c3c">

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-19 10:13:10 -07:00
Niklas Wimmer
7573f35e8e
Simplify and document parts of linux text system code (#9443)
I mainly focused on improving the `font_id` function, see the
description of e286483262 for more
details. The rest are some drive-by changes I could not resist to.

When I am right about af4d6c43ce, someone
with a Mac could change it there as well.

This PR is probably best reviewed commit by commit :)

cc @gabydd @h3mosphere

Release Notes:

- N/A

---------

Signed-off-by: Niklas Wimmer <mail@nwimmer.me>
2024-03-19 08:27:48 -07:00
白山風露
250528d28f
Windows: Auto close HANDLE (#9429)
`HANDLE` is wrapped in a RAII struct.

Release Notes:

- N/A

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-19 08:21:01 -07:00
apricotbucket28
d8e32c3e3c
linux: scrolling improvements (#9103)
This PR adjusts scrolling to be a lot faster on Linux and also makes
terminal scrolling work.

For Wayland, it makes scrolling faster by handling the `AxisValue120`
event (which also allows high-resolution scrolling on supported mice)
On X11, changed the 1 line per scroll to 3.

### Different solutions

I tried replicating Chromium's scrolling behaviour, but it was
inconsistent in X11/Wayland and found it too fast on Wayland. Plus, it
also didn't match VSCode, since it seems that they do something
different.

Release Notes:

- Made scrolling faster on Linux
- Made terminal scroll on Linux
2024-03-18 14:50:29 -07:00
Mayfield
7c0a0e21ab
Add keyboard shortcut to suppress prompt while deleting files/dirs (#9452)
Completes #7228.
Adds back Backspace as the main delete key binding and makes Linux
bindings consistent with macOS

Release Notes:
- ⌘-Delete/⌘-Backspace will now suppress deletion confirmation prompts
in project panel
([#7228](https://github.com/zed-industries/zed/issues/7228)).
2024-03-18 11:43:43 -07:00
Ezekiel Warren
e22d31b52d
windows: Respect "appears transparent" for title bar (#9454)
now respecting the 'appears transparent' titlebar option which is used
in the storybook crate. created for #9453

# storybook

running

```
cargo run -p storybook components/text
```

| before | after |
| ---    | ---   |
|
![image](https://github.com/zed-industries/zed/assets/1284289/88cd93de-4ca9-40d6-aa53-aa7bc65e1f5c)
|
![image](https://github.com/zed-industries/zed/assets/1284289/b3528775-219b-46b7-9f99-da5b88330fbd)
|

Release Notes:

- N/A

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-18 11:39:46 -07:00
Ezekiel Warren
31aaee9130
windows: Don't propagate window char message (#9470)
we were accidentally calling the input handler even when the keydown
event asked it not to be propagated

Release Notes:

- N/A
2024-03-18 11:02:15 -07:00
Ezekiel Warren
0e83b22583
windows: Dispatch missing foreground tasks (#9469)
Some foreground tasks were being missed causing some unresponsiveness in
Zed. The foreground tasks used to happen but it was changed in #9351
(here:
https://github.com/zed-industries/zed/pull/9351/files#diff-5b5e706f04c15d77efd23989ec5b1b1cf73d36144e2d066a074de165533ecaeaL227)

Release Notes:

- N/A
2024-03-18 11:01:51 -07:00
Antonio Scandurra
3d08e20c72
Fix dispatching global actions from a window (#9502)
Fixes https://github.com/zed-industries/zed/issues/9313

Release Notes:

- Fixed a regression that caused global actions to stop working when
invoked from a window (preview-only)
([#9313](https://github.com/zed-industries/zed/issues/9313)).

Co-authored-by: Conrad <conrad@zed.dev>
2024-03-18 18:31:47 +01:00
Ezekiel Warren
4e17ce3b37
windows: credentials implementation (#9385)
Release Notes:

- N/A
2024-03-18 10:16:29 -07:00
张小白
64ebbb4afc
Update display info when window moved to another monitor (#9360)
Release Notes:

- N/A
2024-03-18 09:49:40 -07:00
Ezekiel Warren
9f96c43ff7
windows: Don't report 'shift' for certain keys (#9479)
allows keybindings for character such as `:`, `?`, etc. (important for
vim mode!)

alternative solution is here: #9478

Release Notes:

- N/A
2024-03-18 09:33:28 -06:00