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

Tray Icon & Title Missing #1442

Closed
andersonjwan opened this issue Aug 23, 2019 · 25 comments
Closed

Tray Icon & Title Missing #1442

andersonjwan opened this issue Aug 23, 2019 · 25 comments
Labels
bug Dependency Issue The issue is within a dependency and cannot be solved by us.

Comments

@andersonjwan
Copy link

Affects versions :

  • OS: [Linux - Fedora: 5.2.8-200.fc30.x86_64]
  • Version of Xournal++ [v1.0.13, Built on Aug 23, 2019]

Describe the bug
Starting a new instance of Xournal++ works as intended; however, in the GNOME taskbar, the tray icon and name is missing. The results are shown in the screenshots below.

To Reproduce
Steps to reproduce the behavior:

  1. Install all required Fedora dependencies as listed.
  2. Clone the repository.
  3. Compile.
  4. Install system-wide from build directory directly.

Expected behavior
The tray icon is expected to be on the left of the title. The title should be 'Xournal++' and not 'xournalpp'.

Screenshots of Problem
image
image

Additional context
Xournal++ does show up in the Activities bar, so it must be just a tray icon issue of finding the title and image. Also, please disregard the date of the second screenshot - this was done on a snapshot of a VM. It was indeed built on Aug 23, 2019.

If this is a duplicate issue, please let me know. I can take this down if it has been patched, but not pushed.

@Technius
Copy link
Member

Technius commented Aug 24, 2019

In #1414, we changed the name of the xournalpp desktop and icon files to com.github.xournalpp.xournalpp. If you "installed" xournalpp instead of using a tarball release, you will need to "reinstall" these files by renaming them (you could also delete them and run the install command again).

For reference, here are the files that need to be renamed (replace xournalpp with com.github.xournalpp.xournalpp):

