From b300229ca2559eead92e887d1cf08a48932a75c5 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Fri, 1 Jun 2018 16:28:41 +0100 Subject: [PATCH] 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 --- wayland_cursor_theme.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wayland_cursor_theme.cpp b/wayland_cursor_theme.cpp index d8dcc3c803..c2f92367e9 100644 --- a/wayland_cursor_theme.cpp +++ b/wayland_cursor_theme.cpp @@ -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) {