zed
zed copied to clipboard
Title bar not fully draggable
Check for existing issues
- [X] Completed
Describe the bug / provide steps to reproduce it
Only the top part of the title bar is draggable:
https://user-images.githubusercontent.com/11315492/225158799-e7d0962b-2d06-4a15-96f7-db85622028f0.mp4
Environment
Zed: v0.77.2 (stable) OS: macOS 10.15.7 Memory: 32 GiB Architecture: x86_64
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.
If you only need the most recent lines, you can run the zed: open log command palette action to see the last 1000.
No response
Hi there! π We're working to clean up our issue tracker by closing older issues that might not be relevant anymore. Are you able to reproduce this issue in the latest version of Zed? If so, please let us know by commenting on this issue and we will keep it open; otherwise, we'll close it in a week. Feel free to open a new issue if you're seeing this message after the issue has been closed. Thanks for your help!
Still reproducible
Hi there! π We're working to clean up our issue tracker by closing older issues that might not be relevant anymore. If you are able to reproduce this issue in the latest version of Zed, please let us know by commenting on this issue, and we will keep it open. If you can't reproduce it, feel free to close the issue yourself. Otherwise, we'll close it in 7 days. Thanks for your help!
Still reproducible on 0.170.4
Could it be related to:
creates/title_bar/src/title_bar.rs line 334
#[cfg(not(target_os = "windows"))]
pub fn height(window: &mut Window) -> Pixels {
(1.75 * window.rem_size()).max(px(34.))
}
and
crates/gpui/src/platform/mac/window.rs line 474
fn titlebar_height(&self) -> Pixels {
unsafe {
let frame = NSWindow::frame(self.native_window);
let content_layout_rect: CGRect = msg_send![self.native_window, contentLayoutRect];
px((frame.size.height - content_layout_rect.size.height) as f32)
}
}
While debugging i get for the title_bar 34 px back, and for the the native window title_bar height 28, therefor 6 px of the titlebar aren't draggable.
Sounds right, yes
I addressed this issue on macOS by adding a new feature, which is discussed here https://github.com/zed-industries/zed/discussions/31320#discussioncomment-13253510. Would this approach be acceptable?
Seems like a good approach, I'd recommend opening a PR
Thank you.
I don't have access to a Windows machine that can run Zed, and Windows is still under development. Also, the Linux version of Zed already supports window dragging using the start_window_move method equivalent toββ start_window_drag in my fork. So I'll go ahead and open a PR for macOS.
Also, as mentioned above, there is already a start_window_move method for Linux. So I'm wondering if I should rename start_window_drag in my fork to start_window_move.
If you have any better ideas or suggestions, Iβd love to hear them.
Renaming it so it's consistent is probably ideal, yes
The implementation of renaming is done. I'll open the PR after I add the feature to maximize the window by double-clicking the title bar.