fix: apply direct runtime paths and respect taskbar
This commit is contained in:
@@ -87,13 +87,9 @@ public sealed partial class MainWindow : Window
|
||||
"MBN_STOCK_WEBVIEW",
|
||||
"Res",
|
||||
"종목.ini");
|
||||
var selectedResourceDirectory = _isDevelopmentLiveLaunch
|
||||
? null
|
||||
: _appliedOperatorSettings.ResourceDirectory;
|
||||
var cutMenuComposition = _isDevelopmentLiveLaunch
|
||||
? LegacyRuntimeStockCutMenuLoader.ResolveFromBaseDirectory(
|
||||
AppContext.BaseDirectory)
|
||||
: selectedResourceDirectory is null
|
||||
var selectedResourceDirectory =
|
||||
_appliedOperatorSettings.ResourceDirectory;
|
||||
var cutMenuComposition = selectedResourceDirectory is null
|
||||
? LegacyRuntimeStockCutMenuLoader.ResolveFromCandidates(
|
||||
runtimeCutMenuOverridePath,
|
||||
AppContext.BaseDirectory)
|
||||
@@ -135,7 +131,9 @@ public sealed partial class MainWindow : Window
|
||||
// A Gate A plan pins database.local.json by path, size and SHA-256.
|
||||
// Never inspect either packaged or operator-selected legacy INI files
|
||||
// during that one-shot validation process.
|
||||
var selectedLegacyDatabaseIni = selectedResourceDirectory is null
|
||||
var selectedLegacyDatabaseIni =
|
||||
_isDevelopmentLiveLaunch ||
|
||||
selectedResourceDirectory is null
|
||||
? null
|
||||
: Path.Combine(selectedResourceDirectory, "MmoneyCoder.ini");
|
||||
_databaseRuntime = _playoutLaunchAuthorization.IsGateA
|
||||
@@ -375,17 +373,28 @@ public sealed partial class MainWindow : Window
|
||||
appWindow.SetIcon(iconPath);
|
||||
}
|
||||
|
||||
// Preserve the legacy restore size when it fits, but clamp the complete
|
||||
// window (client plus caption and borders) to the monitor work area.
|
||||
// Clamping the client size alone can still place the bottom controls
|
||||
// behind the taskbar.
|
||||
var displayArea = DisplayArea.GetFromWindowId(windowId, DisplayAreaFallback.Primary);
|
||||
var workArea = displayArea.WorkArea;
|
||||
appWindow.ResizeClient(new SizeInt32(1905, 1015));
|
||||
var requestedWindowSize = appWindow.Size;
|
||||
appWindow.MoveAndResize(new RectInt32(
|
||||
workArea.X,
|
||||
workArea.Y,
|
||||
Math.Min(requestedWindowSize.Width, workArea.Width),
|
||||
Math.Min(requestedWindowSize.Height, workArea.Height)));
|
||||
|
||||
if (appWindow.Presenter is OverlappedPresenter presenter)
|
||||
{
|
||||
presenter.IsMaximizable = false;
|
||||
// Keep the operator window fixed, while allowing Windows to use its
|
||||
// standard work-area-aware maximize path on startup and after restore.
|
||||
presenter.IsMaximizable = true;
|
||||
presenter.IsResizable = false;
|
||||
presenter.Maximize();
|
||||
}
|
||||
|
||||
// WinForms stored 1905 x 1015 as ClientSize. AppWindow.Resize would include
|
||||
// the caption and borders and silently make the WebView viewport smaller.
|
||||
appWindow.ResizeClient(new SizeInt32(1905, 1015));
|
||||
var displayArea = DisplayArea.GetFromWindowId(windowId, DisplayAreaFallback.Primary);
|
||||
appWindow.Move(new PointInt32(displayArea.WorkArea.X, displayArea.WorkArea.Y));
|
||||
}
|
||||
|
||||
private async Task InitializeWebViewAsync()
|
||||
|
||||
Reference in New Issue
Block a user