Don't scale resolution dependent cursor size twice

Summary:
If the env var is 0 we calculate the cursor size based on the
physical resolution.

The size is multiplied by the output scale.

Either would make sense, together does not and reuslts in kwin
having massive cursors.

This patch is for 5.13.

For master I intend to kill this concept of "resolution dependent size"
on the KCM. We then should do wayland scaling on cursors properly no matter
what size the user selects which will work better for when we have
multiple screens.

I have a WIP patch pending for the latter, but it's too big for here.
It still involves deleting this code.

Reviewers: #plasma, romangg

Reviewed By: #plasma, romangg

Subscribers: romangg, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13267
This commit is contained in:
David Edmundson 2018-06-01 16:28:41 +01:00
parent bed31e0557
commit b300229ca2

View file

@ -63,9 +63,10 @@ void WaylandCursorTheme::loadTheme()
// use sensible default
size = 24;
}
size *= output->scale();
connect(output, &KWayland::Server::OutputInterface::scaleChanged, this, &WaylandCursorTheme::loadTheme, Qt::UniqueConnection);
connect(output, &KWayland::Server::OutputInterface::pixelSizeChanged, this, &WaylandCursorTheme::loadTheme, Qt::UniqueConnection);
connect(output, &KWayland::Server::OutputInterface::physicalSizeChanged, this, &WaylandCursorTheme::loadTheme, Qt::UniqueConnection);
}
auto theme = wl_cursor_theme_load(c->themeName().toUtf8().constData(),
size, m_shm->shm());
if (theme) {