Clear cursor cache on theme changes

The WaylandCursorTheme emits a signal whenever it reloads the theme.
This is used by CursorImage to clear the cache and reload decoration
and fallback cursor.
This commit is contained in:
Martin Gräßlin 2016-02-23 13:12:29 +01:00
parent a029300ce5
commit 2292e87b35
3 changed files with 14 additions and 0 deletions

View file

@ -509,6 +509,16 @@ CursorImage::CursorImage(PointerInputRedirection *parent)
connect(ScreenLocker::KSldApp::self(), &ScreenLocker::KSldApp::lockStateChanged, this, &CursorImage::reevaluteSource);
connect(m_pointer, &PointerInputRedirection::decorationChanged, this, &CursorImage::updateDecoration);
loadThemeCursor(Qt::ArrowCursor, &m_fallbackCursor);
if (m_cursorTheme) {
connect(m_cursorTheme, &WaylandCursorTheme::themeChanged, this,
[this] {
m_cursors.clear();
loadThemeCursor(Qt::ArrowCursor, &m_fallbackCursor);
updateDecorationCursor();
// TODO: update effects
}
);
}
m_surfaceRenderedTimer.start();
}

View file

@ -67,6 +67,7 @@ void WaylandCursorTheme::loadTheme()
}
m_theme = wl_cursor_theme_load(c->themeName().toUtf8().constData(),
size, m_shm->shm());
emit themeChanged();
}
void WaylandCursorTheme::destroyTheme()

View file

@ -47,6 +47,9 @@ public:
wl_cursor_image *get(Qt::CursorShape shape);
Q_SIGNALS:
void themeChanged();
private:
void loadTheme();
void destroyTheme();