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.

copilot_ui: Fix Copilot sign-in window focus on Hyprland (#59933)

hiro / THETIME59c021d8dcee
diff --git a/Cargo.lock b/Cargo.lock
index b1d1e834170..1ada6ef9e5c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3907,6 +3907,7 @@ dependencies = [
"lsp",
"menu",
"project",
+ "release_channel",
"serde_json",
"settings",
"ui",
diff --git a/crates/copilot_ui/Cargo.toml b/crates/copilot_ui/Cargo.toml
index 14b9fe43679..ba5935c65ed 100644
--- a/crates/copilot_ui/Cargo.toml
+++ b/crates/copilot_ui/Cargo.toml
@@ -28,6 +28,7 @@ log.workspace = true
lsp.workspace = true
menu.workspace = true
project.workspace = true
+release_channel.workspace = true
serde_json.workspace = true
settings.workspace = true
ui.workspace = true
diff --git a/crates/copilot_ui/src/sign_in.rs b/crates/copilot_ui/src/sign_in.rs
index 4eb73b6d82e..5741d613485 100644
--- a/crates/copilot_ui/src/sign_in.rs
+++ b/crates/copilot_ui/src/sign_in.rs
@@ -9,6 +9,7 @@ use gpui::{
Subscription, TaskExt, Window, WindowBounds, WindowOptions, div, point,
};
use project::project_settings::ProjectSettings;
+use release_channel::ReleaseChannel;
use settings::Settings as _;
use ui::{ButtonLike, CommonAnimationExt, ConfiguredApiCard, Vector, VectorName, prelude::*};
use util::ResultExt as _;
@@ -55,12 +56,13 @@ pub fn reinstall_and_sign_in(copilot: Entity<Copilot>, window: &mut Window, cx:
fn open_copilot_code_verification_window(copilot: &Entity<Copilot>, window: &Window, cx: &mut App) {
let current_window_center = window.bounds().center();
- let height = px(450.);
- let width = px(350.);
+ let width = px(450.);
+ let height = px(350.);
let window_bounds = WindowBounds::Windowed(gpui::bounds(
- current_window_center - point(height / 2.0, width / 2.0),
- gpui::size(height, width),
+ current_window_center - point(width / 2.0, height / 2.0),
+ gpui::size(width, height),
));
+ let app_id = ReleaseChannel::global(cx).app_id();
cx.open_window(
WindowOptions {
kind: gpui::WindowKind::Floating,
@@ -68,9 +70,11 @@ fn open_copilot_code_verification_window(copilot: &Entity<Copilot>, window: &Win
is_resizable: false,
is_movable: true,
titlebar: Some(gpui::TitlebarOptions {
+ title: Some("Use GitHub Copilot in Zed".into()),
appears_transparent: true,
..Default::default()
}),
+ app_id: Some(app_id.to_owned()),
..Default::default()
},
|window, cx| cx.new(|cx| CopilotCodeVerification::new(&copilot, window, cx)),