subgraph / citadel

Subgraph Citadel image builder
17 stars 14 forks source link

slurp region selection tool cursor theme lookup bug #12

Closed mckinney-subgraph closed 6 years ago

mckinney-subgraph commented 6 years ago

slurp is a tool for selection regions for taking screenshots in Sway. There is currently a problem where slurp cannot load the cursor theme for the crosshair cursor. This will cause slurp to crash:

citadel:~ $ slurp
slurp: ../git/main.c:459: main: Assertion `cursor' failed.
Aborted (core dumped)

Prior to the crash, the following call is made:

wl_cursor_theme_load(NULL, 24 * output->scale, state.shm);

NULL would normally contain the cursor theme name, which falls back to default if not specified. There is no default theme path in Citadel. However, on other systems that lack the default theme path, this call will find the configured theme instead of falling back to the default theme. So it is possible that there is something different in Citadel that is causing the problem -- so I am recording the bug here before taking it to the slurp developer. I don't expect the cursor lookup failure in Wayland will cause problems for other things but it would be cool to make it work for slurp.

Workaround

The workaround is to copy the crosshair cursor to a path that the Wayland cursor theme loading routines expect. The following paths are expected:

/home/citadel/.icons/default/cursors/ /usr/share/icons/default/cursors/ /usr/share/pixmaps/default/cursors/ /home/citadel/.cursors/default/cursors/ /usr/share/cursors/xorg-x11/default/cursors/ /usr/share/icons/default/cursors/

An example of how to do this (note: since /home/citadel is a tmpfs, this will not persist after rebooting):

citadel:~ $ mkdir -p /home/citadel/.icons/default/cursors/
citadel:~ $ cp /usr/share/icons/Paper/cursors/crosshair .icons/default/cursors/
mckinney-subgraph commented 6 years ago

In Debian, the Adwaita theme has a postinst script that will setup /usr/share/icons/default/index.theme with the following contents:

[Icon Theme]
Inherits=Adwaita

Will fix this issue by doing something similar with our Paper icon theme.