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

DrawIO Icon does not work in KDE after installation with AppImager #547

Closed
Zesko opened this issue Apr 17, 2021 · 8 comments · Fixed by jgraph/drawio#2556
Closed

DrawIO Icon does not work in KDE after installation with AppImager #547

Zesko opened this issue Apr 17, 2021 · 8 comments · Fixed by jgraph/drawio#2556

Comments

@Zesko
Copy link

Zesko commented Apr 17, 2021

Describe the bug

I installed DrawIO latest version with AppImager for Manjaro KDE. KDE menu shows the correct icon of DrawIO.
But I opened it that shows the Xorg icon like default icon in KDE taskbar panel, not drawio's icon.

To Reproduce
Steps to reproduce the behavior:

  1. Install the latest version of drawio with AppImager in KDE (latest version)
  2. Open drawio app
  3. See the wrong icon in KDE taskbar and window titlebar too

Expected behavior
The drawio's icon should be correct in KDE taskbar and titlebar.

Screenshots
grafik

draw.io version (In the Help->About menu of the draw.io editor):

  • draw.io version 14.6.13 (Latest version)

Desktop (please complete the following information):

  • OS: Manjaro KDE latest version and stable branch
@zaroth
Copy link

zaroth commented Jan 16, 2022

This is still happening in the Linux build (Arch Linux in my case), app version 16.1.2. I'm not sure why this issue got closed? Is it a duplicate? From what I can tell it's not a packaging error.

@davidjgraph
Copy link
Contributor

We closed because we have no solution. We can re-open and have no solution if preferred :)

@davidjgraph davidjgraph reopened this Jan 16, 2022
@Zesko
Copy link
Author

Zesko commented Jan 16, 2022

It has the issue with only installation with AppImager .
But install drawio-desktop-bin 16.1.2 from AUR that it has no issue.

@Zesko
Copy link
Author

Zesko commented Jan 16, 2022

We closed because we have no solution. We can re-open and have no solution if preferred :)

Create drawio.png with 32x32 size should be in the directory $HOME/.local/share/icons/hicolor/32x32/apps/

and

Create drawio.png with 48x48 size in $HOME/.local/share/icons/hicolor/48x48/apps/.

and

Create drawio.desktop in the directory $HOME/.local/share/applications/.

[Desktop Entry]
Categories=Graphics;
Comment=diagrams.net desktop
Exec=/[PATH]/drawio %U
Icon=drawio
Name=drawio
NoDisplay=false
Type=Application

@zaroth
Copy link

zaroth commented Jan 17, 2022

@davidjgraph
For me, closing the issue means either that the issue is fixed or that the authors don't think it needs to be fixed (not a bug, so working as intended). That's why I was surprised to see it closed.

@Zesko
I have it installed via drawio-desktop-bin from AUR (Arch). And as you noted, it already has the proper .desktop file and icon files in the right paths:

/usr/share/applications/drawio.desktop

[Desktop Entry]
Name=drawio
Exec=/opt/drawio/drawio %U
Terminal=false
Type=Application
Icon=drawio
StartupWMClass=drawio
Comment=diagrams.net desktop
MimeType=application/vnd.jgraph.mxfile;application/vnd.visio;
Categories=Graphics;

And both the .desktop entry in the menus and taskbar show the correct icon:

image

image

However, having the correct .desktop file doesn't result in appropriate behavior after the app is launched - that's why I wrote in my comment earlier that I don't think the problem lies in packaging. It's best illustrated with a video:

How draw.io/diagrams.net desktop currently behaves (version 16.1.2)

drawio-wrong-behavior.mp4

As we can see, there are two problems here, probably related to each other:

  1. Despite initially having the correct icon in the pinned taskbar icon, soon after launching, the draw.io app "forgets" it should have the icon and gets a generic X11 one instead.
  2. This behavior (spawning a child process? Something else, possibly Electron related?) also prevents KDE from realizing that the launched app is linked to the taskbar icon, essentially duplicating taskbar icons for draw.io after launching the program.

How application should behave (another Electron app, Logseq)

logseq-correct-behavior.mp4

As I wrote, I thought the behavior might be related to some of Electron's quirks, so I found an Electron app who is doing this right - Logseq, a great PKM tool. As we can see here, the app both keeps its proper icon after launch and lets KDE associate its window with its launcher icon.

