Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1550,16 +1550,25 @@ private void RepaintSplitterRect()
{
if (IsHandleCreated)
{
using Graphics g = CreateGraphicsInternal();
if (BackgroundImage is not null)
try
{
using TextureBrush textureBrush = new(BackgroundImage, WrapMode.Tile);
g.FillRectangle(textureBrush, ClientRectangle);
using Graphics g = CreateGraphicsInternal();
if (BackgroundImage is not null)
{
using TextureBrush textureBrush = new(BackgroundImage, WrapMode.Tile);
g.FillRectangle(textureBrush, ClientRectangle);
}
else
{
using var solidBrush = BackColor.GetCachedSolidBrushScope();
g.FillRectangle(solidBrush, _splitterRect);
}
}
else
catch (ExternalException ex)
{
using var solidBrush = BackColor.GetCachedSolidBrushScope();
g.FillRectangle(solidBrush, _splitterRect);
// GDI+ can transiently fail while the display session is transitioning (for example, lock/unlock).
// Ignore repaint failures here and let normal painting recover once graphics resources are available.
Debug.Fail($"{nameof(RepaintSplitterRect)} failed with hr={ex.ErrorCode}, message={ex}");
}
}
}
Expand Down
Loading