Commit graph

749 commits

Author SHA1 Message Date
Antonio Scandurra
4e544545d1
Introduce an Arena to allocate and deallocate frame-related structs more cheaply (#3689)
Picture worth a thousand words:


![before-after](https://github.com/zed-industries/zed/assets/482957/0aa92baf-f1cd-485e-a234-6d8f8b63a79a)

Note how having an area makes a substantial amount of frames between
0.5ms and 1ms faster (15-20% faster frames).

Release Notes:

- N/A
2023-12-18 11:16:07 +01:00
Antonio Scandurra
5a4e2e6b90 Use a closure to allocate structs onto the Arena
This is a trick borrowed from Bumpalo that helps LLVM understand
it should instantiate the object directly on the heap, as opposed to
doing so on the stack and then moving it.
2023-12-18 10:56:37 +01:00
Marshall Bowers
54eb452144
Only apply scroll correction in uniform_list when already scrolled (#3687)
This PR fixes an issue where the scroll correction added to the uniform
list in a35fdf45fc was being applied even
if the list wasn't scrolled at all.

This manifested in the project panel starting with an incorrect scroll
offset that would disappear once scrolled.

It seems like we should only need to apply this scroll correction when
the list is already scrolled.

Release Notes:

- N/A
2023-12-15 17:53:10 -05:00
Max Brunsfeld
149a718d65 Don't scroll List on scroll wheel events outside of its bounds 2023-12-15 13:38:49 -08:00
Conrad Irwin
b8cdcf4e93
fix theme selector gaps (#3682)
- Don't scroll beyond end of uniform list
- Restore position of uniform_list padding

[[PR Description]]

Release Notes:

- N/A
2023-12-15 13:27:17 -07:00
Nathan Sobo
3781626379 Merge branch 'main' into arena 2023-12-15 13:22:19 -07:00
Conrad Irwin
2fe9a1df21 Restore position of uniform_list padding
It should be inside the scrollable area.
2023-12-15 13:18:51 -07:00
Conrad Irwin
a35fdf45fc Don't scroll beyond end of uniform list 2023-12-15 12:54:12 -07:00
Marshall Bowers
a40f04b71f Only scroll enough to reveal the next channel if it isn't visible
Co-authored-by: Max <max@zed.dev>
2023-12-15 13:50:51 -05:00
Marshall Bowers
47fc03ab98 Fix positioning of the inline context menu
Added a new `bounds_for_item` for `ListState`.

Co-authored-by: Max <max@zed.dev>
2023-12-15 13:24:30 -05:00
Antonio Scandurra
0a57171066 Use a safe API for Arena 2023-12-15 19:03:37 +01:00
Antonio Scandurra
be73dd852d Move Arena to a thread-local and use it to allocate AnyElement 2023-12-15 16:18:05 +01:00
Antonio Scandurra
e1ca8e81bb Use an Arena to reuse allocations for listeners 2023-12-15 15:13:32 +01:00
Kirill Bulatov
a6403aad1a Remove extra nits, do not panic on clicking the buffer separator 2023-12-15 11:28:48 +02:00
Julia
de523c2d80 Give correct focus handle when project search has no matches 2023-12-14 23:49:44 -05:00
Julia
4be84f3db0 Merge branch 'main' into focus-handlers-on-draw 2023-12-14 23:08:23 -05:00
Mikayla Maki
05cb68eff1
Merge branch 'main' into perf-2 2023-12-14 16:39:10 -08:00
Mikayla Maki
8418f25d0a
Merge branch 'main' into perf-2 2023-12-14 16:25:40 -08:00
Max Brunsfeld
d6383ab0c6 Fix stickiness of main pane drag target
Reimplement the pane drag targets using on_drag_move
2023-12-14 16:23:15 -08:00
Mikayla Maki
0b4b81fa0c
Fix dock resizing (#3663)
This fixes some bugs in the display and tracking of dock resizes

Release Notes:

-
2023-12-14 16:20:29 -08:00
Nathan Sobo
ad8165ae79 Rename draw2 -> draw_and_update_state 2023-12-14 17:20:27 -07:00
Nathan Sobo
f4a954db4f Merge remote-tracking branch 'origin/main' into perf-2 2023-12-14 17:15:44 -07:00
Mikayla
8b4cf38379
Fix dock resize handles
co-authored-by: conrad <conrad@zed.dev>
2023-12-14 16:05:10 -08:00
Nathan Sobo
02606d1fb9 Merge remote-tracking branch 'origin/main' into perf-2 2023-12-14 16:56:36 -07:00
Marshall Bowers
bc3e6649f8
Fix warning in release mode (#3662)
This PR fixes a warning that was present in release mode, which was
preventing the nightly builds from running:

```
error: variable does not need to be mutable
   --> crates/gpui2/src/elements/div.rs:547:9
    |
547 |     let mut div = Div {
    |         ----^^^
    |         |
    |         help: remove this `mut`
    |
    = note: `-D unused-mut` implied by `-D warnings`
```

Release Notes:

- N/A
2023-12-14 18:52:14 -05:00
Mikayla
4c63c74f92
Fix bug in drag move dispatch
co-authored-by: conrad <conrad@zed.dev>
2023-12-14 15:23:24 -08:00
Max Brunsfeld
23d5f3f3e8 Enable all warnings in workspace, fix all warnings
Bring back some workspace tests

Co-authored-by: Conrad <conrad@zed.dev>
2023-12-14 14:15:56 -08:00
Nathan Sobo
d13a21c238 Don't move in paint 2023-12-14 15:15:18 -07:00
Julia
bbbdb9ff3e Render panel in this test to make sure it can receive focus 2023-12-14 17:11:00 -05:00
Max Brunsfeld
8d994ce8c5
Enable dragging from project panel to panes (#3658)
Rework gpui2 drag API so that receivers need not specify the dragged
view type.
2023-12-14 13:32:40 -08:00
Mikayla
8791f7cefc Enable dragging from project panel to panes
Rework gpui2 drag API so that receivers need not specify the dragged view type.

co-authored-by: Max <max@zed.dev>
co-authored-by: Conrad <conrad@zed.dev>
2023-12-14 13:20:48 -08:00
Nathan Sobo
fb3382bcc5 Merge remote-tracking branch 'origin/main' into perf-2 2023-12-14 14:16:59 -07:00
Nathan Sobo
0dd6c50a20 Use FxHashMap for element state 2023-12-14 14:06:19 -07:00
Nathan Sobo
3d1dae9a06 Make z_indices bigger in StackingOrder 2023-12-14 11:37:48 -07:00
Nathan Sobo
0d30b698a4 Don't allocate interactive bounds 2023-12-14 11:28:52 -07:00
Nathan Sobo
1ae25f52a1 WIP 2023-12-14 10:31:45 -07:00
Conrad Irwin
c2c7eead8a Robustify checks for visibility 2023-12-14 10:02:54 -07:00
Conrad Irwin
17a80ca09b Ignore invisible layers for mouse events 2023-12-14 09:44:04 -07:00
Nathan Sobo
6f17cf7337 WIP 2023-12-14 09:25:14 -07:00
Julia
cd08d349a5 Quick and dirty attempt to immediately apply focus change in tests
Doesn't quite work yet
2023-12-13 21:48:05 -05:00
Mikayla
53b1948c44
Remove inconsistency with how GPUI used to handle these events 2023-12-13 18:32:42 -08:00
Mikayla
d88fc27b79
Merge branch 'main' into fix-splits-bugs 2023-12-13 18:29:48 -08:00
Mikayla
0dd84924e4
add cmd-click-to-jump-to-element 2023-12-13 18:19:25 -08:00
Nathan Sobo
c863227dc2 Log frame timings 2023-12-13 18:44:21 -07:00
Max Brunsfeld
9059d70153 Ensure only top layer is styled with drag over style 2023-12-13 17:07:23 -08:00
Mikayla
a4024b297e
Add interactive debug info 2023-12-13 17:03:56 -08:00
Mikayla
04389939d3
Add debug and debug below methods for observing the bounds of divs 2023-12-13 16:47:55 -08:00
Nathan Sobo
1e4a7e6ef1 Don't notify when drawing 2023-12-13 16:05:34 -07:00
Mikayla
a807e798ec
Add new drag API 2023-12-13 13:40:19 -08:00
Max Brunsfeld
26a31b41b9 frame time 2023-12-13 14:22:34 -07:00