Commit Graph

2122 Commits

Author SHA1 Message Date
Peter Tripp
821aa0811d
Fix delay when changing scrolling direction (#13867)
Fixes: #13720.

Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2024-07-05 11:11:43 -04:00
Thorsten Ball
e69f9d6cf9
linux/x11: Fix gap when tiling windows side by side (#13859)
By leveraging the `_GTK_EDGE_CONSTRAINTS` atom we can get all four
booleans for the `Tiling` struct and figure out which side is free when
the window is tiled to half of the screen.

For the logic behind the `_GTK_EDGE_CONSTRAINTS` see:
-
8e9d13aa3b/src/x11/window-x11.c (L65-L75)
-
8e9d13aa3b/src/x11/window-x11.c (L1205-L1231)

(I used Claude 3.5 Sonnet with our code and these pieces from `mutter`
to generate the Rust code, that was pretty sweet)

This fixes the gap in the middle when a GPUI window is tiled to the left
and another window to the right.

It's not _perfect_ but it looks a lot better.

Here's a diff that makes it look better:

```diff
diff --git a/crates/gpui/examples/window_shadow.rs b/crates/gpui/examples/window_shadow.rs
index 122231f6b..7fa29dadc 100644
--- a/crates/gpui/examples/window_shadow.rs
+++ b/crates/gpui/examples/window_shadow.rs
@@ -72,8 +72,8 @@ impl Render for WindowShadow {
                     .when(!(tiling.top || tiling.left), |div| div.rounded_tl(rounding))
                     .when(!tiling.top, |div| div.pt(shadow_size))
                     .when(!tiling.bottom, |div| div.pb(shadow_size))
-                    .when(!tiling.left, |div| div.pl(shadow_size))
-                    .when(!tiling.right, |div| div.pr(shadow_size))
+                    .when(!tiling.left, |div| div.pl(shadow_size - border_size))
+                    .when(!tiling.right, |div| div.pr(shadow_size - border_size))
                     .on_mouse_move(|_e, cx| cx.refresh())
                     .on_mouse_down(MouseButton::Left, move |e, cx| {
                         let size = cx.window_bounds().get_bounds().size;
```

But that makes it look weird on Wayland, so I didn't do it.

I think it's fine for now. Chromium looks bad and has a gap, so we're
already better.

## Before

![before_1](https://github.com/zed-industries/zed/assets/1185253/875c5cdd-c0be-4295-beb0-bb9ba5beaa52)


![before_2](https://github.com/zed-industries/zed/assets/1185253/0b96be70-4c34-4e99-aeb2-ab741171ad14)

## After

![after_1](https://github.com/zed-industries/zed/assets/1185253/aa51da77-daf1-4ef8-a33f-a83731e0c7e1)

![after_2](https://github.com/zed-industries/zed/assets/1185253/8ce7902d-90b6-4f06-ba2c-626e643abe56)


Release Notes:

- N/A
2024-07-05 15:02:14 +02:00
Thorsten Ball
fc8749ffd7
linux: Set directory in SaveFileRequest dialog (#13850)
This has been bugging me for a while. If you create a new file and then
save it, the dialogue would show the home directory and not the folder
that you were in.

This fixes it.

Release Notes:

- N/A
2024-07-05 11:33:31 +02:00
Thorsten Ball
2a923e338f
linux/x11: Set transparency to false by default (#13848)
The previous code lead to a ton of error messages from Blade on my X11
machine, even with *client-side decorations working well!*

As @someone13574 pointed out
[here](https://github.com/zed-industries/zed/pull/13611#issuecomment-2201685030)
things still work with this being false. And if someone changes a theme
with transparent background, then it will get set anyway. We just don't
do it by default.

And as @jansol pointed out
[here](https://github.com/zed-industries/zed/issues/5040#issuecomment-2096560629):

> On X11 it may be possible to configure a compositor to blur window
backgrounds but Zed has no way to influence that.

So we don't lose anything, I think, but get rid of a ton of error
messages in the logs.

Proof of shadows etc. still working:

![Screenshot from 2024-07-05
10-17-38](https://github.com/zed-industries/zed/assets/1185253/1216b38b-8011-46e7-b86f-c0f5fc3f6f64)



Release Notes:

- N/A
2024-07-05 10:55:45 +02:00
Owen Law
56e3fc794a
linux/x11: Fix bugs related to unflushed commands (#13844)
**Edit**:

This PR adds flushes to functions which should have an immediate affect.
I've observed it fixing the following bugs (but there are probably
more):

- The cursor not updating when just hovering.
- The window not maximising after clicking the full-screen button until
you move the mouse.
- The window not minimising after clicking the minimise button until you
move the mouse.

---

**Original content**:

Following #13646, the cursor style wouldn't change because the
`change_window_attributes` command wasn't being flushed. I guess it was
working before because something else was flushing it somewhere else so
it was never noticed.

I just added `check()` which flushes the command so that the cursor will
actually update when just hovering. Before you would need to interact
with the window so that something else could flush the command.

Release Notes:

- N/A
2024-07-05 09:16:28 +02:00
Thorsten Ball
c8b106245c
linux/x11: Resize on GTK_EDGE_CONSTRAINTS atom (#13833)
With the new window decorations resizing was _really_ laggy on my X11
machine.

Before:
- Click on window border (hitbox doesn't work properly, but that's
another issue)
- Drag and resize
- 4-5s nothing happens
- Window is resized

After:
- Click on window border
- Drag and resize
- Window is resized

I'm still not 100% sure on why this happens on my machine and not
Conrad's/Mikayla's, but seems like that GTK_EDGE_CONSTRAINTS atom is
sent when resizing.

The other thing that I can't explain is that we get a `ConfigureNotify`
when resizing, with the right size, but maybe not often enough?

Anyway, for now we'll go with this.

Release Notes:

- N/A
2024-07-04 18:29:08 +02:00
Keenan Wresch
b1f8fc88a1
Allow Shift + Scroll to Horizontally Scroll in X11 and Wayland (#13676)
Release Notes:

- Allows shift + scroll horizontal scrolling on X11 and Wayland.

[Screencast from 2024-06-29
17-17-59.webm](https://github.com/zed-industries/zed/assets/14155062/2cac77b9-ecc8-4ddb-b08d-b5d964c8dc84)
2024-07-04 16:22:42 +02:00
Mikayla Maki
47aa761ca9
Linux window decorations (#13611)
This PR adds support for full client side decorations on X11 and Wayland

TODO:
- [x] Adjust GPUI APIs to expose CSD related information
- [x] Implement remaining CSD features (Resizing, window border, window
shadow)
- [x] Integrate with existing background appearance and window
transparency
- [x] Figure out how to check if the window is tiled on X11
- [x] Implement in Zed
- [x] Repeatedly maximizing and unmaximizing can panic
- [x] Resizing is strangely slow
- [x] X11 resizing and movement doesn't work for this:
https://discord.com/channels/869392257814519848/1204679850208657418/1256816908519604305
- [x] The top corner can clip with current styling
- [x] Pressing titlebar buttons doesn't work
- [x] Not showing maximize / unmaximize buttons
- [x] Noisy transparency logs / surface transparency problem
https://github.com/zed-industries/zed/pull/13611#issuecomment-2201685030
- [x] Strange offsets when dragging the project panel
https://github.com/zed-industries/zed/pull/13611#pullrequestreview-2154606261
- [x] Shadow inset with `_GTK_FRAME_EXTENTS` doesn't respect tiling on
X11 (observe by snapping an X11 window in any direction)

Release Notes:

- N/A

---------

Co-authored-by: conrad <conrad@zed.dev>
Co-authored-by: Owen Law <81528246+someone13574@users.noreply.github.com>
Co-authored-by: apricotbucket28 <71973804+apricotbucket28@users.noreply.github.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-07-03 11:28:09 -07:00
Thorsten Ball
64755a7aea
linux/x11: Custom run loop with mio instead of calloop (#13646)
This changes the implementation of the X11 client to use `mio`, as a
polling mechanism, and a custom run loop instead of `calloop` and its
callback-based approach.

We're doing this for one big reason: more control over how we handle
events.

With `calloop` we don't have any control over which events are processed
when and how long they're processes for. For example: we could be
blasted with 150 input events from X11 and miss a frame while processing
them, but instead of then drawing a new frame, calloop could decide to
work off the runnables that were generated from application-level code,
which would then again cause us to be behind.

We kinda worked around some of that in
https://github.com/zed-industries/zed/pull/12839 but the problem still
persists.

So what we're doing here is to use `mio` as a polling-mechanism. `mio`
notifies us if there are X11 on the XCB connection socket to be
processed. We also use its timeout mechanism to make sure that we don't
wait for events when we should render frames.

On top of `mio` we now have a custom run loop that allows us to decide
how much time to spend on what — input events, rendering windows, XDG
events, runnables — and in what order we work things off.

This custom run loop is consciously "dumb": we render all windows at the
highest frame rate right now, because we want to keep things predictable
for now while we test this approach more. We can then always switch to
more granular timings. But considering that our loop runs and checks for
windows to be redrawn whenever there's an event, this is more an
optimization than a requirement.

One reason for why we're doing this for X11 but not for Wayland is due
to how peculiar X11's event handling is: it's asynchronous and by
default X11 generates synthetic events when a key is held down. That can
lead to us being flooded with input events if someone keeps a key
pressed.

So another optimization that's in here is inspired by [GLFW's X11 input
handling](b35641f4a3/src/x11_window.c (L1321-L1349)):
based on a heuristic we detect whether a `KeyRelease` event was
auto-generated and if so, we drop it. That essentially halves the amount
of events we have to process when someone keeps a key pressed.

Release Notes:

- N/A

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Conrad <conrad@zed.dev>
2024-07-03 17:05:26 +02:00
Emily
c1e18059f8
gpui: Prefer integrated GPUs on Intel Mac (#13685)
On Intel, Metal will pick a discrete GPU by default when available,
resulting in higher power consumption and heat output. Prefer
non‐removable low‐power devices to correct this.

On Apple Silicon, there is only ever one GPU, so there is no functional
change.

I didn’t do intensive benchmarking of this or anything, but Zed still
seems responsive and it stops my MacBook Pro acting as a combination
space heater–jet engine.

Thanks to @denlukia for showing that this is easy to fix; I’ve marked
you as a co‐author, I hope that’s okay.

Closes: #5124



Release Notes:

- Improved power consumption on Intel Macs by preferring integrated GPUs
over the discrete GPUs.
([#5124](https://github.com/zed-industries/zed/issues/5124)).

Co-authored-by: Denis Lukianenko <denlyk1@gmail.com>
2024-07-03 15:12:24 +02:00
Thorsten Ball
3cabd4bf64
gpui example: Fix SVG not showing up when running from root (#13648)
Took me a while to figure out that I can't run

    cargo run -p gpui --example animation

and that it has to run in the `gpui` crate.

So I thought I'd fix this.

Release Notes:

- N/A
2024-06-28 15:58:19 +02:00
Conrad Irwin
1d193585b0
Fix multi-keystroke shortcuts better (#13612)
Release Notes:

- N/A
2024-06-27 16:39:05 -06:00
Conrad Irwin
e1fbef0dfd
Fix multi-key shortcuts (#13606)
Broken by the shift shift support PR

Release Notes:

- Fix multi-key shortcuts (preview only)
2024-06-27 14:44:18 -06:00
Conrad Irwin
7d7fd7d25d
Move from Zed fonts to IBM Plex (#13596)
Release Notes:

- Changed the default fonts to IBM Plex Sans and IBM Plex Mono. If you'd
like to go back to using Zed Sans/Zed mono you need to
[download](https://github.com/zed-industries/zed-fonts/releases/tag/1.2.0)
them and install them.
2024-06-27 14:36:44 -06:00
Conrad Irwin
6a1b257d39
Fix X11 window activation better (#13604)
Release Notes:

- N/A
2024-06-27 14:36:29 -06:00
Jason Lee
6cedfa0ce7
example: Fix Input example mistake (#13574)
![CleanShot 2024-06-27 at 15 52
48](https://github.com/zed-industries/zed/assets/5518/71b25759-0cd5-40ed-b7c2-2f1045f81683)

Release Notes:

- N/A
2024-06-27 11:28:44 +03:00
Gilles Peiffer
1260c616ba
Simplify font feature tag validation (#13548)
Simplifies the logic for the changes of #13542.

Release Notes:

- N/A
2024-06-26 17:11:57 -04:00
Fernando Tagawa
5d766f61fa
linux: Fix some panics related to xkb compose (#13529)
Release Notes:

- N/A

Fixed #13463 Fixed crash when the locale was non UTF-8 and fixed the
fallback locale.
Fixed #13010 Fixed crash when `compose.keysym()` was `XKB_KEY_NoSymbol`

I also extracted the `xkb_compose_state` to a single place
2024-06-26 09:34:39 -06:00
张小白
18b4573064
Fix font feature tag validation (#13542)
The previous implementation that I implemented had two issues:
1. It did not throw an error when the user input some invalid values
such as "panic".
2. The feature tag for OpenType fonts should be a combination of letters
and digits. We only checked if the input was an ASCII character, which
could lead to undefined behavior.

Closes #13517 

Release Notes:

- N/A
2024-06-26 11:01:48 -04:00
Conrad Irwin
b43df6048b
Add an input example to gpui (#13534)
Add a single-line text input example to gpui

(I'm hoping to be able to debug keyboard issues without rebuilding the
whole
app every time)

Release Notes:

- N/A
2024-06-25 22:06:50 -06:00
Conrad Irwin
eb914682b3
Fix multi-cursor copy/paste on linux (#13523)
The clipboard library we use for X11 doesn't yet support multiple
formats on the clipboard, so for now we just store this in memory for
the current zed process, as we do for Wayland.

Fixes: #11971

Release Notes:

- N/A

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-06-25 14:54:52 -06:00
Mikayla Maki
e5d1cf84cf
Fix 9263 (#13521)
Fix #9263

Release Notes:

- N/A
2024-06-25 11:35:50 -07:00
张小白
d1a55d64a8
Change window_min_size from Size<Pixels> to Option<Size<Pixels>> (#13501)
Now we can set `window_min_size` to `None` instead of `Size::default()`.
I think this makes more sense.

Release Notes:

- N/A
2024-06-25 12:09:08 -06:00
Dov Alperin
0b1a589183
keymap: Allow modifiers as keys (#12047)
It is sometimes desirable to allow modifers to serve as keys themselves
for the purposes of keybinds. For example, the popular keybind in
jetbrains IDEs `shift shift` which opens the file finder.

This change treats modifers in the keymaps as keys themselves if they
are not accompanied by a key they are modifying.

Further this change wires up they key dispatcher to treat modifer change
events as key presses which are considered for matching against
keybinds.


Release Notes:

- Fixes #6460

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-06-25 10:17:23 -06:00
Matin Aniss
54afa6f69f
Bump image crate (#13397)
Bumping the image crate for better support of image formats.

The latest version does not have a `BGRA` type it only has `RGBA` it
doesn't really matter as the size is the same but the type name is a
little confusing as we need it as `BGRA`. Also there is no `into_bgra8`
but we can use `into_rgba8` but then it must be converted before
creating the `ImageData`.

Release Notes:

- N/A
2024-06-25 15:12:45 +02:00
Matt Fellenz
ab5a462e0c
Use likely-newer KeyPress serial for wl clipboard (#13483)
The KeyEnter serial will be too old if another client replaces the
selection before the user unfocuses and refocuses the window (i.e.,
triggers another KeyEnter event).
The KeyPress event is more likely to be new enough.

Release Notes:

- Fixed setting clipboard sometimes not working on wayland
([#13445](https://github.com/zed-industries/zed/issues/13445)).
2024-06-24 22:16:58 -06:00
SELO
7be1ffb9ec
Add cross-compilation support from MacOS to Windows (#13382)
- Modify `build.rs` to use environment variables instead of `cfg`
directive to make cross-compilation to Windows possible
- Make `embed-resource` a global build-dependency for cross-compilation

Release Notes:

- N/A
2024-06-24 21:26:24 -06:00
Aaron Ruan
93a5d0ca29
Add limit to minimum window size (#13126)
Release Notes:

- Add a limit to the minimum window size on macOS.

Here's the minimum window before change:
<img width="121" alt="image"
src="https://github.com/zed-industries/zed/assets/38318044/9e907194-42e5-457e-91ea-96613426b479">

After change:
<img width="410" alt="image"
src="https://github.com/zed-industries/zed/assets/38318044/6e9c3057-9860-4f4b-9a73-c158ebac5ba9">
2024-06-24 21:26:13 -06:00
张小白
328d98dddc
windows: Make IME input on Windows consistent with that on macOS + some small fixs (#13386)
### Before

![Screenshot 2024-06-22
180000](https://github.com/zed-industries/zed/assets/14981363/9efc3ccd-553c-4fe8-ada5-1b54f80bfbd5)

### After

![Screenshot 2024-06-22
175850](https://github.com/zed-industries/zed/assets/14981363/172675ca-9fda-45ae-bd97-59c33573a766)


Release Notes:

- N/A
2024-06-24 20:55:15 -06:00
张小白
76ab9e4d66
macOS: Fix IME action when deleting last char (#13385)
Closes #12862 


https://github.com/zed-industries/zed/assets/14981363/170b1206-5894-4b90-bd5c-79761073d8f2


Release Notes:

- Fixed deleting the last character during IME composition would
mistakenly delete other characters.(#12862)
2024-06-24 20:54:36 -06:00
Conrad Irwin
c477c12956
x11: Fix handling of shift key (#13485)
Fixes: #13306

Release Notes:

- N/A
2024-06-24 20:37:46 -06:00
Thorsten Ball
5a8c2a4a88
linux/x11: Prioritize rendering in X11 event loop (#13468)
This is a small change that aims to address frames being dropped when we
get a ton of X11 input events.

What it does, in short, is to first read all X11 input events and then
prioritize the rendering.

In my testing, it causes less frames to be dropped when the system is
under heavy load and lots of input events are being created.

Release Notes:

- N/A
2024-06-24 17:21:11 +02:00
Thorsten Ball
82435075a5
Revert "linux/x11: Reduce input latency and ensure rerender priority (#13355)" (#13465)
This reverts commit f69c8ca74e after it
has already been partially reverted in
https://github.com/zed-industries/zed/pull/13458.

Why the revert?

The changes in that commit/PR fix one type of problem — dropping of
frames when being blasted with input events — but trades it for another
one that I can't explain yet: when the system is under load, then input
becomes _laggy_ and input events seem to be delayed.

Two examples of how that shows up:

1. When the system is under load* and you hold down the `down` key to
scroll, then lift the finger, the cursor stops sometimes. If you then
produce another input event by jiggling the mouse cursor you'll see more
`down`-key events coming up and the cursor moving down. It feels as if
the event loop is not being woken up even though there are still events.
I suspect it might have something to do with XIM, because if it's
disabled, it seems as if problems become less severe.
2. When the system is under load* and you click-and-drag a selection in
the editor, you can see how the selection is delayed and takes 500ms-1s
to catch up to where the cursor is.

* system under load: start Zed, then in another terminal window create a
release build of Zed, for example.

With the changes reverted, the failure mode looks different: we skip
frames. But that, I think, is the better of two bad options, because
skipping frames means that you see what's happening vs. input events
seemingly still coming in seconds after you stopped using the keyboard.

Release Notes:

- N/A
2024-06-24 15:31:49 +02:00
Thorsten Ball
6cc3a4d95c
linux/x11: Fallback to 800x600 if window bounds size has 0 (#13462)
As reported here
https://github.com/zed-industries/zed/issues/13203#issuecomment-2183514518
it seems that sometimes we get 0 values for the window bounds.

Instead of failing to start up, we log a warning and fall back to
defaults that let a window show up.


Release Notes:

- N/A
2024-06-24 14:32:40 +02:00
Thorsten Ball
9ef9baef6f
linux/x11: Fix CPU being pinned at 100% in X11 loop (#13458)
This was part of https://github.com/zed-industries/zed/pull/13355 to fix
the problem of XIM events not waking up the loop. Problem is that it
seems to pin a single CPU at 100%.

Luckily, it looks like the change is not necessary anymore after we
refactored the improvements in #13355.

This fixes https://github.com/zed-industries/zed/issues/13409.

Release Notes:

- N/A
2024-06-24 11:11:17 +02:00
Piotr Osiewicz
d272e402ea
project panel: Add vertical scrollbar (#13358)
Fixes #4865
Release Notes:

- Added vertical scrollbar to project panel
2024-06-23 14:04:19 +02:00
Conrad Irwin
fe7d53cb96
Dynamicer builds (#13074)
Fixes https://github.com/zed-industries/zed/issues/13073

Note that, contrary to the issue's text, we're still shipping a
statically bundled sqlite3 after this PR. We use enough new features of
sqlite, like `sqlite3_error_offset` and `STRICT`, that our minimum
version (v3.38.0) is higher than is presumably accessible on Ubuntu.

Release Notes:

- N/A

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-06-21 16:32:32 -07:00
Antonio Scandurra
cb0b8b4c4b
Introduce multi-cursor inline transformations (#13368)
https://github.com/zed-industries/zed/assets/482957/591def34-e5c8-4402-9c6b-372cbca720c3

Release Notes:

- N/A

---------

Co-authored-by: Richard Feldman <oss@rtfeldman.com>
2024-06-21 17:41:43 +02:00
Thorsten Ball
c58a8f1a04
linux/x11: Add more debug info to error if opening window fails (#13364)
Release Notes:

- N/A
2024-06-21 15:37:31 +02:00
Thorsten Ball
f69c8ca74e
linux/x11: Reduce input latency and ensure rerender priority (#13355)
This change ensures that we always render a window according to its
refresh rate, even if there are a lot of X11 events.

We're working around some limitations of `calloop`. In the future, we
think we should revisit how the event loop is implemented on X11, so
that we can ensure proper prioritization of input events vs. rendering.

Release Notes:

- N/A

Co-authored-by: Antonio <me@as-cii.com>
2024-06-21 12:14:55 +02:00
agamcsama
25c8cf0c5c
windows: Fix Zed/GPUI misinterpreting keycodes + Refactor (#12814)
Release Notes:

- Fixed Zed/GPUI misinterpreting keycodes on non-US keyboards
([#12811](https://github.com/zed-industries/zed/issues/12811)).

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
2024-06-20 11:39:20 -07:00
Mikayla Maki
4e2a08edb7
Fix missing IME keys when no input handler is set (#13325)
This fixes a bug introduced by
https://github.com/zed-industries/zed/pull/12702, where GPUI would only
generate the correct key events if you had an input handler set.

Release Notes:

- N/A
2024-06-20 10:39:10 -07:00
Thorsten Ball
8524e87319
linux/x11: Do panic when unmapping/destroying of X11 window fails (#13262)
We saw this panic come up:

```
called `Result::unwrap()` on an `Err` value: IoError(Custom { kind: Other, error: UnknownError })
core::panicking::panic_fmt
core::result::unwrap_failed
<gpui::platform::linux::x11:🪟:X11Window as core::ops::drop::Drop>::drop
core::ptr::drop_in_place<gpui::platform::linux::x11:🪟:X11Window>
core::ptr::drop_in_place<gpui:🪟:Window>
gpui::app::AppContext::shutdown
gpui::app::AppContext:🆕:{{closure}}
gpui::platform::linux::platform::<impl gpui::platform::Platform for P>::run
gpui::app::App::run
zed::main
std::sys_common::backtrace::__rust_begin_short_backtrace
std::rt::lang_start::{{closure}}
std::rt::lang_start_internal
main
__libc_start_call_main
__libc_start_main_impl
_start
```

I'm not sure where exactly that error comes from, except from the X11
stuff. So let's be defensive and log error and only then tear down
everything.

I _think_ that if the error is repeatable that means we won't close the
window but instead just log errors, but I do think that's better than
panicking right now.

Release Notes:

- N/A
2024-06-19 14:36:57 +02:00
Mikayla Maki
d4891a62bb
Conform to wayland spec on resize (#13243)
Fixes https://github.com/zed-industries/zed/issues/10976

Release Notes:

- N/A

Co-authored-by: conrad <conrad@zed.dev>
2024-06-18 21:01:15 -07:00
Mikayla Maki
17bc0d1b17
Dynamically link libwayland (#13241)
Fixes a bug in current nightly.

Release Notes:

- N/A
2024-06-18 15:07:45 -07:00
Conrad Irwin
490a75aee6
Fix bug where window contents could appear outside of window bounds on X11 (#13181)
Release Notes:

- N/A
2024-06-18 13:49:01 -06:00
Mikayla Maki
6b9ddbfef2
Add more menus to Zed (#12940)
### TODO

- [x] Make sure keybinding shows up in pane + menu
- [x] Selection tool in the editor toolbar
- [x] Application Menu
- [x] Add more options to pane + menu
   - Go to File...
  - Go to Symbol in Project... 
- [x] Add go items to the selection tool in the editor:
   - Go to Symbol in Editor...
   - Go to Line/Column...
   - Next Problem
   - Previous Problem
- [x] Fix a bug where modals opened from a context menu aren't focused
correclty
- [x] Determine if or what needs to be done with project actions:
- Difficulty is that these are exposed in the UI via clicking the
project name in the titlebar or by right clicking the root entry in the
project panel. But they require reading and are two clicks away. Is that
sufficient?
    - Add Folder to Project
    - Open a new project
    - Open recent
 - [x] Get a style pass 
 - [x] Implement style pass
   - [x] Fix the wrong actions in the selection menu
   - [x] Show selection tool toggle in the 'editor settings' thing
- [x] Put preferences section from the app menu onto the right hand user
menu
- [x] Add Project menu into app menu to replace 'preferences' section,
and put the rest of the actions there
- [ ] ~~Adopt `...` convention for opening a surface~~ uncertain what
this convention is.
   - [x] Adopt link styling  for webview actions
   - [x] Set lucide hamburger for menu icon
   - [x] Gate application menu to only show on Linux and Windows




Release Notes:

- Added a 'selection and movement' tool to the Editor's toolbar, as well
as controls to toggle it and a setting to remove it (`"toolbar":
{"selections_menu": true/false }`)
- Changed the behavior of the `+` menu in the tab bar to use standard
actions and keybindings. Replaced 'New Center Terminal' with 'New
Terminal', and 'New Search', with the usual 'Deploy Search'. Also added
item-creating actions to this menu.
- Added an 'application' menu to the titlebar to Linux and Windows
builds of Zed
2024-06-18 12:16:54 -07:00
apricotbucket28
f6fa6600bc
wayland: Refactor clipboard implementation (#12405)
Fixes https://github.com/zed-industries/zed/issues/12054

Replaces the `copypasta`/`smithay-clipboard` implementation with a new,
custom one

TODO list:

- [x] Cleanup code
- [x] Remove `smithay-clipboard`
- [x] Add more mime types to the supported list

Release Notes:

- Fixed drag and drop on Gnome
- Fixed clipboard paste on Hyprland
2024-06-18 10:04:19 -07:00
Thorsten Ball
64d815a176
linux/x11: Fix closing of GPUI windows not working (#13201)
This fixes everything but the main Zed window (GPUI examples, prompt
library, etc.) not being closable by clicking on the X in X11.

We had a dangling reference before: we would remove the window from the
X11 state, but GPUI itself would still have the window in its
references.

In order to fix this we have to call `window.close()`, which ends up
calling `cx.remove_window()`, which removes the reference.

That in turn then causes the reference to be dropped, which cleans up
the X11 state for the window.

Release Notes:

- N/A
2024-06-18 15:22:26 +02:00
Thorsten Ball
195a270e18
vim: Display pending keys in Vim mode indicator (#13195)
This changes the mode indicator to now show pending keys and not just
pending operators.


Release Notes:

- Added pending keys to the mode indicator in Vim mode.

Demo:



https://github.com/zed-industries/zed/assets/1185253/4fc4ffd9-2ba7-4e2c-b2c3-cd19b40cb640
2024-06-18 13:30:18 +02:00