diff options
-rw-r--r-- | src/Editor.cxx | 10 | ||||
-rw-r--r-- | win32/PlatWin.cxx | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 9107102ff..8de5bcd15 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -225,8 +225,8 @@ void Editor::DropGraphics() { void Editor::InvalidateStyleData() { stylesValid = false; - palette.Release(); DropGraphics(); + palette.Release(); llc.Invalidate(LineLayout::llInvalid); posCache.Clear(); if (selType == selRectangle) { @@ -2770,6 +2770,7 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) { //Platform::DebugPrintf("Paint:%1d (%3d,%3d) ... (%3d,%3d)\n", // paintingAllText, rcArea.left, rcArea.top, rcArea.right, rcArea.bottom); + pixmapLine->Release(); RefreshStyleData(); RefreshPixMaps(surfaceWindow); @@ -2799,10 +2800,17 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) { pdoc->EnsureStyledTo(endPosPaint); bool paintAbandonedByStyling = paintState == paintAbandoned; if (needUpdateUI) { + // Deselect palette by selecting a temporary palette + Palette palTemp; + surfaceWindow->SetPalette(&palTemp, true); + NotifyUpdateUI(); needUpdateUI = false; + RefreshStyleData(); RefreshPixMaps(surfaceWindow); + surfaceWindow->SetPalette(&palette, true); + pixmapLine->SetPalette(&palette, !hasFocus); } // Call priority lines wrap on a window of lines which are likely diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index e8b142f6a..c818ab7fa 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -435,7 +435,7 @@ void SurfaceImpl::Release() { } bitmap = 0; if (paletteOld) { - // Fonts are not deleted as they are owned by a Palette object + // Palettes are not deleted as they are owned by a Palette object ::SelectPalette(reinterpret_cast<HDC>(hdc), reinterpret_cast<HPALETTE>(paletteOld), TRUE); paletteOld = 0; |