Skip to content

Commit

Permalink
Windows: Handle theme switching correctly if a palette is set
Browse files Browse the repository at this point in the history
If a palette is set on the application object and the user does
something to trigger a theme change, i.e. connects via remote desktop
or logs out and in again, then it will cause Qt to render incorrectly.
Therefore we should only update the palette from the new theme if we
don't have our own already set.

Task-number: QTBUG-52962
Change-Id: I4e2288efd82ad98b698cc09f26ad188064ec7b2a
Reviewed-by: Giuseppe D'Angelo <[email protected]>
Reviewed-by: Friedemann Kleint <[email protected]>
  • Loading branch information
AndyShawQt committed Jul 6, 2016
1 parent a9613ba commit 8f85e82
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gui/kernel/qguiapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3567,7 +3567,8 @@ QPixmap QGuiApplicationPrivate::getPixmapCursor(Qt::CursorShape cshape)

void QGuiApplicationPrivate::notifyThemeChanged()
{
if (!(applicationResourceFlags & ApplicationPaletteExplicitlySet)) {
if (!(applicationResourceFlags & ApplicationPaletteExplicitlySet) &&
!QCoreApplication::testAttribute(Qt::AA_SetPalette)) {
clearPalette();
initPalette();
}
Expand Down

0 comments on commit 8f85e82

Please sign in to comment.