zed icon indicating copy to clipboard operation
zed copied to clipboard

Title bar not fully draggable

Open probablykasper opened this issue 2 years ago β€’ 11 comments

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

probablykasper avatar Mar 14 '23 22:03 probablykasper

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!

github-actions[bot] avatar Sep 24 '24 01:09 github-actions[bot]

Still reproducible

probablykasper avatar Sep 24 '24 01:09 probablykasper

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!

github-actions[bot] avatar Jan 28 '25 11:01 github-actions[bot]

Still reproducible on 0.170.4

probablykasper avatar Jan 28 '25 11:01 probablykasper

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.

devzeth avatar Feb 20 '25 17:02 devzeth

Sounds right, yes

probablykasper avatar Feb 20 '25 23:02 probablykasper

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?

tasuren avatar May 24 '25 03:05 tasuren

Seems like a good approach, I'd recommend opening a PR

probablykasper avatar May 24 '25 09:05 probablykasper

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.

tasuren avatar May 25 '25 04:05 tasuren

Renaming it so it's consistent is probably ideal, yes

probablykasper avatar May 25 '25 05:05 probablykasper

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.

tasuren avatar May 26 '25 01:05 tasuren