Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

gpui: Fix xdg_toplevel app_id set to None at first commit on Wayland (#55583)

mTvare35eaeb94a7e5
diff --git a/crates/gpui/src/platform.rs b/crates/gpui/src/platform.rs
index 8fb2e2254b8..5765fd80aff 100644
--- a/crates/gpui/src/platform.rs
+++ b/crates/gpui/src/platform.rs
@@ -1582,7 +1582,11 @@ pub struct WindowParams {
#[cfg_attr(feature = "wayland", allow(dead_code))]
pub display_id: Option<DisplayId>,
+ #[cfg_attr(feature = "wayland", allow(dead_code))]
+ pub app_id: Option<String>,
+
pub window_min_size: Option<Size<Pixels>>,
+
#[cfg(target_os = "macos")]
pub tabbing_identifier: Option<String>,
}
diff --git a/crates/gpui/src/window.rs b/crates/gpui/src/window.rs
index 7b8b6af63f0..198fab268e8 100644
--- a/crates/gpui/src/window.rs
+++ b/crates/gpui/src/window.rs
@@ -1326,6 +1326,7 @@ impl Window {
show,
display_id,
window_min_size,
+ app_id: app_id.clone(),
icon,
#[cfg(target_os = "macos")]
tabbing_identifier,
diff --git a/crates/gpui_linux/src/linux/wayland/window.rs b/crates/gpui_linux/src/linux/wayland/window.rs
index 33b103e5fb2..da759cfebc7 100644
--- a/crates/gpui_linux/src/linux/wayland/window.rs
+++ b/crates/gpui_linux/src/linux/wayland/window.rs
@@ -357,6 +357,11 @@ impl WaylandWindowState {
if let Some(title) = options.titlebar.and_then(|titlebar| titlebar.title) {
xdg_state.toplevel.set_title(title.to_string());
}
+
+ if let Some(app_id) = options.app_id.as_ref() {
+ xdg_state.toplevel.set_app_id(app_id.clone());
+ }
+
// Set max window size based on the GPU's maximum texture dimension.
// This prevents the window from being resized larger than what the GPU can render.
let max_texture_size = renderer.max_texture_size() as i32;
@@ -371,7 +376,7 @@ impl WaylandWindowState {
parent,
children: FxHashSet::default(),
surface,
- app_id: None,
+ app_id: options.app_id,
blur: None,
viewport,
globals,