From 07891b49787f6a50c37a59f8873591496a92bb42 Mon Sep 17 00:00:00 2001 From: Christian Bergschneider Date: Thu, 8 Feb 2024 23:31:14 +0100 Subject: [PATCH] gpui: Set window title on Linux (#7589) Release Notes: - N/A Hello everyone, glad to be contributing to this awesome project! This just fixes a simple todo!(linux) in gpui. I also considered setting the window title in the hello world example, let me know if I should add it in this PR as well. Best Regards, Christian Bergschneider --- crates/gpui/src/platform/linux/window.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/gpui/src/platform/linux/window.rs b/crates/gpui/src/platform/linux/window.rs index e88ebde029..d396c74628 100644 --- a/crates/gpui/src/platform/linux/window.rs +++ b/crates/gpui/src/platform/linux/window.rs @@ -340,8 +340,15 @@ impl PlatformWindow for LinuxWindow { //todo!(linux) fn activate(&self) {} - //todo!(linux) - fn set_title(&mut self, title: &str) {} + fn set_title(&mut self, title: &str) { + self.0.xcb_connection.send_request(&x::ChangeProperty { + mode: x::PropMode::Replace, + window: self.0.x_window, + property: x::ATOM_WM_NAME, + r#type: x::ATOM_STRING, + data: title.as_bytes(), + }); + } //todo!(linux) fn set_edited(&mut self, edited: bool) {}