Now if only I knew enough about Electron and JS to dive into code of both Logseq desktop and draw.io desktop to compare what the first is doing right, I could probably write a PR for this issue - but sadly I don't. This could be a helpful starting point for someone else, though.

@zaroth
Copy link

zaroth commented Jan 17, 2022

After digging in a bit more, I found that drawio is using electron-builder for its electron packaging needs. And it seems to also be already providing path to the icons for the Linux build.

I tested one other popular app from github, also built using electron-builder and it seemed to have no issues. I will see what they're doing differently and report back.

@zaroth
Copy link

zaroth commented Jan 17, 2022

I'm happy to report that I successfully solved this issue! All it took was adding a single line to options in src/main/webapp/electron.js, line 84:

icon: `${__dirname}/images/drawlogo256.png`,

From what I understood, the problem is that Linux binaries don't have a special place to put their icon in (unlike Mac or Win), so specifying the icon in code is required for it to work. Adding this parameter changed the draw.io behavior to the correct one, fixing both the empty icon issue and the taskbar pinned icon matching issue:

drawio-correct-behavior.mp4

I linked drawlogo256.png because that was AFAIK the highest resolution logo available from within electron app, but obviously if it's not enough, a higher resolution file could be put into the drawio repo and linked (from what I've seen, in drawio-desktop repo the highest resolution icon has 1024x1024).

I'll submit a PR shortly with this change.

Huge thanks to Timosh from Electron Discord channel who helped me figure out the cause of the issue.

@davidjgraph
Copy link
Contributor

Nice, thanks for looking.

nithinprasad pushed a commit to nithinprasad/drawio that referenced this issue Jan 30, 2022
Fixes jgraph/drawio-desktop#547. I have tested this change only on Linux+KDE and can confirm it works. Obviously some testing on Mac and Windows would be nice to confirm it doesn't break anything. More details in the linked issue.
jdelpierre added a commit to centreon/drawio that referenced this issue Apr 29, 2022
* Fix problem with C4 diagraming tool

Related issue: #2345

* 15.7.0 release

* 15.7.1 release

* 15.7.2 release

* 15.7.3 release

* 15.7.4 release

* 15.8.0 release

* 15.8.1 release

* 15.8.3 release

* 15.8.4 release

* 15.8.5 release

* 15.8.6 release

* 15.8.7 release

* 15.8.8 release

* Add files via upload

* 15.8.9 release

* 15.8.9 release

* 15.8.9 release

* 15.9.1 release

* 15.9.3 release

* 15.9.4 release

* 15.9.5 release

* 15.9.6 release

* 16.0.0 release

* Update bug_report.md

* 16.0.2 release

* 16.0.3 release

* 16.1.0 release

* 16.1.2 release

* Update README.md

* 16.1.3 release

* 16.1.4 release

* 16.2.1 release

* 16.2.2 release

* 16.2.3 release

* 16.2.4 release

* Update stale.yml

* 16.2.6 release

* Create bug_report.yaml

* Delete bug_report.md

* Update bug_report.yaml

* Update bug_report.yaml

* Create feature_request.yaml

* Delete feature_request.md

* Update feature_request.yaml

* 16.2.7 release

* Fix incorrect application icon behavior on Linux

Fixes jgraph/drawio-desktop#547. I have tested this change only on Linux+KDE and can confirm it works. Obviously some testing on Mac and Windows would be nice to confirm it doesn't break anything. More details in the linked issue.

* 16.3.0 release

* 16.4.0 release

* 16.4.3 release

* 16.4.5 release

* Bump node-fetch from 3.0.0 to 3.1.1 in /etc/propgen

Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 3.0.0 to 3.1.1.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/main/docs/CHANGELOG.md)
- [Commits](node-fetch/node-fetch@v3.0.0...v3.1.1)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* 16.4.7 release

* 16.4.8 release

* 16.4.11 release

* 16.5.1 release

* 16.5.2 release

* 16.5.3 release

* fix: upgrade electron-updater from 4.3.9 to 4.6.5

Snyk has created this PR to upgrade electron-updater from 4.3.9 to 4.6.5.

See this package in npm:


See this project in Snyk:
https://app.snyk.io/org/davidjgraph/project/b324f40d-74b4-4545-99b2-af8481e33ed3?utm_source=github&utm_medium=referral&page=upgrade-pr

