From e4f36685405d006703525a2fe5a0c4bacd2d2544 Mon Sep 17 00:00:00 2001 From: VirtualGIT20 <149660135+VirtualGIT20@users.noreply.github.com> Date: Sun, 13 Sep 2026 10:22:24 +0200 Subject: [PATCH 1/2] fix: handle DPI-scaled switch bootstrap bounds --- .../RuntimeTemplate/SwitchBootstrap.ps1 | 158 ++++++++++++++++-- PlayniteBoot/RuntimeTemplate/VERSION.txt | 2 +- 2 files changed, 146 insertions(+), 14 deletions(-) diff --git a/PlayniteBoot/RuntimeTemplate/SwitchBootstrap.ps1 b/PlayniteBoot/RuntimeTemplate/SwitchBootstrap.ps1 index f765cb8..aa6c95a 100644 --- a/PlayniteBoot/RuntimeTemplate/SwitchBootstrap.ps1 +++ b/PlayniteBoot/RuntimeTemplate/SwitchBootstrap.ps1 @@ -35,6 +35,104 @@ function Get-PropertyValue { return $property.Value } +function Initialize-BootstrapNativeMethods { + if ('PlayniteBootSwitchBootstrap.Native' -as [type]) { + return + } + + Add-Type -TypeDefinition @' +using System; +using System.Runtime.InteropServices; + +namespace PlayniteBootSwitchBootstrap +{ + public static class Native + { + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + public struct DEVMODE + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string dmDeviceName; + public ushort dmSpecVersion; + public ushort dmDriverVersion; + public ushort dmSize; + public ushort dmDriverExtra; + public uint dmFields; + public int dmPositionX; + public int dmPositionY; + public uint dmDisplayOrientation; + public uint dmDisplayFixedOutput; + public short dmColor; + public short dmDuplex; + public short dmYResolution; + public short dmTTOption; + public short dmCollate; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string dmFormName; + public ushort dmLogPixels; + public uint dmBitsPerPel; + public uint dmPelsWidth; + public uint dmPelsHeight; + public uint dmDisplayFlags; + public uint dmDisplayFrequency; + public uint dmICMMethod; + public uint dmICMIntent; + public uint dmMediaType; + public uint dmDitherType; + public uint dmReserved1; + public uint dmReserved2; + public uint dmPanningWidth; + public uint dmPanningHeight; + } + + [DllImport("user32.dll", CharSet = CharSet.Unicode, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool EnumDisplaySettingsEx( + string lpszDeviceName, + int iModeNum, + ref DEVMODE lpDevMode, + uint dwFlags); + + [DllImport("user32.dll")] + public static extern IntPtr SetThreadDpiAwarenessContext(IntPtr dpiContext); + } +} +'@ +} + +function Get-PhysicalDisplayBounds { + param( + [Parameter(Mandatory = $true)]$Screen + ) + + try { + Initialize-BootstrapNativeMethods + + $mode = New-Object PlayniteBootSwitchBootstrap.Native+DEVMODE + $mode.dmSize = [uint16][Runtime.InteropServices.Marshal]::SizeOf([type][PlayniteBootSwitchBootstrap.Native+DEVMODE]) + + $enumCurrentSettings = -1 + $ok = [PlayniteBootSwitchBootstrap.Native]::EnumDisplaySettingsEx( + [string]$Screen.DeviceName, + $enumCurrentSettings, + [ref]$mode, + 0) + + if (-not $ok -or $mode.dmPelsWidth -eq 0 -or $mode.dmPelsHeight -eq 0) { + return $null + } + + return New-Object System.Drawing.Rectangle( + [int]$mode.dmPositionX, + [int]$mode.dmPositionY, + [int]$mode.dmPelsWidth, + [int]$mode.dmPelsHeight) + } + catch { + return $null + } +} + function Select-BootstrapScreen { param( [Parameter(Mandatory = $true)]$Config, @@ -134,19 +232,53 @@ try { } $bounds = $selectedScreen.Bounds - $form = New-Object System.Windows.Forms.Form - $form.FormBorderStyle = [System.Windows.Forms.FormBorderStyle]::None - $form.StartPosition = [System.Windows.Forms.FormStartPosition]::Manual - $form.Bounds = $bounds - $form.BackColor = [System.Drawing.Color]::Black - $form.TopMost = $true - $form.ShowInTaskbar = $false - $form.ControlBox = $false - - $form.Show() - $form.BringToFront() - $form.Refresh() - [System.Windows.Forms.Application]::DoEvents() + $physicalBounds = Get-PhysicalDisplayBounds -Screen $selectedScreen + $previousDpiContext = [IntPtr]::Zero + $usePhysicalBounds = $false + + if ($null -ne $physicalBounds) { + try { + Initialize-BootstrapNativeMethods + $dpiAwarenessContextPerMonitorAwareV2 = [IntPtr](-4) + $previousDpiContext = [PlayniteBootSwitchBootstrap.Native]::SetThreadDpiAwarenessContext( + $dpiAwarenessContextPerMonitorAwareV2) + $usePhysicalBounds = ($previousDpiContext -ne [IntPtr]::Zero) + } + catch { + $previousDpiContext = [IntPtr]::Zero + $usePhysicalBounds = $false + } + } + + try { + if ($usePhysicalBounds) { + $bounds = $physicalBounds + } + + $form = New-Object System.Windows.Forms.Form + $form.AutoScaleMode = [System.Windows.Forms.AutoScaleMode]::None + $form.FormBorderStyle = [System.Windows.Forms.FormBorderStyle]::None + $form.StartPosition = [System.Windows.Forms.FormStartPosition]::Manual + $form.Bounds = $bounds + $form.BackColor = [System.Drawing.Color]::Black + $form.TopMost = $true + $form.ShowInTaskbar = $false + $form.ControlBox = $false + + $form.Show() + $form.BringToFront() + $form.Refresh() + [System.Windows.Forms.Application]::DoEvents() + } + finally { + if ($usePhysicalBounds -and $previousDpiContext -ne [IntPtr]::Zero) { + try { + [void][PlayniteBootSwitchBootstrap.Native]::SetThreadDpiAwarenessContext($previousDpiContext) + } + catch { + } + } + } $readyEvent = [System.Threading.EventWaitHandle]::OpenExisting($SwitchReadyEventName) [void]$readyEvent.Set() diff --git a/PlayniteBoot/RuntimeTemplate/VERSION.txt b/PlayniteBoot/RuntimeTemplate/VERSION.txt index 238d6e8..b0f3d96 100644 --- a/PlayniteBoot/RuntimeTemplate/VERSION.txt +++ b/PlayniteBoot/RuntimeTemplate/VERSION.txt @@ -1 +1 @@ -1.0.7 +1.0.8 From 3f3672bada373943b01915c8c754c41e67918b84 Mon Sep 17 00:00:00 2001 From: VirtualGIT20 <149660135+VirtualGIT20@users.noreply.github.com> Date: Sun, 13 Sep 2026 10:22:31 +0200 Subject: [PATCH 2/2] chore: prepare release 0.7.1 --- CHANGELOG.md | 10 ++++++++++ PlayniteBoot/Properties/AssemblyInfo.cs | 4 ++-- PlayniteBoot/extension.yaml | 2 +- RELEASE_NOTES.md | 21 +++++++++------------ distribution/installer.yaml | 7 +++++++ docs/RELEASE_CHECKLIST.md | 15 ++++++++------- 6 files changed, 37 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1894777..88a61be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,16 @@ All notable changes are documented here. Versions follow the Playnite extension ## [Unreleased] +## [0.7.1] - 2026-09-13 + +### Fixed + +- The Desktop-to-Fullscreen bootstrap cover now uses the monitor's physical display bounds when Windows DPI virtualization reports scaled WinForms coordinates, preventing a smaller black rectangle from appearing in the top-left corner before the boot video on high-DPI and virtual displays. + +### Changed + +- Runtime updated to 1.0.8. + ## [0.7.0] - 2026-09-11 ### Added diff --git a/PlayniteBoot/Properties/AssemblyInfo.cs b/PlayniteBoot/Properties/AssemblyInfo.cs index 438a3aa..96e12b4 100644 --- a/PlayniteBoot/Properties/AssemblyInfo.cs +++ b/PlayniteBoot/Properties/AssemblyInfo.cs @@ -8,5 +8,5 @@ [assembly: AssemblyCopyright("Copyright © VirtualGIT20 2026")] [assembly: ComVisible(false)] [assembly: Guid("29f3bcc1-12ed-423e-8c61-d0eb0218eec3")] -[assembly: AssemblyVersion("0.7.0.0")] -[assembly: AssemblyFileVersion("0.7.0.0")] +[assembly: AssemblyVersion("0.7.1.0")] +[assembly: AssemblyFileVersion("0.7.1.0")] diff --git a/PlayniteBoot/extension.yaml b/PlayniteBoot/extension.yaml index da7f9b2..5bcd9a9 100644 --- a/PlayniteBoot/extension.yaml +++ b/PlayniteBoot/extension.yaml @@ -1,7 +1,7 @@ Id: PlayniteBoot_71b5c099-3c25-4fe7-b26f-1262c7f0e138 Name: Playnite Boot Screen Author: VirtualGIT20 -Version: 0.7.0 +Version: 0.7.1 Module: PlayniteBoot.dll Type: GenericPlugin Icon: icon.png diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 9b12f50..0c0ccaa 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,14 +1,11 @@ -# Playnite Boot Screen 0.7.0 - -This feature release extends Playnite Boot Screen to Playnite's native Desktop-to-Fullscreen transition and hardens runtime updates. +# Playnite Boot Screen 0.7.1 +This maintenance hotfix corrects the Desktop-to-Fullscreen bootstrap cover on high-DPI and virtual displays. Highlights: -- the configured boot video can cover Playnite's built-in Desktop-to-Fullscreen switch; -- the new switch integration is enabled by default and can be disabled from the extension settings; -- a lightweight on-demand black bootstrap cover bridges the Desktop closing phase to the existing WPF boot overlay, with no resident helper process; -- Playnite still owns and performs its native Desktop-to-Fullscreen transition; if the cover cannot be armed, the integration fails open and Playnite continues normally; -- the existing monitor selection, video playback, readiness detection, fade, cancellation, and foreground handling are reused for the switch path; -- managed runtime files are synchronized by content on Playnite startup, so an outdated or modified managed file is repaired even if the runtime version marker was not changed; -- runtime updated to 1.0.7. - -Existing shortcuts, custom media, settings, and Sunshine/Apollo streaming configuration remain compatible. +- the temporary black handoff cover now resolves the selected monitor's physical position and resolution instead of treating DPI-virtualized WinForms bounds as physical pixels; +- the bootstrap cover is created under a temporary per-monitor DPI context, which is restored before the existing WPF boot overlay continues; +- this prevents the cover from appearing as a smaller black rectangle in the top-left corner before the video on high-scaling displays, including 4K virtual displays; +- the normal WPF overlay, video playback, Standalone flow, Sunshine/Apollo streaming flow, monitor selection, foreground handling, and log rotation are unchanged; +- no additional per-switch logging is introduced by this hotfix; +- runtime updated to 1.0.8. +Existing shortcuts, custom media, settings, and streaming configuration remain compatible. diff --git a/distribution/installer.yaml b/distribution/installer.yaml index 37a0984..e577826 100644 --- a/distribution/installer.yaml +++ b/distribution/installer.yaml @@ -1,5 +1,12 @@ AddonId: PlayniteBoot_71b5c099-3c25-4fe7-b26f-1262c7f0e138 Packages: + - Version: 0.7.1 + RequiredApiVersion: 6.16.0 + ReleaseDate: 2026-09-13 + PackageUrl: https://github.com/VirtualGIT20/Playnite-Boot-Screen/releases/download/v0.7.1/Playnite-Boot-Screen-v0.7.1.pext + Changelog: + - Fix the Desktop-to-Fullscreen handoff cover sizing on high-DPI and virtual displays. + - Resolve physical monitor bounds for the temporary bootstrap cover while leaving the normal WPF boot overlay unchanged. - Version: 0.7.0 RequiredApiVersion: 6.16.0 ReleaseDate: 2026-09-11 diff --git a/docs/RELEASE_CHECKLIST.md b/docs/RELEASE_CHECKLIST.md index 2fc695b..beef3c1 100644 --- a/docs/RELEASE_CHECKLIST.md +++ b/docs/RELEASE_CHECKLIST.md @@ -1,4 +1,4 @@ -# Release checklist — 0.7.0 +# Release checklist — 0.7.1 ## Code and behavior @@ -26,19 +26,20 @@ - [ ] Desktop and Start shortcuts can be created, renamed, and removed. - [ ] Invalid or modified shortcut state cannot escape the Desktop or Start menu directories. - [ ] Runtime log rotates to `PlayniteBoot.log.1` after 2 MiB. -- [ ] With `VERSION.txt` unchanged at `1.0.7`, modifying a managed installed runtime file is repaired automatically on the next Playnite start. +- [ ] With `VERSION.txt` unchanged at `1.0.8`, modifying a managed installed runtime file is repaired automatically on the next Playnite start. ## Display matrix - [ ] Single 1080p display at 100% scaling. -- [ ] Single 4K display at 150% or 200% scaling. +- [ ] 4K display or VDD at 250% scaling: the bootstrap cover fills the physical display before the video. +- [ ] The same 4K display or VDD at 100% scaling: the bootstrap cover remains full-screen. - [ ] Mixed 1080p/4K displays with different scaling values. - [ ] Secondary display with negative desktop coordinates. - [ ] Sunshine/Apollo virtual display at 4K60. ## Packaging -- [ ] `scripts/verify-release.ps1 -Version 0.7.0` succeeds. +- [ ] `scripts/verify-release.ps1 -Version 0.7.1` succeeds. - [ ] `scripts/pack.ps1 -Configuration Release` creates exactly one expected `.pext`. - [ ] Build output and `.pext` both contain `RuntimeTemplate\SwitchBootstrap.ps1`. - [ ] Build and package contain no `.pdb`, source, temporary, or stale files. @@ -52,12 +53,12 @@ - [ ] Repository description, topics, and license are set. - [ ] Private vulnerability reporting is enabled. - [ ] CI workflow succeeds. -- [ ] Tag `v0.7.0` creates a release with `.pext` and checksum. -- [ ] Release notes describe the Desktop → Fullscreen transition, fail-open behavior, and content-aware runtime synchronization. +- [ ] Tag `v0.7.1` creates a release with `.pext` and checksum. +- [ ] Release notes describe the high-DPI bootstrap sizing fix and confirm that the WPF/streaming paths are unchanged. ## Playnite add-on database - [ ] GitHub release asset URL is live. - [ ] `distribution/installer.yaml` verifies with Toolbox. - [ ] `distribution/addon.yaml` verifies with Toolbox. -- [ ] Published store entry resolves `distribution/installer.yaml` and exposes version `0.7.0`; no database pull request is needed unless central metadata changes. +- [ ] Published store entry resolves `distribution/installer.yaml` and exposes version `0.7.1`; no database pull request is needed unless central metadata changes.