Bug 498084 - The mouse cursor size is tiny on high DPI screens
Summary: The mouse cursor size is tiny on high DPI screens
Status: REPORTED
Alias: None
Product: digikam
Classification: Applications
Component: Usability-Mouse (show other bugs)
Version: 8.5.0
Platform: Mint (Ubuntu based) Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-31 12:42 UTC by Erwin
Modified: 2025-01-04 20:22 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Native OS cursor (190.47 KB, image/png)
2024-12-31 12:42 UTC, Erwin
Details
Cursor when over app window (188.83 KB, image/png)
2024-12-31 12:43 UTC, Erwin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Erwin 2024-12-31 12:42:40 UTC
Created attachment 176990 [details]
Native OS cursor

SUMMARY
The mouse cursor size is microscopically small with high DPI screens (3664x2290). When moving the mouse cursor (pointer) from OS desktop over the app windows the them and size changes.
This happens with both flatpak and the official AppImage (Qt6). Found the Qt5 version of AppImage and with this one the problem does not happen; the cursor theme stays the same and the size only marginally shrinks.
It seems that this is a Qt6 related problem. Maybe the right configuration was not applied at switching from Qt5 to Qt6 or it needs something extra.

STEPS TO REPRODUCE
1. Use a high DPI screen
2. Use the official version 8.5.0 using Qt6
3. Move mouse pointer over app window

OBSERVED RESULT
Mouse cursor size is very small when positioned over application window.

EXPECTED RESULT
Mouse cursor size should take into account the DPI of the screen and should not deviate too much from the size when it is positions over the any native OS window.


SOFTWARE/OS VERSIONS
Linux Mint 21.3 Cinnamon
digiKam 8.5.0 flatpak or official AppImage
Qt Version: 6

ADDITIONAL INFORMATION
Comment 1 Erwin 2024-12-31 12:43:55 UTC
Created attachment 176991 [details]
Cursor when over app window
Comment 2 Maik Qualmann 2024-12-31 13:25:52 UTC
I had already read your post in the mailing list and played with the XCURSOR ENV variable, I can create a larger cursor for digiKam here under openSUSE KF6 without any problems. Here with a native digiKam version there are no problems with the cursor, within digiKam we don't change anything about the cursor. I suspect that there are still missing adaptations to Qt6 apps within GTK Desktops, since the problem has also been reported for VLC, for example.

I can try setting the ENV variable within digiKam, we can create a setting for this in the digiKam system settings.

Have you ever tried setting the XCURSOR within the command line?

XCURSOR_SIZE=24 digikam

Maik
Comment 3 Maik Qualmann 2024-12-31 13:56:10 UTC
Git commit e29c13d622b2625d84a145568fa557f6a44be01f by Maik Qualmann.
Committed on 31/12/2024 at 13:55.
Pushed by mqualmann into branch 'master'.

only for testing, set XCURSOR_SIZE to 30 in the AppImage bundle

M  +7    -0    core/app/main/main.cpp

https://invent.kde.org/graphics/digikam/-/commit/e29c13d622b2625d84a145568fa557f6a44be01f
Comment 4 Erwin 2024-12-31 14:56:34 UTC
(In reply to Maik Qualmann from comment #2)
> I had already read your post in the mailing list and played with the XCURSOR
> ENV variable, I can create a larger cursor for digiKam here under openSUSE
> KF6 without any problems. Here with a native digiKam version there are no
> problems with the cursor, within digiKam we don't change anything about the
> cursor. I suspect that there are still missing adaptations to Qt6 apps
> within GTK Desktops, since the problem has also been reported for VLC, for
> example.
> 
> I can try setting the ENV variable within digiKam, we can create a setting
> for this in the digiKam system settings.
> 
> Have you ever tried setting the XCURSOR within the command line?
> 
> XCURSOR_SIZE=24 digikam
> 
> Maik

I don't have a native build installed. I use the Flatpak (or the AppImage) and I don't think I can define that via the command line as those packages are containers, right?
Actually, I had the XCURSOR_SIZE=48 added as an env variable in Flatseal as a fix when I first installed the package long time ago and it has worked until the last digiKam flatseal package update recently. Now it has no effect any more; can't figure out why.
Maybe short term solution for me could be building it natively, but i have no experience in that.
Comment 5 caulier.gilles 2024-12-31 15:11:52 UTC
For the FlatPak i don't know, but for the AppImage it's easy.

AppImage is an auto-decompress in memory container in ISO9660 format, and there is an option to extract the contents locally:

https://superuser.com/questions/1301583/how-can-i-extract-files-from-an-appimage

Note: The appimage file is an executable which can take arguments...

When content is extracted, the AppImage executable is a bash script named AppRun, that you can tune to experiment:

https://invent.kde.org/graphics/digikam/-/blob/master/project/bundles/appimage/data/AppRun?ref_type=heads

To run the extracted AppImage contents locally, like the bundle, just run the patched AppRun as well.

That all.

Gilles Caulier
Comment 6 Maik Qualmann 2024-12-31 21:46:14 UTC
Setting the XCURSOR environment variable actually has no effect in the AppImage.

Maik
Comment 7 Maik Qualmann 2025-01-01 12:32:18 UTC
Ok, I think I found the solution.
There must be a default cursor theme installed under "~/.icons/default".
To do this, I copied the contents of /usr/share/icons/breeze_cursors/*" to "~/.icons/default/".
Now the AppImage has the same cursor as the rest of the desktop and also scales with the size.

Maik
Comment 8 caulier.gilles 2025-01-01 12:47:41 UTC
Do we need to push this cursor theme in the AppImage hierarchy, perhaps with a env. variable set?
Comment 9 Maik Qualmann 2025-01-01 12:54:56 UTC
I tried that, but I can test it again, it didn't work. Here too, under openSUSE, the mouse pointer changes over the AppImage, presumably it is the standard X cursor. Only with a cursor theme in "~/.icons/default" is this used as a cursor over the AppImage. I suspect that it is a window manager thing.

Maik
Comment 10 caulier.gilles 2025-01-01 13:02:40 UTC
The Kdenlive Qt6 AppImage has the same problem ?

https://kdenlive.org/en/download/

Gilles
Comment 11 Maik Qualmann 2025-01-01 13:20:04 UTC
OK, Kdenlive doesn't have the problem because it installed the "breeze_cursors" folder in the AppImage under "usr/share/icons". So we can do that too.
The only problem is if the user prefers a different cursor theme across the desktop.

Maik
Comment 12 Erwin 2025-01-04 20:22:16 UTC
Right. My ~/.icons folder contains nothing. If i copy my desktop cursor theme from /usr/share/icons/Bibata-Modern-Classic to ~/.icons/default then both the AppImage and the Flatpack version finally take my cursor theme. And I am able to control the size by setting XCURSOR_SIZE.
It seems it is ignoring cursor theme setting (though I have XCURSOR_THEME=Bibata-Modern-Classic set in Flatseal) and is always looking for a 'default' folder and if it does not find the cursor there it just reverts back to a build in default style and size and ignores XCURSOR_SIZE.

BTW, I also ran KDE neon from a live USB to see how it behaves. Since digiKam is KDE app with Qt6, I thought that it might not happen there. But the AppImage had the same effect, too small cursor size. Then I installed the flatpack from the repo (8.5.0 using Qt6.8.1) and the cursor theme and size was correct. Weird. Though this runs on Wayland; maybe that has an effect.