neovide icon indicating copy to clipboard operation
neovide copied to clipboard

Frameless Window

Open khalidchawtany opened this issue 6 years ago • 31 comments

Can we have frameless window support.

I am using a modified version of neovim-qt in which I remove the window frame to make it clean. It is draggable resizable and everything.

2020-01-28 09 45 00

khalidchawtany avatar Jan 28 '20 06:01 khalidchawtany

Oooh that looks sick. I'll see if I can make it happen

Kethku avatar Jan 28 '20 07:01 Kethku

Its not looking good. Winit no decorations disables window resizing.

Kethku avatar Jan 29 '20 08:01 Kethku

I did some fiddling and I think I could emulate resizing and window movement, but getting it to feel exactly right is going to be hard. For example on windows, window key plus arrow key should move it automatically which will be hard to do exactly right...

Kethku avatar Jan 29 '20 08:01 Kethku

Heres the branch of what I have so far. https://github.com/Kethku/neovide/tree/testing-frameless

Any chance someone can try this branch and see if resize works on other platforms? This issue mentions the windows platform issue, but doesn't say if linux and mac work: https://github.com/rust-windowing/winit/issues/725

Kethku avatar Jan 29 '20 08:01 Kethku

I will try it when I get back home and report back. Thanks

khalidchawtany avatar Jan 29 '20 14:01 khalidchawtany

I get a panic running the specified branch.

$ RUST_BACKTRACE=1 ./neovide
thread 'main' panicked at 'Failed to parse emoji font data: Parse', src/libcore/result.rs:1165:5
stack backtrace:
   0: std::io::Read::read_exact
   1: core::fmt::ArgumentV1::show_usize
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::default_hook
   5: <std::panicking::begin_panic::PanicPayload<A> as core::panic::BoxMeUp>::get
   6: std::panicking::continue_panic_fmt
   7: std::panicking::try::do_call
   8: std::thread::local::fast::Key<T>::try_initialize
   9: std::thread::local::fast::Key<T>::try_initialize
  10: core::result::Result<T,E>::expect
             at /private/tmp/rust-20191221-83947-1gnlhtt/rustc-1.40.0-src/src/libcore/result.rs:960
  11: neovide::renderer::caching_shaper::build_collection_by_font_name
             at src/renderer/caching_shaper.rs:88
  12: neovide::renderer::caching_shaper::FontSet::new
             at src/renderer/caching_shaper.rs:110
  13: neovide::renderer::caching_shaper::CachingShaper::new
             at src/renderer/caching_shaper.rs:149
  14: neovide::renderer::Renderer::new
             at src/renderer/mod.rs:30
  15: neovide::window::ui_loop
             at src/window.rs:33
  16: std::rt::lang_start::{{closure}}
             at /private/tmp/rust-20191221-83947-1gnlhtt/rustc-1.40.0-src/src/libstd/rt.rs:61
  17: std::panicking::try::do_call
  18: panic_unwind::imp::find_eh_action::{{closure}}
  19: std::sys_common::cleanup
  20: neovide::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

khalidchawtany avatar Jan 29 '20 18:01 khalidchawtany

Ah this was my bad. I will rebase on master where this bug was fixed

Kethku avatar Jan 29 '20 18:01 Kethku

Ok try now on that branch. I rebased and force pushed

Kethku avatar Jan 29 '20 18:01 Kethku

Everything works nicely on Mac OS except for the part that I cannot drag the window around. In the patched version of neovim-qt I can drag the window using the top region of the window. The region where the top bar would have appeared if not frameless.

Frameless Neovide on Mac OS:) 2020-01-29 23 02 57

khalidchawtany avatar Jan 29 '20 20:01 khalidchawtany

Okeydokey. That shouldn't be too hard and I could even merge a version of this for mac and linux where it actually works and then merge windows support later. Dragging the window around shouldn't be too hard. This is encouraging :)

Kethku avatar Jan 29 '20 20:01 Kethku

Question: How important do you think the rounded corners are?

Kethku avatar Jan 29 '20 20:01 Kethku

It is actually a nice addition but I don't think it is bummer.

khalidchawtany avatar Jan 30 '20 08:01 khalidchawtany

blocked on https://github.com/Kethku/neovide/issues/97

Kethku avatar Feb 01 '20 05:02 Kethku

Hi @Kethku, Since https://github.com/Kethku/neovide/issues/97 is close what is the status of this? No pressure I was just asking :)

khalidchawtany avatar Sep 27 '20 10:09 khalidchawtany

