linux: Prompt library fixes (#16850)

This PR fixes two issues:
1. The prompt library window didn't set an `app_id` on Linux, which
caused it to be missing the Zed logo
2. A dangling reference to the window in the Wayland client code, which
caused the prompt library window not to close. See:
https://github.com/zed-industries/zed/pull/13201

Release Notes:

- Linux: Fixed the prompt library not closing on Wayland

---------

Co-authored-by: Junkui Zhang <364772080@qq.com>
This commit is contained in:
apricotbucket28 2024-08-29 00:11:01 -03:00 committed by GitHub
parent 9ad845b40a
commit a68a543d43
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 13 additions and 6 deletions

View file

@ -23,6 +23,7 @@ use language_model::{
};
use parking_lot::RwLock;
use picker::{Picker, PickerDelegate};
use release_channel::ReleaseChannel;
use rope::Rope;
use serde::{Deserialize, Serialize};
use settings::Settings;
@ -94,14 +95,16 @@ pub fn open_prompt_library(
cx.spawn(|cx| async move {
let store = store.await?;
cx.update(|cx| {
let app_id = ReleaseChannel::global(cx).app_id();
let bounds = Bounds::centered(None, size(px(1024.0), px(768.0)), cx);
cx.open_window(
WindowOptions {
titlebar: Some(TitlebarOptions {
title: Some("Prompt Library".into()),
appears_transparent: !cfg!(windows),
appears_transparent: cfg!(target_os = "macos"),
traffic_light_position: Some(point(px(9.0), px(9.0))),
}),
app_id: Some(app_id.to_owned()),
window_bounds: Some(WindowBounds::Windowed(bounds)),
..Default::default()
},