goodsoftworx / calaboka-issues

A place to get help and report issues with Calaboka.
https://snapcraft.io/calaboka
9 stars 0 forks source link

App fails to start due to hard dependency on Gdk.CursorType.HAND2 #3

Closed Cuperino closed 2 years ago

Cuperino commented 2 years ago

Description

App fails to start due to hard dependency on Gdk.CursorType.HAND2.

To reproduce

Steps to follow in order to reproduce the behavior:

  1. Install calaboka on any distro that doesn't come from a GTK base, such as Lubutnu or KDE neon.
  2. Install calaboka snap
  3. Run calaboka. App fails to start and it notifies you of startup error.

Expected behavior

Calaboka to start.

Logs

This is the output I get when starting calaboka from the command line:

/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)

(__main__.py:418525): Gdk-WARNING **: 18:20:00.071: Failed to read portal settings: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Portal operation not allowed: Unable to open /proc/418525/root
2022-03-19 18:20:00,241 calaboka [MainThread] [calaboka.manager.notif.DaemonProxyDesktopNotifier] [DEBUG] Closing active daemon-proxied desktop notifications
2022-03-19 18:20:00,244 calaboka [MainThread] [calaboka.env] [INFO] App environment, name=calaboka, type=MgrAppEnvSnap, version=1.2.0 rev 196, python=3.9.5 (default, Nov 23 2021, 15:27:38)  [GCC 9.3.0]
2022-03-19 18:20:00,345 calaboka [MainThread] [calaboka.manager.theme.mvc.ThemeModel] [INFO] Resetting theme to global
2022-03-19 18:20:00,374 calaboka [MainThread] [calaboka.manager.theme.mvc.ThemeModel] [INFO] Resetting dark mode preference to global
2022-03-19 18:20:00,408 calaboka [MainThread] [calaboka.config] [INFO] Loading configuration from /home/javier/snap/calaboka/196/.config/calaboka/manager.cfg
2022-03-19 18:20:00,408 calaboka [MainThread] [calaboka.config] [WARNING] Config property Theme is not set, using default: 
2022-03-19 18:20:00,408 calaboka [MainThread] [calaboka.config] [WARNING] Config property DarkMode is not set, using default: DarkModeOption.GLOBAL
Gdk-Message: 18:20:00.524: Unable to load hand2 from the cursor theme
2022-03-19 18:20:00,524 calaboka [MainThread] [calaboka.manager.main] [ERROR] An error occurred and the application will be terminated
Traceback (most recent call last):
  File "/snap/calaboka/196/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/snap/calaboka/196/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/snap/calaboka/196/lib/python3.9/site-packages/calaboka/manager/__main__.py", line 8, in <module>
    main()
  File "/snap/calaboka/196/lib/python3.9/site-packages/calaboka/manager/main.py", line 93, in main
    app = ManagerApp(app_env, config, session_bus, desktop_notifier, theme_controller)
  File "/snap/calaboka/196/lib/python3.9/site-packages/calaboka/manager/app.py", line 57, in __init__
    self._window = ManagerAppWindow(self, self._env, theme_controller)
  File "/snap/calaboka/196/lib/python3.9/site-packages/calaboka/manager/app_window.py", line 76, in __init__
    self.logo_img.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.HAND2))
  File "/snap/calaboka/196/gnome-platform/usr/lib/python3/dist-packages/gi/overrides/Gdk.py", line 331, in __new__
    return cls.new(*args, **kwds)
TypeError: constructor returned NULL
2022-03-19 18:20:00,526 calaboka [MainThread] [calaboka.dbus.proxy.DBusObjectProxy] [INFO] Teardown complete: D-Bus obj proxy: svc=com.github.goodsoftworx.calaboka, iface=com.github.goodsoftworx.calaboka.Frontend
2022-03-19 18:20:00,526 calaboka [MainThread] [calaboka.manager.main] [INFO] Teardown complete: Session bus
2022-03-19 18:20:00,526 calaboka [MainThread] [calaboka.manager.main] [INFO] Bye.

Environment

Provide the following information about your environment:

snap    2.54.4
snapd   2.54.4
series  16
neon    20.04
kernel  5.16.13-051613-generic
name:      snapd
summary:   Daemon and tooling that enable snap packages
publisher: Canonical✓
store-url: https://snapcraft.io/snapd
license:   GPL-3.0
description: |
  Install, configure, refresh and remove snap packages. Snaps are
  'universal' packages that work across many different Linux systems,
  enabling secure distribution of the latest apps and utilities for
  cloud, servers, desktops and the internet of things.

  Start with 'snap list' to see installed snaps.