* fix: upgrade electron-log from 4.4.1 to 4.4.4

Snyk has created this PR to upgrade electron-log from 4.4.1 to 4.4.4.

See this package in npm:


See this project in Snyk:
https://app.snyk.io/org/davidjgraph/project/b324f40d-74b4-4545-99b2-af8481e33ed3?utm_source=github&utm_medium=referral&page=upgrade-pr

* 16.5.4 release

* 16.5.6 release

* 16.6.0 release

* 16.6.1 release

* 16.6.2 release

* 16.6.3 release

* 16.6.4 release

* 16.6.5 release

* 16.6.6 release

* 16.6.7 release

* 16.6.8 release

* 17.0.0 release

* 17.1.0 release

* 17.1.1 release

* 17.1.2 release

* 17.1.3 release

* 17.1.3 release

* 17.1.4 release

* 17.1.5 release

* 17.2.1 release

* Fix loading order for javax.cache.CacheManager on App Engine

I was running an drawio fork on app engine and Google Drive integration suddenly started failing with IncompatibleClassChangeError errors. Found https://stackoverflow.com/q/46582783 which fixed it.

We might not 100% need this. This is mostly a heads up if anyone else runs into similar issues.
I'm also not sure if this is easily reproducible on the public App Engine. Following up with GAE to see if this is a bigger issue.

* 17.2.1 release

* Create codeql-analysis.yml

* Create SECURITY.md

* Update SECURITY.md

* Update codeql-analysis.yml

* Update codeql-analysis.yml

* 17.2.2 release

* Update codeql-analysis.yml

* 17.2.3 release

* 17.2.4 release

* 17.2.5 release

* 17.3.0 release

* 17.4.0 release

* 17.4.1 release

* 17.4.2 release

* 17.4.3 release

* 17.4.3 release

* Added java build for codeql

* github: remove original repo configuration

Co-authored-by: Dong Nguyen <ndaidong@gmail.com>
Co-authored-by: David Benson [draw.io] <david@jgraph.com>
Co-authored-by: Mate Egri <mate.egri78@gmail.com>
Co-authored-by: David Benson <david@draw.io>
Co-authored-by: Lukasz D <lukasz.dobrogowski@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: David Stephan <stephandavid3@gmail.com>
Co-authored-by: Mohamed Mohamedin <ashraf.teleb85@gmail.com>
Yuriel849 pushed a commit to Yuriel849/drawio that referenced this issue Jun 2, 2022
Fixes jgraph/drawio-desktop#547. I have tested this change only on Linux+KDE and can confirm it works. Obviously some testing on Mac and Windows would be nice to confirm it doesn't break anything. More details in the linked issue.
jdelpierre added a commit to centreon/drawio that referenced this issue Aug 8, 2022
* Fix problem with C4 diagraming tool

Related issue: #2345

* 15.7.0 release

* 15.7.1 release

* 15.7.2 release

* 15.7.3 release

* 15.7.4 release

* 15.8.0 release

* 15.8.1 release

* 15.8.3 release

* 15.8.4 release

* 15.8.5 release

* 15.8.6 release

* 15.8.7 release

* 15.8.8 release

* Add files via upload

* 15.8.9 release

* 15.8.9 release

* 15.8.9 release

* 15.9.1 release

* 15.9.3 release

* 15.9.4 release

* 15.9.5 release

* 15.9.6 release

* 16.0.0 release

* Update bug_report.md

* 16.0.2 release

* 16.0.3 release

* 16.1.0 release

* 16.1.2 release

* Update README.md

* 16.1.3 release

* 16.1.4 release

* 16.2.1 release

* 16.2.2 release

* 16.2.3 release

* 16.2.4 release

* Update stale.yml

* 16.2.6 release

* Create bug_report.yaml

* Delete bug_report.md

* Update bug_report.yaml

* Update bug_report.yaml

* Create feature_request.yaml

* Delete feature_request.md

* Update feature_request.yaml

* 16.2.7 release

* Fix incorrect application icon behavior on Linux

Fixes jgraph/drawio-desktop#547. I have tested this change only on Linux+KDE and can confirm it works. Obviously some testing on Mac and Windows would be nice to confirm it doesn't break anything. More details in the linked issue.

* 16.3.0 release

* 16.4.0 release

* 16.4.3 release