also chiming in and looking forward to this (on windows).

mborejdo avatar Mar 26 '21 07:03 mborejdo

on Mac, iTerm2 uses a technique to embed the frame with the terminal window [action buttons only show up when mouse over]. This works fairly well.

yes, frameless would make neovide way more slick.

Screen Shot 2021-04-14 at 14 42 07

i3d avatar Apr 14 '21 21:04 i3d

Some more requests for this have arrived. I think this is blocked on upstream winit support as toolbar-less windows are not resizable. I am open to PRs for this though if anybody wants to dig in

Kethku avatar May 19 '21 04:05 Kethku

Chiming in to say it would be nice to have this even without window resizing. For those of us with tiling window managers it takes care of it. Doom emacs does this without resizing and rounded corners and its comes out quite nice

image

shaunsingh avatar May 19 '21 04:05 shaunsingh

Thats a good point. I'll look into what it would entail.

Kethku avatar May 20 '21 21:05 Kethku

image

works well on macOS, thanks!

shaunsingh avatar May 31 '21 17:05 shaunsingh

One issue I've run into is that a frameless window can't be moved to a fullscreen space: image

(it doesn't show in the screenshot but theres a grey error symbol on top of the neovide window)

Frameless emacs and iterm seem to work fine.

shaunsingh avatar Jun 05 '21 17:06 shaunsingh

This might just be an issue with rust/something upstream and can't be fixed with neovide. alacritty has the same behavior

shaunsingh avatar Jun 14 '21 14:06 shaunsingh

@shaunsingh probably because the window is not resizeable

zoomlogo avatar Jun 18 '21 14:06 zoomlogo

image

works well on macOS, thanks!

Which WM you're using? And how r u making it fool screen using keyboard?

Sayan-Manna avatar Dec 17 '21 15:12 Sayan-Manna

Which WM you're using?

I'm using yabai

And how r u making it fool screen using keyboard?

Both windows are still in windowed mode. The PR implemented a while back makes it frameless, i.e. removes the corners and window decorations

shaunsingh avatar Dec 19 '21 18:12 shaunsingh

@shaunsingh how do you start neovide? I already have in my .zprofile

export NEOVIDE_FRAMELESS=true
export NEOVIDE_FRAME=none

Running in the terminal: neovide --frame none fixes it for me. But I need it to open frameless when called in Mac's Spotlight.

chardskarth avatar Feb 25 '22 05:02 chardskarth

@shaunsingh how do you start neovide? I already have in my .zprofile

export NEOVIDE_FRAMELESS=true
export NEOVIDE_FRAME=none

Running in the terminal: neovide --frame none fixes it for me. But I need it to open frameless when called in Mac's Spotlight.

@chardskarth For MacOS gui apps you need to put the values into /etc/launchd.conf. Its covered in the answer to this stack overflow question. https://stackoverflow.com/questions/135688/setting-environment-variables-on-os-x

fathergoose avatar Apr 12 '22 15:04 fathergoose

That still doesn't work with the window manager of choice. Attaching a video of the current behavior here.

https://user-images.githubusercontent.com/25615887/172051186-84c10820-4e10-402c-bd9b-c36fecb09d8f.mov

sinnrrr avatar Jun 05 '22 12:06 sinnrrr

@sinnrrr is that running neovide with --frame none? I have noticed that doing so makes the window behave differently from regular macOS windows. Could you try with --frame buttonless, it is similar to frame none having no window borders/buttons, plus it is draggable if you click and drag towards the upper portion of the window (where the window title bar usually is) and also has a nice window shadow.

edit: there is also frame transparent which keeps the macos window buttons but removes everything else.

p.s. Alacritty too can be configured using the same values.

ankushKun avatar Jun 15 '22 16:06 ankushKun

@ankushKun better, now it can be moved with the cursor, but still doesn't work with yabai

https://user-images.githubusercontent.com/25615887/174196214-1f4a626e-a1ea-4349-90db-017a13b24926.mov

sinnrrr avatar Jun 16 '22 23:06 sinnrrr

@Kethku Thank you for this great project :) I am interested in this issue and made a pilot PR in #1459. I am also interested in continuously maintaining this change. Could you kindly review or introduce another maintainer? Thank you 🙇

Also, I would like to ask people here whether this PR can meet our requirements.

https://user-images.githubusercontent.com/28551465/183240179-b7d15744-3d9d-47c6-8008-30a5a250ae7b.mov

Matts966 avatar Aug 06 '22 08:08 Matts966