type:         snapd
snap-id:      PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4
tracking:     latest/stable
refresh-date: 4 days ago, at 15:48 AST
channels:
  latest/stable:    2.54.4                  2022-03-15 (15177) 45MB -
  latest/candidate: 2.54.4                  2022-03-10 (15177) 45MB -
  latest/beta:      2.54.4                  2022-03-03 (15177) 45MB -
  latest/edge:      2.54.4+git1242.g7c811be 2022-03-18 (15267) 46MB -
installed:          2.54.4                             (15177) 45MB snapd
---
name:      calaboka
summary:   Ad silencer for Spotify
publisher: goodsoftworx
store-url: https://snapcraft.io/calaboka
contact:   https://github.com/goodsoftworx/calaboka-issues
license:   Proprietary
description: |
  Calaboka connects to your Spotify player to silence ads played between tracks. Its background
  service discreetly monitors Spotify without getting in your way. When an ad starts to play,
  Spotify is muted immediately. When the next track begins, the volume is faded back in. You can
  open the Calaboka app to see what's going on, including how many ads you were spared from.

  Disclaimer: Calaboka cannot mute ads built into a track (such as ads inside a podcast), skip ads,
  nor block visual ads. And it only works with the official Spotify app installed from the Snap
  Store or via the snap command.

  Like Calaboka? Consider donating: https://www.paypal.com/donate?hosted_button_id=VVRR9R68YUWZ6
commands:
  - calaboka
services:
  calaboka.daemon: simple, enabled, inactive
snap-id:      AgGFU6YBGHumzmzhfs4tSXufDCVgD6rs
tracking:     latest/stable
refresh-date: today at 18:15 AST
channels:
  latest/stable:    1.2.0 2022-01-30 (196) 30MB -
  latest/candidate: ↑                           
  latest/beta:      ↑                           
  latest/edge:      1.2.0 2022-01-29 (196) 30MB -
installed:          1.2.0            (196) 30MB -
---
name:      spotify
summary:   Music for everyone
publisher: Spotify✓
store-url: https://snapcraft.io/spotify
contact:   https://community.spotify.com/t5/Desktop-Linux/bd-p/desktop_linux
license:   Proprietary
description: |
  Love music? Play your favorite songs and albums free on Linux with
  Spotify.

  Stream the tracks you love instantly, browse the charts or fire up
  readymade playlists in every genre and mood. Radio plays you great
  song after great song, based on your music taste. Discover new music
  too, with awesome playlists built just for you.

  Stream Spotify free, with occasional ads, or go Premium.

  Free:
  • Play any song, artist, album or playlist instantly
  • Browse hundreds of readymade playlists in every genre and mood
  • Stay on top of the Charts
  • Stream Radio
  • Enjoy podcasts, audiobooks and videos
  • Discover more music with personalized playlists

  Premium:
  • Download tunes and play offline
  • Listen ad-free
  • Get even better sound quality
  • Try it free for 30 days, no strings attached

  Like us on Facebook: http://www.facebook.com/spotify
  Follow us on Twitter: http://twitter.com/spotify

  Note: Spotify for Linux is a labor of love from our engineers that
  wanted to listen to Spotify on their Linux development machines. They
  work on it in their spare time and it is currently not a platform
  that we actively support. The experience may differ from our other
  Spotify Desktop clients, such as Windows and Mac.
snap-id: pOBIoZ2LrCB3rDohMxoYGnbN14EHOgD7
channels:
  latest/stable:    1.1.80.699.gc3dac750 2022-03-03 (58) 177MB -
  latest/candidate: 1.1.80.699.gc3dac750 2022-03-03 (58) 177MB -
  latest/beta:      ↑                                          
  latest/edge:      1.1.80.699.gc3dac750 2022-03-03 (58) 177MB -
Desktop: KDE
Session: wayland
goodsoftworx commented 2 years ago

Thanks for the detailed report! I'll have a look in the next few days.

goodsoftworx commented 2 years ago

I wasn't able to reproduce this issue on KDE Neon Testing, so perhaps something funky is happening when GTK/GDK interfaces with your particular system, vs. mine. After looking at the code, I made some changes and released a new build (see details below).

Background: We set the cursor on the app for when the user hovers over the logo on the main window. However, according to the GDK docs, we weren't setting the cursor in a portable way.

