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

Title bar always white on windows 10 #834

Closed
K1DV5 opened this issue Apr 14, 2021 · 11 comments · May be fixed by #1019
Closed

Title bar always white on windows 10 #834

K1DV5 opened this issue Apr 14, 2021 · 11 comments · May be fixed by #1019

Comments

@K1DV5
Copy link

K1DV5 commented Apr 14, 2021

Since windows 10 introduced the dark theme, more and more apps go along with the theme, and that includes their title bars. Even file explorer has it now. But Neovim-qt always has a white title bar, regardless of the OS theme or the vim theme. I use it fullscreen not to see the title bar but it'd be nice if it went with the surrounding colors even when it's not maximized.

P.S. if the setting to color title bars is on, it gets the accent color, not white.

@jgehrig
Copy link
Collaborator

jgehrig commented Apr 14, 2021

The title bar is controlled by Qt. I'm not sure what we can do to fix this?

It looks like this is a known issue for Qt on Windows:
https://forum.qt.io/topic/121919/title-bar-color-problem

We should look for a bug upstream in Qt, and comment on it. If one does not exist, we should file a bug.

The suggested solution UWP, will not work for neovim-qt. We require most of the disallowed features. Darn!

@K1DV5
Copy link
Author

K1DV5 commented Apr 15, 2021

I understand now, but can we at least have an option to hide it? I think it can be made with autohotkey but I think doing it here is better. And maybe we can have a custom title bar (I think bleachbit and illustrator do it like that) which can be completely controlled here. But I can settle for just hiding it, because the window can be controlled with keyboard shortcuts. What do you think?

@jgehrig
Copy link
Collaborator

jgehrig commented Apr 15, 2021

From my search, I do not see a Qt API to change the title bar theme/color. Without an Qt support, we're stuck with this behavior...

Unfortunately, we're limited to the APIs offered by Qt. Using platform-specific solutions outside the Qt framework presents a maintainability problem. Limited time and resources.

You'll notice this behavior with other Windows apps too, for example Notepad. I think this is just how Windows renders the titlebar for Win32 API applications. Windows bug?

If this can be fixed within the confines of Qt, I am receptive to a Pull Request.

@K1DV5
Copy link
Author

K1DV5 commented Apr 15, 2021

Alright, thanks for taking the time to explain. Closing.

@K1DV5 K1DV5 closed this as completed Apr 15, 2021
@jgehrig
Copy link
Collaborator

jgehrig commented Apr 15, 2021

No worries!

It is unfortunate there isn't a practical fix...

@jgehrig
Copy link
Collaborator

jgehrig commented Apr 21, 2021

@statiolake

I just stumbled across your change:
statiolake@da8eaba

It looks like your code addresses the scenario above?

Posting here for search. Maybe others will want to manually apply this patch.

@statiolake
Copy link
Contributor

statiolake commented Apr 21, 2021

Yes, that's a very basic dark title bar support. Just for my personal use, so always dark title bar (no check for actual user color settings) and no theme change detection. I use this patch for my daily use.

image

It works in my environment (Windows 10 20H2, build 19042.928) but may not work on older environments. It depends on the version of Windows. The APIs used here is hidden and (as far as I know) they were actually changed once before.

@jgehrig
Copy link
Collaborator

jgehrig commented Apr 21, 2021

Thanks for the detailed information! 👍

I hope others will find your patch useful too...

FYI @K1DV5

@K1DV5
Copy link
Author

K1DV5 commented Apr 21, 2021

This is exciting! So I'll need to manually apply it right? And will it eventually be merged into master?

@jgehrig
Copy link
Collaborator

jgehrig commented Apr 22, 2021

@K1DV5

Yes, you'll need to manually apply this.

No, it isn't a good candidate for merge into master. The changes have some quirks/bugs, see statiolate's comments above.

Additionally, I'm not sure I want to invest my time to officially maintain this windows-only workaround. This should be fixed in Qt...

If you want a semi-official solution, here is an idea:

  1. Open a Pull Request. It won't be merged, but I am happy to keep it open.
  2. You can apply this fix.
  3. AppVeyor will generate a Windows build for you. No messing with Windows + Qt dependencies!
  4. Follow these instructions: https://github.com/equalsraf/neovim-qt/wiki/Windows-AppVeyor-Builds
  5. Post a comment with the download link at the top of your Pull Request.

You'd have to occasionally go in and re-base the change onto the latest master:

git checkout master
git pull https://github.com/equalsraf/neovim-qt.git
git checkout {your-pr-branch}
git rebase master
git push -f

AppVeyor builds expire every 6 months. They'd need to be refreshed at at least this frequency.

If the bugs get fixed, and enough users are interested maybe we can officially support the feature at a future date.

@K1DV5
Copy link
Author

K1DV5 commented Apr 23, 2021

@jgehrig, thank you so much. That's a workable idea and very helpful.

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 a pull request may close this issue.

3 participants