-
Notifications
You must be signed in to change notification settings - Fork 78
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
The application lacks a taskbar Icon #106
Comments
Thank you for letting us know. We will address this issue in one of our next releases. |
So I debugged a lot more and found out that it depends on the If I pass Here's the video evidence. Bz0R8PRvBf.mp4I'm not really a C++ person but a cursory look made me a bit suspicious of these in _windowTitle = new wchar_t[256];
if (initParams->TitleWide != NULL)
{
WinToast::instance()->setAppName(initParams->TitleWide);
WinToast::instance()->setAppUserModelId(initParams->TitleWide);
wcscpy(_windowTitle, initParams->TitleWide);
}
else
_windowTitle[0] = 0; void Photino::SetTitle(AutoString title)
{
if (wcslen(title) > 255)
{
for (int i = 0; i < 256; i++)
_windowTitle[i] = title[i];
_windowTitle[255] = 0;
}
else
wcscpy(_windowTitle, title);
SetWindowText(_hWnd, title);
WinToast::instance()->setAppName(title);
WinToast::instance()->setAppUserModelId(title);
} |
I've also had mixed results with getting the icon to work in Windows 11; as @orels1 stated, sometimes it is the actual icon, and sometimes the generic .NET icon. I believe it has something to do how Windows 11 (I never had the issue with Windows 10) groups taskbar icons; the issue appears to be here in Photino.Native. It sets the unique application id to the title of the window. Hypothesis: this is not an issue the first time as the name/ id is simply matched to the executing application (which is For me the latter results in the problem that I get the generic .NET Icon in the taskbar, and when i right-click on it, and right-click on the application name again and select I was able to fix the issue by ensuring that the window titles (and thus, app ids) are unique between DEBUG and RELEASE: string WindowTitle;
#if DEBUG
WindowTitle = "My Application (Debug)";
#else
WindowTitle = "My Application (Release)";
#endif Hope this helps. |
@zeroskyx oh! That might explain why I was getting such inconsistent results while trying to debug. |
@zeroskyx thx for the pointers! |
It really seems to me that this issue should not have been closed. Is there any chance you can expose the As far as I can tell from extensive googling, Windows using the application user model ID to determine how to group taskbar icons. This means that the current default behavior here of dumping the title into the app ID causes two problems: 1) you get weird and unpredictable blank taskbar icon behavior sometimes, and 2) Windows cannot figure out how to group Photino windows in a process. In particular, if you use Photino in conjunction with an existing WinForms application, for example, you get two taskbar icons instead of one (one of which is possibly blank), and if you have multiple Photino windows in the same process, they each get their own taskbar icons instead of being grouped together properly. Electron and other similar platforms allow the user to set the appUserModelId for this reason, and I think it would be helpful if Photino does the same. |
Thank you for pointing that out. I have re-opened the issue and set some labels to look into this again. |
After doing some tests I noticed that when you use I don't know why this happens, but it works. Can someone reproduce this. |
I'm encountering the same issue and believe it is because the name matches the namespace? I resolved it by adding a space to the name. Thank you @orels1 for letting me know that it depends on the title. |
First of all, wanted to say that Photino is an absolute delight to work with thus far.
We were able to get cross-platform application going in a matter of days with most of functionality we need handled.
One thing that I am unable to get working so far is taskbar icons, though.
At least on Windows 11 (22H2) - the IconFile option does set it in the window titlebar, but the taskbar still shows a generic icon, like this:
If I am missing something, I apologize, but if it is just not something Photino.NET/Native supports, I would love to know as well!
I am setting the icon like this
And am using the .ico file on Windows
Setting the ApplicationIcon in the .csproj also didn't do the trick, it is being set on the .exe, but the taskbar one is still missing. According to this github issue it is indeed grabbed from the window itself, so I assume Photino should be able to affect that.
The text was updated successfully, but these errors were encountered: