Disable "Stay on Top" setting of IToolFormAutoConfigs on Unix

This commit is contained in:
YoshiRulz 2020-09-07 22:43:54 +10:00 committed by adelikat
parent f6dde5914d
commit 5099614dbe
1 changed files with 12 additions and 3 deletions

View File

@ -224,12 +224,21 @@ namespace BizHawk.Client.EmuHawk
private void RefreshSettings(Form form, ToolStripItemCollection menu, ToolDialogSettings settings, int idx)
{
((ToolStripMenuItem)menu[idx + 0]).Checked = settings.SaveWindowPosition;
((ToolStripMenuItem)menu[idx + 1]).Checked = settings.TopMost;
var stayOnTopItem = (ToolStripMenuItem)menu[idx + 1];
stayOnTopItem.Checked = settings.TopMost;
if (OSTailoredCode.IsUnixHost)
{
// This is the job of the WM, and is usually exposed in window decorations or a context menu on them
stayOnTopItem.Enabled = false;
stayOnTopItem.Visible = false;
}
else
{
form.TopMost = settings.TopMost;
}
((ToolStripMenuItem)menu[idx + 2]).Checked = settings.FloatingWindow;
((ToolStripMenuItem)menu[idx + 3]).Checked = settings.AutoLoad;
form.TopMost = settings.TopMost;
// do we need to do this OnShown() as well?
form.Owner = settings.FloatingWindow ? null : _owner;
}