* 16.4.5 release

* Bump node-fetch from 3.0.0 to 3.1.1 in /etc/propgen

Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 3.0.0 to 3.1.1.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/main/docs/CHANGELOG.md)
- [Commits](node-fetch/node-fetch@v3.0.0...v3.1.1)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* 16.4.7 release

* 16.4.8 release

* 16.4.11 release

* 16.5.1 release

* 16.5.2 release

* 16.5.3 release

* fix: upgrade electron-updater from 4.3.9 to 4.6.5

Snyk has created this PR to upgrade electron-updater from 4.3.9 to 4.6.5.

See this package in npm:


See this project in Snyk:
https://app.snyk.io/org/davidjgraph/project/b324f40d-74b4-4545-99b2-af8481e33ed3?utm_source=github&utm_medium=referral&page=upgrade-pr

* fix: upgrade electron-log from 4.4.1 to 4.4.4

Snyk has created this PR to upgrade electron-log from 4.4.1 to 4.4.4.

See this package in npm:


See this project in Snyk:
https://app.snyk.io/org/davidjgraph/project/b324f40d-74b4-4545-99b2-af8481e33ed3?utm_source=github&utm_medium=referral&page=upgrade-pr

* 16.5.4 release

* 16.5.6 release

* 16.6.0 release

* 16.6.1 release

* 16.6.2 release

* 16.6.3 release

* 16.6.4 release

* 16.6.5 release

* 16.6.6 release

* 16.6.7 release

* 16.6.8 release

* 17.0.0 release

* 17.1.0 release

* 17.1.1 release

* 17.1.2 release

* 17.1.3 release

* 17.1.3 release

* 17.1.4 release

* 17.1.5 release

* 17.2.1 release

* Fix loading order for javax.cache.CacheManager on App Engine

I was running an drawio fork on app engine and Google Drive integration suddenly started failing with IncompatibleClassChangeError errors. Found https://stackoverflow.com/q/46582783 which fixed it.

We might not 100% need this. This is mostly a heads up if anyone else runs into similar issues.
I'm also not sure if this is easily reproducible on the public App Engine. Following up with GAE to see if this is a bigger issue.

* 17.2.1 release

* Create codeql-analysis.yml

* Create SECURITY.md

* Update SECURITY.md

* Update codeql-analysis.yml

* Update codeql-analysis.yml

* 17.2.2 release

* Update codeql-analysis.yml

* 17.2.3 release

* 17.2.4 release

* 17.2.5 release

* 17.3.0 release

* 17.4.0 release

* 17.4.1 release

* 17.4.2 release

* 17.4.3 release

* 17.4.3 release

* Added java build for codeql

* remove git workflow original repo

Co-authored-by: Dong Nguyen <ndaidong@gmail.com>
Co-authored-by: David Benson [draw.io] <david@jgraph.com>
Co-authored-by: Mate Egri <mate.egri78@gmail.com>
Co-authored-by: David Benson <david@draw.io>
Co-authored-by: Lukasz D <lukasz.dobrogowski@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: David Stephan <stephandavid3@gmail.com>
Co-authored-by: Mohamed Mohamedin <ashraf.teleb85@gmail.com>
Yassir-BenBOUBKER pushed a commit to centreon/drawio that referenced this issue Nov 11, 2022
* Fix problem with C4 diagraming tool

Related issue: #2345

* 15.7.0 release

* 15.7.1 release

* 15.7.2 release

* 15.7.3 release

* 15.7.4 release

* 15.8.0 release

* 15.8.1 release

* 15.8.3 release

* 15.8.4 release

* 15.8.5 release

* 15.8.6 release

* 15.8.7 release

* 15.8.8 release

* Add files via upload

* 15.8.9 release

* 15.8.9 release

* 15.8.9 release

* 15.9.1 release

* 15.9.3 release

* 15.9.4 release

* 15.9.5 release

* 15.9.6 release

* 16.0.0 release

* Update bug_report.md

* 16.0.2 release

* 16.0.3 release

* 16.1.0 release

* 16.1.2 release

* Update README.md

* 16.1.3 release

* 16.1.4 release

* 16.2.1 release

* 16.2.2 release

* 16.2.3 release

* 16.2.4 release

* Update stale.yml

* 16.2.6 release

* Create bug_report.yaml

* Delete bug_report.md

