Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Frame on Windows For Native Menu #16

Open
rsispal opened this issue Aug 17, 2020 · 4 comments
Open

Frame on Windows For Native Menu #16

rsispal opened this issue Aug 17, 2020 · 4 comments
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@rsispal
Copy link

rsispal commented Aug 17, 2020

Hi,

First - thank you for producing this package. I've been waiting for years for this effect to arrive on Windows, and thanks to your work it is now. Saw your PR to get this officially into Electron too!

I had a question regarding the usage of frame on the Electron BrowserWindow. Whilst your documentation states to switch it off, I wondered why as it is actually functional (albeit with some styling issues which I explain below - hopefully something fixable):

Okay. So:

1. When frame: true

The menu does appear, and the window shows the thick frame (thickFrame: true is default on BrowserWindow)
Screenshot 2020-08-17 at 14 46 02

2. When frame: true, thickFrame: false

This removes the thick frame, which then causes a gap around the menu toolbar
Screenshot 2020-08-17 at 14 51 59

2.1. Toggling Windows Light/Dark Appearance

This seems to cause the menu to "fit" the window again.
Screenshot 2020-08-17 at 14 57 05

Moving Forward

Clearly when the appearance mode is changed, the window undergoes some kind of "refresh" that makes the native menu fit the window. Not too sure how to trace what this process is, but it'd be great if the BrowserWindow could somehow replicate this on startup so your library can offer a BrowserWindow with a menu in line with non-acrylic windows.

I thought I would check your thoughts on this matter as I assume you are probably already aware of this during your development efforts.

@seo-rii
Copy link
Owner

seo-rii commented Aug 18, 2020

I'm sorry, but this is the first time I've noticed this. That's a great idea.
However, when I look at this article and test it, there are a few problems: the first is a minor problem: there is still a slight difference if you change the theme and resize it. The second is a serious problem: the window that has been processed like this cannot be resized.
Of course, if I look at the internal structure of the electron, I'll be able to solve this problem, but I don't have the skills and time to do it :(
Instead, try custom-electron-titlebar. I haven't tested it yet, but I think it will work well with this module. I'm also considering adding this module to dependencies after testing later.

@seo-rii seo-rii added bug Something isn't working enhancement New feature or request help wanted Extra attention is needed labels Aug 18, 2020
@rsispal
Copy link
Author

rsispal commented Aug 18, 2020

Hi @seo-rii, thanks for your detailed response!


the first is a minor problem: there is still a slight difference if you change the theme and resize it.

I notice the title bar always remains white unlike the menu bar. Are you seeing anything else that I have missed?


The second is a serious problem: the window that has been processed like this cannot be resized.

This appears to be due to the thickFrame property and I can confirm that this happens on the standard BrowserWindow. When thickFrame: true you are able to resize the window. When thickFrame: false you cannot.


Instead, try custom-electron-titlebar. I haven't tested it yet, but I think it will work well with this module. I'm also considering adding this module to dependencies after testing later.

I did have a look at this and have tried it before, but I am hesitant given that they are archiving the project shortly.


The only "real" issues I have noticed are:

  • the title bar not changing colour when the appearance changes
  • when thickFrame: false the menu does not fit to the screen until the window repaints

Whilst I have used NAPI, I am completely new to the Windows accent policy stuff, but I will research and see if I can offer any help.

@seo-rii
Copy link
Owner

seo-rii commented Aug 18, 2020

I'm so glad you can help!
First of all, the color of the title bar does not change only when this module is applied, but it is a problem that appears in all electronic programs. Perhaps to solve the problem, it will be necessary to use the above-mentioned modules, or to create new modules to play that role.
I'll look for a problem that I can't adjust the size when the thickFrame is false.

@seo-rii seo-rii added this to the v1 milestone Aug 20, 2020
@tscpp
Copy link
Collaborator

tscpp commented Oct 24, 2020

Though this is a great idea, turning off the frame should require the developer to design an own frame for the application. By not doing so, the standard frame for the os should be used. Therefore options for how the frame should look and behave should be implemented in electron and not this repository.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants