Bug 273744 - sysutils/xfce4-settings: cursor themes being listed twice
Summary: sysutils/xfce4-settings: cursor themes being listed twice
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-xfce (Nobody)
URL:
Keywords:
Depends on: 273806
Blocks:
  Show dependency treegraph
 
Reported: 2023-09-12 13:44 UTC by Anton Saietskii
Modified: 2023-09-25 13:13 UTC (History)
1 user (show)

See Also:
madpilot: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Saietskii 2023-09-12 13:44:45 UTC
When opening Mouse and Touchpad settings, I can see Adwaita cursor theme twice on Theme tab: https://imgur.com/RmhBYef.png
If I select first entry, close settings and open again — 2nd entry being selected, so it appears theme is really same, just got duplicated somehow. I didn't do anything directly with any Adwaita packages — just got x11-themes/adwaita-icon-theme pulled by xfce meta-package.
Comment 1 Guido Falsi freebsd_committer freebsd_triage 2023-09-12 13:58:34 UTC
I actually have all the cursor themes appearing twice here. Looks like an upstream bug.

I did notice it but never really minded.

I actually have no idea where xfce reads that list of entries.

This requires investigation, I can try to find time for this, but I can't consider this high priority.
Comment 2 Anton Saietskii 2023-09-12 14:09:31 UTC
Agree it's low priority — purely a cosmetic thing and doesn't break actual operation.
I don't remember if it was there... say, 5 years ago. But now it looks like something that I want to fix, so I'll try to find time for investigation too.
Comment 3 Guido Falsi freebsd_committer freebsd_triage 2023-09-12 15:04:53 UTC
(In reply to Anton Saietskii from comment #2)

First thing that is needed to get some insight is where/how (which api) the mouse settings program gets the list of available themes from. It is even possible the issue is there.
Comment 4 Guido Falsi freebsd_committer freebsd_triage 2023-09-14 21:22:46 UTC
Hi,

I had some spare time and had a look. I did discover something, and a simple workaround that is not a solution but is a little proof I'm on to something.

xfce4-mouse-settings looks up the themes in the filesystem, based on a search path, that by default contains multiple, colon separated paths.

It gets the path via XcursorLibraryPath() provided by x11/libXcursor.

This library function returns the path provided by the XCURSOR_PATH env variable or, if undefined, a default compiled in path.

If I run:

env XCURSOR_PATH=/usr/local/share/icons xfce4-mouse-settings

forcing a single directory search path, there are no duplicates.

So, for some reason, the default value returned by libXcursor has some duplicate path, and xfce4-mouse-settings ends up finding duplicated.

Ti investigate more I need to patch xfce components and add some printf functions around to see what is happening behind the scenes.
Comment 5 Guido Falsi freebsd_committer freebsd_triage 2023-09-14 21:30:32 UTC
And looking at a build log for libXcursor from my poudriere machine I find this passed to the compiler:

-DICONDIR=\"/usr/local/share/icons\"  -DXCURSORPATH=\"~/.local/share/icons:~/.icons:/usr/local/share/icons:/usr/local/share/pixmaps:/usr/local/share/icons\"

so, yes, the path is duplicated and this explains everything.

At this point maybe xfce4-mouse-settings needs to be fixed to try to skip duplicates, but that's not so easy to do.

I'm quite sure it would be good to fix libXcursor to avoid compiling a default containing duplicates.
Comment 6 Anton Saietskii 2023-09-15 09:44:05 UTC
(In reply to Guido Falsi from comment #4)

Thanks for digging into. I can confirm this — running xfce4-mouse-settings with triple path in XCURSOR_PATH results theme being listed thrice.
Comment 7 commit-hook freebsd_committer freebsd_triage 2023-09-25 13:08:34 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ffd7b6bd590ff4552e1f04c8004c723e296b669a

commit ffd7b6bd590ff4552e1f04c8004c723e296b669a
Author:     Guido Falsi <madpilot@FreeBSD.org>
AuthorDate: 2023-09-25 13:06:43 +0000
Commit:     Guido Falsi <madpilot@FreeBSD.org>
CommitDate: 2023-09-25 13:06:43 +0000

    x11/libXcursor: Avoid duplicates in cursor search path

    The cursor search path extrapolated by the configure script contains
    duplicated paths. Work around this by providing the full correct
    search path to configure via --with-cursorpath

    PR:             273806, 273744
    Reviewed by:    arrowd
    Approved by:    x11 (manu)

 x11/libXcursor/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Comment 8 Guido Falsi freebsd_committer freebsd_triage 2023-09-25 13:13:52 UTC
Patch to libXcursor committed.

The issue should disappear as soon as the new version of the pkg is installed on a system.

Thanks again for reporting this!