Unify cursor setting
Currently we have multiple places to apply a cursor theme doing different things, all in all it's a mess.
-
startplasma runs
kapplymousetheme
[1] from the mouse kcm [2] which ends up callingX11Backend::applyCursorTheme
-
the kcminit of the mouse kcm calls
X11Backend::applyCursorTheme
as well -
all of this runs only on X11
-
Relevant calls it does
XcursorSetTheme(m_dpy, QFile::encodeName(theme));
XcursorSetDefaultSize(m_dpy, size);
Cursor handle = XcursorLibraryLoadCursor(m_dpy, "left_ptr");
XDefineCursor(m_dpy, DefaultRootWindow(m_dpy), handle);
XFreeCursor(m_dpy, handle);
XFlush(m_dpy);
- at the same time we also have the cursortheme kcm and the tool
plasma-apply-cursortheme
, which boil down toapplyTheme
- What this does is running
krdb
and afterwards callingXFixesChangeCursorByName
for a list of cursor names, the latter is only done on X11 - krdb in turn sets
"Xcursor.theme"
and"Xcursor.size"
resources [4] - this is also run at kcminit time through the style kcm [3]
The end goal should be just one kcminit which does the relevant things and us only having one tool. In my opinion it makes most sense to drop the code from the mouse kcm.
Edited by David Redondo