Solution: Changed the code that sets the cursor by following the GDK Cursor docs with respect to portability. I also made sure that, if we can't set the cursor in this case, the app will just log a warning and continue to work. Setting the cursor isn't vital for the app to function.

Give v1.2.1 a try and please report back.

sudo snap refresh calaboka

Cuperino commented 2 years ago

It's working! Thanks for the quick response!

Here are the new terminal outputs, in case they're useful:

/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)

(__main__.py:1021994): Gdk-WARNING **: 22:46:45.448: Failed to read portal settings: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Portal operation not allowed: Unable to open /proc/1021994/root
2022-03-19 22:46:45,632 calaboka [MainThread] [calaboka.manager.notif.DaemonProxyDesktopNotifier] [DEBUG] Closing active daemon-proxied desktop notifications
2022-03-19 22:46:45,635 calaboka [MainThread] [calaboka.env] [INFO] App environment, name=calaboka, type=MgrAppEnvSnap, version=1.2.1 rev 197, python=3.9.5 (default, Nov 23 2021, 15:27:38)  [GCC 9.3.0]
2022-03-19 22:46:45,741 calaboka [MainThread] [calaboka.manager.theme.mvc.ThemeModel] [INFO] Resetting theme to global
2022-03-19 22:46:45,769 calaboka [MainThread] [calaboka.manager.theme.mvc.ThemeModel] [INFO] Resetting dark mode preference to global
2022-03-19 22:46:45,798 calaboka [MainThread] [calaboka.config] [INFO] Loading configuration from /home/javier/snap/calaboka/197/.config/calaboka/manager.cfg
2022-03-19 22:46:45,799 calaboka [MainThread] [calaboka.config] [WARNING] Config property Theme is not set, using default: 
2022-03-19 22:46:45,799 calaboka [MainThread] [calaboka.config] [WARNING] Config property DarkMode is not set, using default: DarkModeOption.GLOBAL
2022-03-19 22:46:45,931 calaboka [MainThread] [calaboka.manager.theme.mvc.ThemeModel] [INFO] Resetting theme to global
2022-03-19 22:46:45,958 calaboka [MainThread] [calaboka.manager.theme.mvc.ThemeController] [INFO] Global theme changed: Sweet-mars-XFCE
2022-03-19 22:46:45,958 calaboka [MainThread] [calaboka.manager.theme.mvc.ThemeController] [WARNING] Theme "Sweet-mars-XFCE" is not supported, falling back to system default theme: Adwaita
2022-03-19 22:46:45,958 calaboka [MainThread] [calaboka.manager.theme.mvc.ThemeModel] [INFO] Setting theme to: Adwaita
2022-03-19 22:46:45,986 calaboka [MainThread] [calaboka.manager.theme.mvc.ThemeModel] [INFO] Resetting dark mode preference to global
2022-03-19 22:46:46,016 calaboka [MainThread] [calaboka.manager.theme.mvc.ThemeController] [INFO] Global dark mode preference changed: True
2022-03-19 22:46:46,016 calaboka [MainThread] [calaboka.manager.app.ManagerApp] [INFO] Daemon status=OFFLINE
2022-03-19 22:46:46,022 calaboka [MainThread] [calaboka.filemon.GioFileMonitor] [INFO] Started file monitor for /var/snap/calaboka/common/snap-changed
2022-03-19 22:46:46,024 calaboka [MainThread] [calaboka.manager.app.ManagerApp] [INFO] Daemon status=ONLINE
2022-03-19 22:46:46,025 calaboka [MainThread] [calaboka.timer.GLibTimer] [INFO] Started timer, name=daemon PropertiesChanged subscriber, id=26, interval_ms=2000
2022-03-19 22:46:46,115 calaboka [MainThread] [calaboka.manager.app.ManagerApp] [INFO] Subscribing to daemon PropertiesChanged events
2022-03-19 22:46:46,117 calaboka [MainThread] [calaboka.manager.app.ManagerApp] [INFO] Ready to receive daemon PropertiesChanged events
2022-03-19 22:46:46,118 calaboka [MainThread] [calaboka.timer.GLibTimer] [INFO] Teardown complete: Timer, name=daemon PropertiesChanged subscriber, id=26
2022-03-19 22:46:46,121 calaboka [MainThread] [calaboka.manager.app.ManagerApp] [INFO] Daemon status=MPRIS_SPOTIFY_SNAP_IFACE_NOT_CONNECTED
goodsoftworx commented 2 years ago

Looks good to me, thank you. I'm closing this issue.

Cuperino commented 2 years ago

Thanks for your support!