Skip to content

Commit

Permalink
b/380896840 Move SetCompatibleTextRenderingDefault call (#1581)
Browse files Browse the repository at this point in the history
Call SetCompatibleTextRenderingDefault earlier
during initialization to minimze the risk
that any window is created before.
  • Loading branch information
jpassing authored Nov 28, 2024
1 parent 8e80b68 commit ed026ed
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions sources/Google.Solutions.IapDesktop/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,14 @@ protected override int HandleFirstInvocation(string[] args)
ApplicationTraceSource.Log.TraceError(e);
}

//
// Use the GDI-based TextRenderer class.
//
// NB. This must be set early, before the first window is created.
//
System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
System.Windows.Forms.Application.EnableVisualStyles();

#if DEBUG
ApplicationTraceSource.Log.Switch.Level = SourceLevels.Verbose;
TerminalTraceSource.Log.Switch.Level = SourceLevels.Verbose;
Expand Down Expand Up @@ -437,9 +445,6 @@ protected override int HandleFirstInvocation(string[] args)
}
}

System.Windows.Forms.Application.EnableVisualStyles();
System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);

//
// Load settings.
//
Expand Down

0 comments on commit ed026ed

Please sign in to comment.