Skip to content
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

Remember windows size via pixel #1706

Merged
merged 14 commits into from Apr 14, 2023
Merged

Conversation

chomosuke
Copy link
Contributor

What kind of change does this PR introduce?

Did this PR introduce a breaking change?

A breaking change includes anything that breaks backwards compatibility either at compile or run time.

  • No

@A-Lamia
Copy link

A-Lamia commented Jan 4, 2023

On first start up window opens in minimal possible size, after that everything works as intended.

Tested on windows 10.

@chomosuke
Copy link
Contributor Author

On first start up window opens in minimal possible size, after that everything works as intended.

This is expected, it's because it's reading the last saved character size and interpreting that as pixel size.

@A-Lamia
Copy link

A-Lamia commented Jan 4, 2023

Then everything is perfect been using it for a day with no issues :)

@fredizzimo
Copy link
Member

Can you make sure that everything still works properly when the size has been stored as pixels, and then going to an older version of Neovide? There's this report #1788, and I'm fairly sure it's caused by this MR.

Using a different name for the setting would probably be sufficient.

@chomosuke
Copy link
Contributor Author

@fredizzimo done and tested :)

@chomosuke
Copy link
Contributor Author

Is there anything that prevents this PR from being merged? It's been sitting here for a while now.

@A-Lamia
Copy link

A-Lamia commented Mar 8, 2023

as some one who has been using this patch for over 2 months on windows at least it is very solid.

@chomosuke
Copy link
Contributor Author

as some one who has been using this patch for over 2 months on windows at least it is very solid.

Same, I've been using this on Linux and haven't encountered a single problem so far.

Copy link
Member

@fredizzimo fredizzimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except for the tiny comment about a use statement, everything looks good.

I have also been annoyed with the resizing myself, so I would personally really appreciate if this got merged.

@@ -1,5 +1,6 @@
use std::path::PathBuf;

use glutin::dpi::PhysicalSize;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sould be winit::dpi::PyshicalSize, since already changed all the other references. winit::dpi::PhysicalPosition is also used just below this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed :)

@danielb2
Copy link

@MultisampledNight
@last-partizan hi is there any reason this isn't being reviewed and merged?

@last-partizan
Copy link
Collaborator

I would really prefer to have original --geometry unchanged, and store only window size in pixels. Is that possible?

@chomosuke
Copy link
Contributor Author

chomosuke commented Apr 13, 2023

@last-partizan The --geometry option still exist and is still usable. I'm not sure why would it be better than the new --size option though?

@last-partizan
Copy link
Collaborator

last-partizan commented Apr 13, 2023

Oh, i missed that. I was thinking it was replaced. Looks good to me, then.

@Kethku what do you think, should we merge this?

@Kethku
Copy link
Member

Kethku commented Apr 13, 2023

@MultisampledNight @last-partizan hi is there any reason this isn't being reviewed and merged?

https://neovide.dev/maintainer-cookbook.html#how-to-keep-your-sanity multisampled wrote this out and I think captures how us maintainers have needed to work on the project. We all have lives and jobs outside of it, and if we tried to track and respond to everything, we would burn out. At least thats how I personally see it.

I personally haven't reviewed this yet because it wasn't clear to me if this is the better solution over storing a grid size. I think the growing window problem likely comes from a disconnect between the stored size which is maybe an internal window size without the frame, and the set size which maybe includes the frame. Or visa versa. Storing a pixel size might be worse if the window was stored on display with a given scaling factor and then restored in a window with a different factor? Idk.

None of above should be a blocker, it was just some thoughts I had that weren't fully investigated. That lack of clarity on the "correct" solution stopped me personally from checking it off or reviewing.

I don't have a strong feeling either way though and this likely improves things so maybe its worth merging. @chomosuke do you have some thoughts on what I've written above? If you're confident I'm over worried Im happy to merge. I appreciate the persistence <3

@chomosuke
Copy link
Contributor Author

No worries @Kethku, I totally understand the maintaining a project like this is hard work and I thank you for everything you've already done for neovide!

For the root cause of growing window I believe that it is caused by font size changing right after nvim starts, there's some further info on a comment I made a while ago and some evidence to support my beliefs. Overall storing the size in pixel has fixed the issue for me :).

I'm not sure about changing scaling factor though, I haven't tested that but regardless I think this PR is still an improvement that fixes the changing font issue and I do think it is worth merging.

Btw, if you think having more maintainer for this project will help, I am happy to be another maintainer. I have a few improvements to neovide in my mind and once I've made them I'd be more well versed in the code base and reviewing PR etc.

@Kethku Kethku merged commit daf5307 into neovide:main Apr 14, 2023
3 checks passed
@Kethku
Copy link
Member

Kethku commented Apr 14, 2023

Sold! You're probably right about the actual core issue as I had forgotten about the timing issue between reading the config and first window render. Thanks for the attention to detail. Maybe come hang out in the discord? That's where most of the maintainers are atm

@chomosuke chomosuke deleted the remember-windows-size branch April 14, 2023 04:55
falcucci pushed a commit to falcucci/neovide that referenced this pull request Apr 19, 2023
* Cargo.toml unix line ending

* added --size

* figure out initial size in draw_frame()

* refactor: Rename window_geometry -> window_size

& move parse_window_geometry

* remember window size by pixel

* updated doc

* format

* remove executable permission on random files

* changed name of size setting to avoid conflict with old version of setting

* Changed one glutin::dpi::PhysicalSize to winit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Window size is increasing with every start of neovide
6 participants