${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps/xournalpp.svg
${CMAKE_INSTALL_PREFIX}/share/mime/packages/xournalpp.xml
${CMAKE_INSTALL_PREFIX}/share/applications/xournalpp.desktop
${CMAKE_INSTALL_PREFIX}/share/thumbnailers/xournalpp.thumbnailer
${CMAKE_INSTALL_PREFIX}/share/metainfo/xournalpp.appdata.xml

Edit: you also need to edit the xournalpp.desktop file and change the line containing Icon=xournalpp to Icon=com.github.xournalpp.xournalpp. (If you do not do this, the icon will not load properly, even if you install the new desktop file without deleting the previous one!)

You may also need to run the cmake/postinst script in your build directory afterwards.

@andersonjwan
Copy link
Author

andersonjwan commented Aug 24, 2019

I completed a fresh installation from scratch as done before with a DE that has never had Xournal++ installed, and I do indeed see these specific file names updated in the installation output as shown below. Additionally, I verified that the files in each location were renamed and this also was true; however, the issue still persists.

-- Installing: /usr/local/share/icons/hicolor/scalable/apps/com.github.xournalpp.xournalpp.svg
-- Installing: /usr/local/share/mime/packages/com.github.xournalpp.xournalpp.xml
-- Installing: /usr/local/share/applications/com.github.xournalpp.xournalpp.desktop
-- Installing: /usr/local/share/thumbnailers/com.github.xournalpp.xournalpp.thumbnailer
-- Installing: /usr/local/share/metainfo/com.github.xournalpp.xournalpp.appdata.xml

I also ran sudo ./cmake/postinst configure and was returned with:
gtk-update-icon-cache: Cache file created successfully.

When Xournal++ is first started, the tray icon and title both appear with the rotating circling to indicate it's loading, but once it finishes loading and is ready, the resulting image appears as screenshotted in the initial post.

@Technius Technius added this to the v1.0.14 milestone Aug 25, 2019
@Technius
Copy link
Member

If you have an old desktop file lying around, it might be confusing the DE into using the wrong icon path (at least from what I've tested); please also see my edit to my previous comment. I'll try testing on a machine with no Xournal++ installation tomorrow if deleting the old desktop files doesn't fix the issue.

@andersonjwan
Copy link
Author

andersonjwan commented Aug 25, 2019

I think I have fixed it actually! Thanks to your help, I went into my applications folder located under usr/local/share/applications and noticed the file was actually labeled com.github.xournalpp.xournalpp.desktop; and so, simply renaming the file to xournalpp.desktop corrected the problem! I'm not too sure why the desktop file was built with that name, but using the original name fixed the problem, and the tray icon and title are correctly showing up! I'm not too sure on how to exactly fix the problem, but I definitely think the source has been identified.

@lehmanju
Copy link
Collaborator

The file name is intended as this is a naming convention used by Gnome and KDE. However, the same issue appears when running NextcloudClient. Might be a Gnome issue.

@lehmanju
Copy link
Collaborator

diff --git a/desktop/com.github.xournalpp.xournalpp.appdata.xml b/desktop/com.github.xournalpp.xournalpp.appdata.xml
index fb0d4c2b..60ee9622 100644
--- a/desktop/com.github.xournalpp.xournalpp.appdata.xml
+++ b/desktop/com.github.xournalpp.xournalpp.appdata.xml
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright 2019 Tobias Mueller <tobiasmue@gnome.org>  -->
 <component type="desktop">
-  <id>com.github.xournalpp.xournalpp</id>
+  <id>com.github.xournalpp.xournalpp.desktop</id>
   <translation type="gettext">xournalpp</translation>
   <name>Xournal++</name>
   <summary>Take handwritten notes</summary>
@@ -63,9 +62,8 @@
       <image>https://i.imgur.com/3uxu40d.png</image>
     </screenshot>
   </screenshots>
-  <launchable type="desktop-id">com.github.xournalpp.xournalpp.desktop</launchable>
   <provides>
-    <id>xournalpp.desktop</id>
+    <binary>xournalpp</binary>
   </provides>
   <update_contact>webmaster_AT_huberulrich.de</update_contact>
   <content_rating type="oars-1.0"/>
diff --git a/desktop/com.github.xournalpp.xournalpp.desktop b/desktop/com.github.xournalpp.xournalpp.desktop
index 95de8678..95d071c8 100644
--- a/desktop/com.github.xournalpp.xournalpp.desktop
+++ b/desktop/com.github.xournalpp.xournalpp.desktop
@@ -1,7 +1,6 @@
 [Desktop Entry]
 Encoding=UTF-8
 Type=Application
-
 Name=Xournal++
 Comment=Take handwritten notes
 Name[fr]=Xournal++
@@ -18,10 +17,9 @@ Name[zh_CN]=Xournal++
 Comment[zh_CN]=手写注释工具,可为PDF文件添加各种元素的注释标记
 Name[ru]=Xournal++
 Comment[ru]=Делайте рукописные заметки
-
 Exec=xournalpp %f
+Icon=com.github.xournalpp.xournalpp
 Terminal=false
 StartupNotify=true
 MimeType=application/x-xoj;application/x-xojpp;application/x-xopp;application/x-xopt;application/pdf;
-Icon=com.github.xournalpp.xournalpp
 Categories=Office;GNOME;GTK;

This at least fixed the missing icon on dashboard.

@TheAssassin
Copy link
Contributor

A bit off topic, but I've been looking into this as well. I use the AppImage, and despite the files being installed correctly by our integration code:

> xdg-mime query default application/x-xopp
appimagekit_43c5a5d0157a403ad0fe630d1bdd4b80-Xournal++.desktop

I'm still trying to find out why Xfce doesn't make use of this. file --mime and xdg-mime query filetype some.xopp both yield application/gzip. I've updated the local MIME db, then it worked, so I guess we need to that command upon integration.

Anyway, I'd like to suggest adding some proprietary magic bytes. If you look at the file header, there's some blank bytes that might be used:

> hexdump -Cv some.xopp | head -n1
00000000  1f 8b 08 00 00 00 00 00  00 03 bc bd 6b 53 1d bb  |............kS..|

There's the standard magic bytes for gzip, 0x1f, 0x8b, 0x08. As you can see, there's a lot of null bytes where you might embed a custom string that will clearly mark files as Xournal++ files:

> echo -ne 'xopp' | dd of=test.xopp bs=1 count=4 seek=4 conv=notrunc
4+0 records in
4+0 records out
4 bytes copied, 0.000208423 s, 19.2 kB/s
> hexdump -Cv test.xopp | head -n1
00000000  1f 8b 08 00 78 6f 70 70  00 03 bc bd 6b 53 1d bb  |....xopp....kS..|

Works fine, and is much more robust than just file extension guessing. And it's really easy to note this down in your MIME definition.

@lehmanju
Copy link
Collaborator

@muelli this has been introduced after your commit (f7248ab), do you have any ideas?

@muelli
Copy link
Contributor

muelli commented Sep 2, 2019

hm. looks like a severe bug.
But I can't reproduce.

This is what it looks for me:

image

image

I have used this to test: flatpak install https://dl.flathub.org/build-repo/7039/com.github.xournalpp.xournalpp.flatpakref.
I don't have xournalpp installed otherwise.

The patch in #1442 (comment) looks entirely wrong.

Replying to #1442 (comment)
@andersonjwan can you install to /usr/ rather than /usr/local?
Can you try the flatpak to see whether it works for you?

@muelli
Copy link
Contributor

muelli commented Sep 2, 2019

I have used this to test: flatpak install https://dl.flathub.org/build-repo/7039/com.github.xournalpp.xournalpp.flatpakref.

I should have added that this is based on flathub/com.github.xournalpp.xournalpp@dd8bb37 which in turn builds 7a728c6 which hopefully has all the suspected changes incorporated.

@TheAssassin
Copy link
Contributor

Has anyone tried to appstreamcli validate <myfile>? Seems fine to me...

@Technius
Copy link
Member

Technius commented Sep 6, 2019

@TheAssassin The appdata file on master (6260dba) fails to validate for me:

$ appstream-util validate desktop/com.github.xournalpp.xournalpp.appdata.xml 
desktop/com.github.xournalpp.xournalpp.appdata.xml: FAILED:
• markup-invalid        : <id> does not have correct extension for kind
Validation of files failed

#1452 updates the appdata file and should fix the validation problem. I'll need to test a further to see if the PR can also fix this issue.

@muelli
Copy link
Contributor

muelli commented Sep 6, 2019

FWIW: The validation for flathub works fine:

$ flatpak run org.freedesktop.appstream-glib validate desktop/*.appdata.xml
desktop/com.github.xournalpp.xournalpp.appdata.xml: O
$ flatpak run org.freedesktop.appstream-glib --version
Version:	0.7.16
$

A locally installed version is also fine with the file as is:

$ appstream-util  validate desktop/*.appdata.xml
desktop/com.github.xournalpp.xournalpp.appdata.xml: OK
$ appstream-util --version
Version:	0.7.7
$

For completeness, this is the file I am validating:

35684af452ecad3e997dd57e4770e438e58a2355893bb188fc8fb6e896c33d59  desktop/com.github.xournalpp.xournalpp.appdata.xml

@Technius

This comment has been minimized.

@TheAssassin

This comment has been minimized.

@muelli

This comment has been minimized.

@ximion

This comment has been minimized.

@TheAssassin

This comment has been minimized.

@ximion

This comment has been minimized.

@TheAssassin

This comment has been minimized.

@ximion

This comment has been minimized.

@LittleHuba
Copy link
Member

Okay this discussion went way off-topic...
So to sumarize the current state of the issue:

  • Renaming the desktop file to the old name fixes the icon not showing up but we actually want to use the new name -> We need to try to find out why the new name is not accepted by the DE and how to make it accept the change
  • We should use magic bytes for the filetype -> Please create a new issue for that @TheAssassin
  • Appstream messes up the validation of our appdata file -> Create a new issue where we can discuss the steps we will take @TheAssassin

@lehmanju lehmanju added Dependency Issue The issue is within a dependency and cannot be solved by us. and removed priority::high labels Sep 20, 2019
@lehmanju
Copy link
Collaborator

This only happens on GNOME/Wayland. Icon shows fine on GNOME/Xorg, KDE, etc.

(As the Nextcloud client application had the same issue I tested it with all WMs as well and it shows the same behavior.)

@lehmanju lehmanju removed this from the v1.0.14 milestone Sep 20, 2019
@Technius
Copy link
Member

Technius commented Sep 20, 2019

Do you know the cause? And does the workaround here (make uninstall with older version) work?

Edit: can confirm that the issue occurs on GNOME/Wayland and not with GNOME/Xorg. Tested on Debian testing with GNOME shell 3.30.

@lehmanju
Copy link
Collaborator

This has been fixed in Nextcloud now nextcloud/desktop#1449

wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this issue Oct 27, 2019
pkgsrc changes:
 - depend on audio/portaudio instead of audio/portaudio-devel
 - add patches for smooth curves and device manager (from wip/xournalpp-git)

= Changelog

== 1.0.15

**Attention**: Please see the 1.0.14 patch notes before installing this version.

* Fixed an issue where copying and pasting strokes would crash the program.

== 1.0.14

**Attention:** users who installed with `make install` will need to follow
special instructions to update. See the "Breaking change" below.

We now officially support packaging Xournal++ using CMake. This allows users to
generate DEB and tar packages. See `readme/linux.md` for more details.

* **Breaking change**: the desktop and icon files were renamed from `xournalpp`
  to `com.github.xournalpp.xournalpp` to be more in line with the AppStream
  specification. This change should only affect users that install with `make
  install`; these users must run `make uninstall` with a cloned version of
  _Xournal++ 1.0.12_ first. We recommend migrating to another installation
  format, such as Flatpak, AppImage, or tarball. Refer to [this
  issue](xournalpp/xournalpp#1442 (comment))
  for more details on how to uninstall if `make uninstall` is unavailable. Refer
  to `readme/LinuxBuild.md` for build instructions.
* Text field
    * (New input system) double/triple text selection in text fields
    * Fixed issue with cursor not showing on mouse movement after typing into
      text field
    * Fixed text not rendering correctly when used with highlighter and
      non-white backgrounds
* Latex tool
    * Now warns users if latex dependencies are missing
    * Newly created objects are now placed in the center of the screen or page
* Image tool
    * Images are now selected by default on insertion
    * Fixed memory leak
    * Fixed an issue where pasted images were zoomed in and ignoring DPI settings
* Quality-of-life changes
    * Improved copy-paste behavior
    * Improved audio recording quality and stability
    * Enable Enter/Shift+Enter to advance search bar
    * Enabled left and right arrow keys to change pages in presentation mode
    * Xournal++ icon is now rendered in thumbnails of Xournal++ files
    * Renamed "Thin" thickness to "Fine"; Added "Very Fine" and "Very Thick"
      thicknesses
    * Added a right-click context menu to the page preview sidebar
* (Experimental) Floating toolbox
    * Can be enabled in preferences by mapping mouse/stylus buttons to Floating Toolbox
    * To use it, create a new custom toolbar in `View > Toolbars > Manage`.
      Switch to the new toolbar, then choose `View > Toolbars > Customize`. Drag
      the desired tools into the floating toolbox (currently, tools may only
      be placed on exactly one of toolbar or the floating toolbox, but not both)
    * This feature is still a work-in-progress and may contain bugs
* Input
    * Improved input detection
    * Added option to (forcefully) assign input classes to devices
    * Fixed Select Object sometimes failing to select overlapping objects
    * (New input system) Fixed pressure sensitivity only changing after program restart
* Preferences window
    * Redesigned layout of the preferences windows
    * Renamed and enhanced tap select/quick select options
* Major bug fixes
    * Fixed some performance issues causing pages to flash
    * Fixed an issue where discarding changes to current file and then selecting
      "Cancel" in the file open dialog caused subsequent saves to fail
    * Fixed an issue where pressing "Cancel" in the export dialog could cause
      the application to crash
    * Fixed a bug introduced in 1.0.12 where "Open File" could crash the
      application on some systems
* Refactoring and other non-user visible changes
* Other misc features and bugfixes
    * Added appdata file
    * Added ability to customize UI styles using CSS
    * Added option to disable scrollbar fade
    * Allow `*.pdf.xopp` filenames. Any file whose name follows the format
      `$filename.pdf.xopp` will be exported as `$filename.pdf`.
    * Added ability for installation to be relocatable
    * Updated translations
    * Updated dependency information for DEB packages
    * Improved file size by reducing stroke coordinate precision
    * Fixed an issue where last eraser thickness settings were not being remembered
    * Fixed pen strokes not appearing after searching
    * Fixed user-defined toolbar shrinking in size after customizing
    * Fixed scrollbar issues caused by window resizes
    * (Windows) Fixed the User Guide webpage not opening (the `Help > Help` menu
      option)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Dependency Issue The issue is within a dependency and cannot be solved by us.
Projects
None yet
Development

No branches or pull requests

7 participants