Sitelet https://web.archive.org/web/20200716005944/https://github.com/electron/electron/issues/22105
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

Hide icon of modal dialog on Windows #22105

Open
lutzroeder opened this issue Feb 8, 2020 · 22 comments
Open

Hide icon of modal dialog on Windows #22105

lutzroeder opened this issue Feb 8, 2020 · 22 comments

Comments

@lutzroeder
Copy link
Contributor

@lutzroeder lutzroeder commented Feb 8, 2020 •

Is there a way to hide the icon of a BrowserWindow on Windows?

Expected:
Screen Shot 2020-02-08 at 11 28 08 AM

Actual:
Screen Shot 2020-02-08 at 11 27 35 AM

Repro:
electron-22105.zip

@julienpan
Copy link

@julienpan julienpan commented Feb 19, 2020

Hi, I'd like to work on this, I would like to have more information about how to start on it.

@VVlasy
Copy link

@VVlasy VVlasy commented Feb 21, 2020

@julienpan Hi, start off by compiling your own build of Electron as described here.

@VVlasy
Copy link

@VVlasy VVlasy commented Feb 22, 2020

@lutzroeder @MarshallOfSound What is the proposed solution?

There a few I had in mind.

  1. Handle null value for icon property of electron.BrowserWindow and when set to null remove window icon instead of throwing up an error file not found

  2. Remove icon from window when it is set as modal on Windows

  3. Add property showWindowIcon that is by default set to true, could be set to false by default on modal windows as well.

@lutzroeder
Copy link
Contributor Author

@lutzroeder lutzroeder commented Feb 22, 2020 •

The first two options would change the behavior in existing apps.

Maybe setting icon to electron.nativeImage.createEmpty() and checking icon && icon.isEmpty() would work?

See also https://stackoverflow.com/questions/53880863/electron-cant-hide-program-icon-in-browserwindow

@VVlasy
Copy link

@VVlasy VVlasy commented Feb 22, 2020

And after the check in JS make a callback to c++ -> platform specific implementations

@elizaho
Copy link

@elizaho elizaho commented Mar 17, 2020

Did this ever get resolved, or is this still an issue that someone can work on? If no one is working on it right now, I'd like to work on it. Are you still working on it? @julienpan

@Falgu9
Copy link

@Falgu9 Falgu9 commented Mar 19, 2020

Hi ! I can also help if @julienpan or @elizaho didnt start to fix this issue. Give news if you can please !

@aritramullick
Copy link

@aritramullick aritramullick commented May 6, 2020

I would be interested in helping if this hasn't been resolved yet. However, I am a first-timer and I dont really know exactly how to go about this.

@rghv9
Copy link

@rghv9 rghv9 commented May 10, 2020

inspect it
and do in its css file and set
display:"none";

@Aryan-Sihag
Copy link

@Aryan-Sihag Aryan-Sihag commented May 14, 2020

hey i am new to github and i want to make some early contributions , i think i can work on it and i would like to get some instructions on how to get started.

@mahdi-farnia
Copy link

@mahdi-farnia mahdi-farnia commented May 16, 2020

Hello i think the best way is hiding browser frames...
and Create another one with your custom items.
You now how.. right??

@lutzroeder
Copy link
Contributor Author

@lutzroeder lutzroeder commented May 16, 2020 •

The goal is not to find a workaround but fix the underlying issue in Electron. This probably requires understanding how Electron creates the native HWND on Windows and apply this flag if the dialog is modal and icon.isEmpty().

@ReverPL
Copy link

@ReverPL ReverPL commented May 22, 2020

@uditswaroopa
Copy link

@uditswaroopa uditswaroopa commented May 25, 2020

Hey I want to work on this issue can you please assign it to me

@lars-berger
Copy link

@lars-berger lars-berger commented May 28, 2020

On a similar note, it would be nice to be able to hide the application title in the titlebar, while still being able to show a title on taskbar hover (eg. as done by File Explorer).

@faraz16iqbal
Copy link

@faraz16iqbal faraz16iqbal commented Jun 18, 2020

If this is issue hasn't been resolved, I'd love to work on it!

@Le-Roi777
Copy link

@Le-Roi777 Le-Roi777 commented Jun 20, 2020

Hi gents... : ) quick question, why is this an issue? And why do you want or need to hide the icon?

@lutzroeder
Copy link
Contributor Author

@lutzroeder lutzroeder commented Jun 20, 2020

@Le-Roi777 Modal dialogs in Windows apps often do not show an icon. For example, open Notepad > Help > About Notepad.

@vishal-1408
Copy link

@vishal-1408 vishal-1408 commented Jun 24, 2020

Hi, If the issue is still not fixed i would love to work on it .

@Mobius1D
Copy link

@Mobius1D Mobius1D commented Jun 28, 2020

@lutzroeder Hi, I have started to work on the issue, can u assign it to me?
Am very excited to work on this.

@Mobius1D
Copy link

@Mobius1D Mobius1D commented Jul 1, 2020

Hey, still working on this issue here,
I initially read through the shell/browser/api/electron_api_browser_window.cc but wasn't able to find anything relevant.
Then I searched through the entire project for the code related to the title bar and am not finding anything useful here too.
It would be amazing and easier to work on this if I could get some help on what files that I would be working on.
I am pretty much sure that I would have to modify the API to include a field called showWindowIcon that can be set to true to show the icon on the title bar and by default set to false if it is a modal window. These arguments would be passed to the class responsible for the title bar which I can modify accordingly.
Need some help with finding the files that I might be working with and also with the approach.
Thanks in advance.

@lutzroeder
Copy link
Contributor Author

@lutzroeder lutzroeder commented Jul 1, 2020

@zcbenz might be able to provide some context. native_window_views.cc looks like the right place to get started.

WinForms has ShowIcon. Another option might be electron.nativeImage.createEmpty() and icon && icon.isEmpty().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.