Mir: Could not find cursor for shape

My snap works fine on X11 and Mir (and UbuntuCore). Though while running on UbuntuCore system the logs continuously print “Could not find cursor for shape” as I move the mouse inside my PySide 2 app. Below is a complete log, those warnings go away if I use desktop-glib-only remote part.

om26er@localhost:~$ sudo xbr-dashboard 
+ grep -q snap_core= /proc/cmdline
+ export QT_QPA_PLATFORM=wayland-egl
+ export XDG_RUNTIME_DIR=/run/user/0/
+ python3 -u /snap/xbr-dashboard/x1/main.py --no-sandbox
Could not load theme "default"
Using Wayland-EGL
libEGL warning: MESA-LOADER: failed to retrieve device information

MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to retrieve device information
WebEngine compiled with X11 support, however qpa backend is not xcb. This may fail.
Could not find cursor for shape 0
Could not find cursor for shape 0
Using the 'xdg-shell-v6' shell integration
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 4
Could not find cursor for shape 4
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 12
Could not find cursor for shape 12
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 12
Could not find cursor for shape 12
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 0
Could not find cursor for shape 12

Surely you’ve answered your own question then, no? If using desktop-glib-only fixes the problem then using desktop-glib-only is the solution.

No, I am changing my app to move away from desktop-glib-only as that’s an overkill for my use case and as I was told by @ogra most of those environment variables set by desktop-glib-only part are redundant in our application that is mainly going to run on UbuntuCore

well, i didnt tell you to drop the world, i only said that you likely wont have the themes, fonts and desktop bits the desktop-glib-only launcher will point to. this log spam looks like you are simply missing one variable and perhaps a related stage package, i’d try to find out which one and just add my own launcher to set the necessary defaults.

i also told you on IRC we should perhaps consider having a derivative launcher for kiosk environments where only bits are pointed to that are actually found on kiosk environments … i.e. kiosk-glib-only as a cut down version of desktop-glib-only that is less bloated (often kiosk systems are on the lower end and resources are limited, there is no need to ship a ton of fonts and icon themes you will not use)

1 Like

btw, here is how my snapcraft.yaml looks like, also those warnings don’t appear while running under Xorg. I do agree there is probably an environment variable missing, I spent quite a few hours trying to debug that last night but no success, will take another stab tonight. I do acknowledge that many of those stage packages are probably not needed.

name: xbr-dashboard
version: '0.2'
summary: XBR Applets Dashboard
description: |
  XBR Applets Dashboard
grade: stable
confinement: strict

apps:
  xbr-dashboard:
    command: start.sh
    environment:
      PYTHONPATH: $SNAP/pyside
      LIBGL_DRIVERS_PATH: $SNAP/usr/lib/x86_64-linux-gnu/dri:/var/lib/snapd/lib/gl/xorg
      XCOMPOSEFILE: $SNAP/usr/share/X11/locale/en_US.UTF-8/Compose
    slots:
      - x11
    plugs:
      - network
      - opengl
      - desktop
      - wayland
      - browser-support
      - x11-plug

parts:
  dashboard:
    plugin: dump
    source: .
    stage:
      - main.py
      - start.sh
      - components/*

  pyside:
    plugin: nil
    override-build: |
      snapcraftctl build
      python3 -m easy_install pip
      mkdir -p ${SNAPCRAFT_PART_INSTALL}/pyside
      pip install --no-cache-dir --index-url=http://download.qt.io/snapshots/ci/pyside/5.11/latest/ pyside2 --trusted-host download.qt.io -t ${SNAPCRAFT_PART_INSTALL}/pyside
      rm -r ${SNAPCRAFT_PART_INSTALL}/pyside/PySide2/examples
    build-packages:
      - python3-setuptools
    stage-packages:
      - libnss3
      - libxcomposite1
      - libxcursor1
      - libxtst6
      - libxrandr2
      - libasound2
      - libglu1-mesa
      - libgles2-mesa
      - fontconfig
      - libxkbcommon0
      - ttf-ubuntu-font-family
      - dmz-cursor-theme
      - light-themes
      - adwaita-icon-theme
      - gnome-themes-standard
      - shared-mime-info
      - libgdk-pixbuf2.0-0
      - locales-all
      - libxslt1.1
      - fonts-dejavu-core
      - xfonts-base
      - xfonts-scalable
    after:
      - dashboard

plugs:
  x11-plug:
    interface: x11

passthrough:
  layout:
    /usr/share/fonts:
      bind: $SNAP/usr/share/fonts
    /etc/fonts:
      bind: $SNAP/etc/fonts