Description

When closing a PIE viewport, we write the size back to the New Viewport Resolution setting in case the window was resized during play. However, we do not account for the window border, and write back the full window size instead of the viewport size:

 

// Remember last known size
PlaySettingsConfig->LastSize = PlayInEditorSessionInfo->CachedWindowInfo[WindowIndex].Size;
// Only update it if "Always center window to screen" is disabled, and the size was not 0 (which means it is attached to the editor rather than being an standalone window)
if (!PlaySettingsConfig->CenterNewWindow && PlaySettingsConfig->LastSize.X > 0 && PlaySettingsConfig->LastSize.Y > 0)
{
     PlaySettingsConfig->NewWindowPosition = PlaySettingsConfig->MultipleInstancePositions[WindowIndex];
     PlaySettingsConfig->NewWindowWidth = PlaySettingsConfig->LastSize.X;
     PlaySettingsConfig->NewWindowHeight = PlaySettingsConfig->LastSize.Y;
}

The result is a PIE window that grows on each launch, even if the window is never resized during a PIE session. This appears to be caused by changes made in CL# 14058158.

 

Steps to Reproduce
  1. Open Editor Preferences->Level Editor->Play and note the New Viewport Resolution under Game Viewport Settings
  2. Ensure "Always center first viewport window to screen" is unchecked
  3. Launch PIE via New Editor Window (PIE) setting
  4. Close PIE window, note that the New Viewport Resolution has increased

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-162908 in the post.

21
Login to Vote

Backlogged
ComponentUE - Editor - UI Systems - Slate
Affects Versions5.05.1
CreatedSep 2, 2022
UpdatedDec 15, 2023
View Jira Issue