michaldaniel / ebook-viewer

Modern GTK Python Ebook Reader app to easily read epub files
GNU General Public License v3.0
406 stars 47 forks source link

Desktop file is not associated in GNOME wayland session #19

Closed dyskette closed 7 years ago

dyskette commented 7 years ago

Opening it in a GNOME wayland session just shows an "unknown" icon and "main.py" as label in the task switcher.

captura de pantalla de 2016-12-08 10-14-54

This is GNOME 3.22 on Fedora 25.

michaldaniel commented 7 years ago

I cannot test this under wayland session. I don't have wayland installation and Virtual Box driver doesn't support wayland. But it DOES work under Gnome's x-session.

  1. Can you check if it wasn't failing icon cache update, related to this commit: https://github.com/michaldaniel/Ebook-Viewer/commit/787328543b514b8682dccaff0aa50239f34d6b4b (update & reinstall or perform icon update yourself)
  2. I set win.set_wmclass(_("Easy eBook Viewer"), _("Easy eBook Viewer") in main.py, that should be respected by GNOME, I'm not sure why it wouldn't.
  3. How are you launching app?
  4. How did you install it? Did you execute make script or just made own desktop file / launched main.py with python?

Ubuntu GNOME 16.10, GNOME 3.20. zrzut ekranu z 2016-12-08 22 30 23

But I also tested on Gnome 3.22 some time ago, I just did a test for any regressions. If it's wayland related I might need some help.

dyskette commented 7 years ago

It works under X. Sorry for not stating that in the first comment.

  1. I updated the icon cache manually right now just in case, log out and in, still the same. Did it with gtk-update-icon-cache instead, because update-icon-caches doesn't exist in Fedora.

  2. Probably that python thing does something directly with X and Wayland is not aware of it.

  3. I'm launching it from a .desktop file in /usr/share/applications/easy-ebook-viewer.desktop.

  4. Installed with an rpm package I did myself. The .spec file does execute the make script and install the .desktop file included in the repo.

I just updated to the latest commit, and the issue persists.

Edit: Probably this?

michaldaniel commented 7 years ago

Thanks for the info. I have few ideas but until I can get my hands on wayland install I won't be able to do much. As far as setting wm_class goes documentation can say whatever it wants but it was how I solved this issue for GNOME (under X server) in the first place. Try to edit src/main.py and remove that line, see if it helps.

The only other idea I have is that I'm just showing Gtk.ApplicationWindow and not making Gtk.Application object where you normally pass application_id to constructor. It really shouldn't matter but hey, that is the only thing I know that the app doesn't do by the book. I should change that anyway so I might as well do it blindly hoping it might solve this by some chance. Expect update tomorrow or day after.

michaldaniel commented 7 years ago

Please tell me if that changes anything. I'm bit busy right now but I can try more things in few hours.

rafaelmardojai commented 7 years ago

Error persists: (GNOME 3.22 on Fedora 25 with Wayland)

Edit: Maybe is a GDK issue.

michaldaniel commented 7 years ago

Maybe is a GDK issue.

Might be. What I'm really surprised about is that even your doc doesn't display icon properly. Gnome top bar integration is one thing but displaying icon specified with launched desktop file exec cmd should be no brainier really. Like the hell?

dyskette commented 7 years ago

I found something.

The bug report has a lot of discussion around it.

michaldaniel commented 7 years ago

Perfect find. Update will be out tonight.

michaldaniel commented 7 years ago

I hope this is it. Can you confirm?

dyskette commented 7 years ago

No. Still the same. I have read the bug report comments but in the end they made this change It seems that the mailing list thread I posted earlier was created before this commit.

Also, they pointed to this wiki article.

rafaelmardojai commented 7 years ago

I noticed this error in the command line: (main.py:7885): GLib-GIO-CRITICAL **: g_application_set_application_id: assertion 'application_id == NULL || g_application_id_is_valid (application_id)' failed

dyskette commented 7 years ago

Can confirm, #21 works on Wayland and X. Commits 72850eb and 7a64c63 can be reverted and the .desktop file is still associated.

michaldaniel commented 7 years ago

@mardojai Good job.

I'll see about those commits as there still seems to be some merit in those changes.

jtojnar commented 6 years ago

Setting application_id or prgname should be enough to be paired with the desktop file. And gtk_window_set_wmclass is deprecated anyway.