-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zed Cannot Display a Window on Windows OS after Being Built #18610
Comments
+1 it startes but doesnt open windows |
same problem. I see it in task manager but does not display any window |
1 task
This was referenced Oct 6, 2024
+1 error as below: |
You need to set pub fn build_window_options(display_uuid: Option<Uuid>, cx: &mut AppContext) -> WindowOptions {
let display = display_uuid.and_then(|uuid| {
cx.displays()
.into_iter()
.find(|display| display.uuid().ok() == Some(uuid))
});
let app_id = ReleaseChannel::global(cx).app_id();
let window_decorations = match std::env::var("ZED_WINDOW_DECORATIONS") {
Ok(val) if val == "server" => gpui::WindowDecorations::Server,
Ok(val) if val == "client" => gpui::WindowDecorations::Client,
_ => gpui::WindowDecorations::Client,
};
WindowOptions {
titlebar: Some(TitlebarOptions {
title: None,
appears_transparent: true,
traffic_light_position: Some(point(px(9.0), px(9.0))),
}),
window_bounds: None,
focus: false,
show: true, ////////////<---------- HERE IS SET TO FALSE, CHANGE IT
kind: WindowKind::Normal,
is_movable: true,
display_id: display.map(|display| display.id()),
window_background: cx.theme().window_background_appearance(),
app_id: Some(app_id.to_owned()),
window_decorations: Some(window_decorations),
window_min_size: Some(gpui::Size {
width: px(360.0),
height: px(240.0),
}),
}
} |
Solution provided by vhanla works for me. |
1 task
1 task
SomeoneToIgnore
pushed a commit
that referenced
this issue
Oct 10, 2024
- Closes #18610 This PR addresses the same issue as PR #18578. After a full day of research and testing, I believe I’ve found the best solution to resolve this issue. With this PR, the window creation behavior on Windows becomes more consistent with macOS: - When `params.show` is `true`: The window is created and immediately displayed. - When `params.show` is `false`: The window is created but remains hidden until the first call to `activate_window`. As I mentioned in #18578, `winit` creates hidden windows by setting the window's `exstyle` to `WS_EX_NOACTIVATE | WS_EX_TRANSPARENT | WS_EX_LAYERED | WS_EX_TOOLWINDOW`, which is different from the method used in this PR. Here, the window is created with normal parameters, but we do not call `ShowWindow` so the window is not shown. I'm not sure why `winit` doesn't use a smilliar approach like this PR to create hidden windows. My guess is that `winit` is creating this hidden window to function as a "DispatchWindow" — serving a purpose similar to `WindowsPlatform` in `zed`. To ensure the window stays hidden even if `ShowWindow` is called, they use the `exstyle` approach. With the method used in this PR, my initial tests haven't revealed any issues. Release Notes: - N/A
1 task
1 task
noaccOS
pushed a commit
to noaccOS/zed
that referenced
this issue
Oct 19, 2024
- Closes zed-industries#18610 This PR addresses the same issue as PR zed-industries#18578. After a full day of research and testing, I believe I’ve found the best solution to resolve this issue. With this PR, the window creation behavior on Windows becomes more consistent with macOS: - When `params.show` is `true`: The window is created and immediately displayed. - When `params.show` is `false`: The window is created but remains hidden until the first call to `activate_window`. As I mentioned in zed-industries#18578, `winit` creates hidden windows by setting the window's `exstyle` to `WS_EX_NOACTIVATE | WS_EX_TRANSPARENT | WS_EX_LAYERED | WS_EX_TOOLWINDOW`, which is different from the method used in this PR. Here, the window is created with normal parameters, but we do not call `ShowWindow` so the window is not shown. I'm not sure why `winit` doesn't use a smilliar approach like this PR to create hidden windows. My guess is that `winit` is creating this hidden window to function as a "DispatchWindow" — serving a purpose similar to `WindowsPlatform` in `zed`. To ensure the window stays hidden even if `ShowWindow` is called, they use the `exstyle` approach. With the method used in this PR, my initial tests haven't revealed any issues. Release Notes: - N/A
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Check for existing issues
Describe the bug / provide steps to reproduce it
Descriptions
I cloned the source code, built and tried running it, but it cannot display an window, and threw errors instead.
Here are the errors:
How to Reproduce
zed.exe
and wait for errors.Environment
As what the bug described, I cannot run the command and have to provide the environment manually:
Zed: v0.156.0 (Zed Dev 563a1dc)
OS: Windows 10.0.22631
Memory: 15.2 GiB
Architecture: x86_64
GPU: NVIDIA GeForce RTX 3050 Ti Laptop GPU || Nvidia Corporation || 32.0.15.6094
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your Zed.log file to this issue.
Zed.log
The text was updated successfully, but these errors were encountered: