Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6603890aef | ||
|
|
2085dad3b9 | ||
|
|
b6f046abdd | ||
|
|
9dcd9055d9 | ||
|
|
cc579d794e |
+20
-1
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
@@ -68,8 +68,27 @@ namespace MmdPdf
|
|||||||
// Startup
|
// Startup
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
|
// Windows reports whether we are being viewed over a remote desktop. In that case WPF's
|
||||||
|
// hardware compositing hands the session a surface it never repaints when the desktop is
|
||||||
|
// resized, which leaves the part of the window outside the original size drawn as flat
|
||||||
|
// black. Drawing in software costs nothing at this size and keeps the whole window painted.
|
||||||
|
[DllImport("user32.dll")]
|
||||||
|
private static extern int GetSystemMetrics(int index);
|
||||||
|
private const int SM_REMOTESESSION = 0x1000;
|
||||||
|
|
||||||
|
private static void UseSoftwareRenderingOnRemoteDesktops()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (GetSystemMetrics(SM_REMOTESESSION) != 0)
|
||||||
|
RenderOptions.ProcessRenderMode = System.Windows.Interop.RenderMode.SoftwareOnly;
|
||||||
|
}
|
||||||
|
catch { /* never let a rendering hint stop the application starting */ }
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnStartup(StartupEventArgs e)
|
protected override void OnStartup(StartupEventArgs e)
|
||||||
{
|
{
|
||||||
|
UseSoftwareRenderingOnRemoteDesktops();
|
||||||
StartupTrace.Mark("App.OnStartup entered");
|
StartupTrace.Mark("App.OnStartup entered");
|
||||||
DispatcherUnhandledException += OnDispatcherException;
|
DispatcherUnhandledException += OnDispatcherException;
|
||||||
AppDomain.CurrentDomain.UnhandledException += OnDomainException;
|
AppDomain.CurrentDomain.UnhandledException += OnDomainException;
|
||||||
|
|||||||
+4
-4
@@ -1,4 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
@@ -15,9 +15,9 @@
|
|||||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
<!-- MMD's own version line. 1.7.5 was the upstream project's; it read as that
|
<!-- MMD's own version line. 1.7.5 was the upstream project's; it read as that
|
||||||
product still, and it has to sort above it so an upgrade is an upgrade. -->
|
product still, and it has to sort above it so an upgrade is an upgrade. -->
|
||||||
<Version>2026.8.1</Version>
|
<Version>2026.8.2</Version>
|
||||||
<AssemblyVersion>2026.8.1.0</AssemblyVersion>
|
<AssemblyVersion>2026.8.2.0</AssemblyVersion>
|
||||||
<FileVersion>2026.8.1.0</FileVersion>
|
<FileVersion>2026.8.2.0</FileVersion>
|
||||||
<!-- Shown in the About card beside the version so a user can tell how old their build
|
<!-- Shown in the About card beside the version so a user can tell how old their build
|
||||||
is. Must match the date on this version's CHANGELOG section - release.ps1 preflight
|
is. Must match the date on this version's CHANGELOG section - release.ps1 preflight
|
||||||
fails the release if it does not. Bump it with the version. -->
|
fails the release if it does not. Bump it with the version. -->
|
||||||
|
|||||||
Reference in New Issue
Block a user