zed/crates/gpui/src
Bennet Bo Fenner e272acd1bc
collab ui: Fix notification windows on external monitors (#9817)
Sharing a project displays a notification (window) on every screen.
Previously there was an issue with the positioning of windows on all
screens except the primary screen.

As you can see here:


![image](https://github.com/zed-industries/zed/assets/53836821/314cf367-8c70-4e8e-bc4a-dcbb99cb4f71)

Now:


![image](https://github.com/zed-industries/zed/assets/53836821/42af9ef3-8af9-453a-ad95-147b5f9d90ba)

@mikayla-maki and I also decided to refactor the `WindowOptions` a bit. 
Previously you could specify bounds which controlled the positioning and
size of the window in the global coordinate space, while also providing
a display id (which screen to show the window on). This can lead to
unusual behavior because you could theoretically specify a global bound
which does not even belong to the display id which was provided.

Therefore we changed the api to this:
```rust
struct WindowOptions {
    /// The bounds of the window in screen coordinates
    /// None -> inherit, Some(bounds) -> set bounds.
    pub bounds: Option<Bounds<DevicePixels>>,

    /// The display to create the window on, if this is None,
    /// the window will be created on the main display
    pub display_id: Option<DisplayId>,
}
```

This lets you specify a display id, which maps to the screen where the
window should be created and bounds relative to the upper left of the
screen.

Release Notes:

- Fixed positioning of popup windows (e.g. when sharing a project) when
using multiple external displays.

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-03-26 13:07:38 -07:00
..
app collab ui: Fix notification windows on external monitors (#9817) 2024-03-26 13:07:38 -07:00
elements Make UniformList non-occluding. (#9806) 2024-03-26 13:13:10 +02:00
keymap
platform collab ui: Fix notification windows on external monitors (#9817) 2024-03-26 13:07:38 -07:00
text_system
window
action.rs
app.rs collab ui: Fix notification windows on external monitors (#9817) 2024-03-26 13:07:38 -07:00
arena.rs
assets.rs
bounds_tree.rs
color.rs
element.rs
executor.rs
geometry.rs collab ui: Fix notification windows on external monitors (#9817) 2024-03-26 13:07:38 -07:00
gpui.rs Introduce InlineCompletionProvider (#9777) 2024-03-26 13:28:06 +01:00
image_cache.rs
input.rs
interactive.rs Handle first click on Zed window (#9553) 2024-03-25 10:52:18 -07:00
key_dispatch.rs
keymap.rs
platform.rs collab ui: Fix notification windows on external monitors (#9817) 2024-03-26 13:07:38 -07:00
prelude.rs
scene.rs
shared_string.rs
shared_uri.rs
style.rs
styled.rs
subscription.rs
svg_renderer.rs
taffy.rs
test.rs
text_system.rs
util.rs
view.rs
window.rs collab ui: Fix notification windows on external monitors (#9817) 2024-03-26 13:07:38 -07:00