* Update bug_report.yaml

* Update bug_report.yaml

* Create feature_request.yaml

* Delete feature_request.md

* Update feature_request.yaml

* 16.2.7 release

* Fix incorrect application icon behavior on Linux

Fixes jgraph/drawio-desktop#547. I have tested this change only on Linux+KDE and can confirm it works. Obviously some testing on Mac and Windows would be nice to confirm it doesn't break anything. More details in the linked issue.

* 16.3.0 release

* 16.4.0 release

* 16.4.3 release

* 16.4.5 release

* Bump node-fetch from 3.0.0 to 3.1.1 in /etc/propgen

Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 3.0.0 to 3.1.1.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/main/docs/CHANGELOG.md)
- [Commits](node-fetch/node-fetch@v3.0.0...v3.1.1)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* 16.4.7 release

* 16.4.8 release

* 16.4.11 release

* 16.5.1 release

* 16.5.2 release

* 16.5.3 release

* fix: upgrade electron-updater from 4.3.9 to 4.6.5

Snyk has created this PR to upgrade electron-updater from 4.3.9 to 4.6.5.

See this package in npm:


See this project in Snyk:
https://app.snyk.io/org/davidjgraph/project/b324f40d-74b4-4545-99b2-af8481e33ed3?utm_source=github&utm_medium=referral&page=upgrade-pr

* fix: upgrade electron-log from 4.4.1 to 4.4.4

Snyk has created this PR to upgrade electron-log from 4.4.1 to 4.4.4.

See this package in npm:


See this project in Snyk:
https://app.snyk.io/org/davidjgraph/project/b324f40d-74b4-4545-99b2-af8481e33ed3?utm_source=github&utm_medium=referral&page=upgrade-pr

* 16.5.4 release

* 16.5.6 release

* 16.6.0 release

* 16.6.1 release

* 16.6.2 release

* 16.6.3 release

* 16.6.4 release

* 16.6.5 release

* 16.6.6 release

* 16.6.7 release

* 16.6.8 release

* 17.0.0 release

* 17.1.0 release

* 17.1.1 release

* 17.1.2 release

* 17.1.3 release

* 17.1.3 release

* 17.1.4 release

* 17.1.5 release

* 17.2.1 release

* Fix loading order for javax.cache.CacheManager on App Engine

I was running an drawio fork on app engine and Google Drive integration suddenly started failing with IncompatibleClassChangeError errors. Found https://stackoverflow.com/q/46582783 which fixed it.

We might not 100% need this. This is mostly a heads up if anyone else runs into similar issues.
I'm also not sure if this is easily reproducible on the public App Engine. Following up with GAE to see if this is a bigger issue.

* 17.2.1 release

* Create codeql-analysis.yml

* Create SECURITY.md

* Update SECURITY.md

* Update codeql-analysis.yml

* Update codeql-analysis.yml

* 17.2.2 release

* Update codeql-analysis.yml

* 17.2.3 release

* 17.2.4 release

* 17.2.5 release

* 17.3.0 release

* 17.4.0 release

* 17.4.1 release

* 17.4.2 release

* 17.4.3 release

* 17.4.3 release

* Added java build for codeql

* remove git workflow original repo

Co-authored-by: Dong Nguyen <ndaidong@gmail.com>
Co-authored-by: David Benson [draw.io] <david@jgraph.com>
Co-authored-by: Mate Egri <mate.egri78@gmail.com>
Co-authored-by: David Benson <david@draw.io>
Co-authored-by: Lukasz D <lukasz.dobrogowski@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: David Stephan <stephandavid3@gmail.com>
Co-authored-by: Mohamed Mohamedin <ashraf.teleb85@gmail.com>
rudydelange pushed a commit to rudydelange/draw.io that referenced this issue Jul 19, 2023
Fixes jgraph/drawio-desktop#547. I have tested this change only on Linux+KDE and can confirm it works. Obviously some testing on Mac and Windows would be nice to confirm it doesn't break anything. More details in the linked issue.
eduales99 added a commit to eduales99/Javascript-Drawio that referenced this issue Feb 19, 2024
Fixes jgraph/drawio-desktop#547. I have tested this change only on Linux+KDE and can confirm it works. Obviously some testing on Mac and Windows would be nice to confirm it doesn't break anything. More details in the linked issue.
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