Show tool windows without an owner so they can go behind the entry window
An owned window is transient-for its owner on X11, so the window manager kept every tool window above the entry window. The windows now have no owner. The entry window closes them when it closes, and minimizes or restores them when its own state changes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -81,6 +81,22 @@ public sealed partial class EntryWindow : Window
|
||||
// the windows are where this operator left them, and that is what he
|
||||
// gets back next time he takes the radio
|
||||
Closing += (_, _) => session.Save(WithLayout(session.Settings));
|
||||
PropertyChanged += (_, e) =>
|
||||
{
|
||||
if (e.Property == WindowStateProperty
|
||||
&& WindowState is WindowState.Minimized or WindowState.Normal)
|
||||
{
|
||||
FollowWindowState(WindowState);
|
||||
}
|
||||
};
|
||||
Closed += (_, _) =>
|
||||
{
|
||||
foreach (Window window in openWindows.Values.ToList())
|
||||
{
|
||||
window.Close();
|
||||
}
|
||||
secondRadio?.Close();
|
||||
};
|
||||
clock.Tick += (_, _) => UpdateClock();
|
||||
clock.Start();
|
||||
session.EntryWiped += (_, wiped) => Dispatcher.UIThread.Post(() =>
|
||||
@@ -156,7 +172,7 @@ public sealed partial class EntryWindow : Window
|
||||
{
|
||||
secondRadio = new EntryWindow(session, 2);
|
||||
secondRadio.Closed += (_, _) => secondRadio = null;
|
||||
secondRadio.Show(this);
|
||||
secondRadio.Show();
|
||||
}
|
||||
else if (!wanted && secondRadio is not null)
|
||||
{
|
||||
@@ -166,6 +182,16 @@ public sealed partial class EntryWindow : Window
|
||||
}
|
||||
}
|
||||
|
||||
/// The tool windows have no owner, so the window manager does not minimize
|
||||
/// or restore them with the entry window. This does it.
|
||||
private void FollowWindowState(WindowState state)
|
||||
{
|
||||
foreach (Window window in openWindows.Values.Concat(secondRadio is null ? [] : [secondRadio]))
|
||||
{
|
||||
window.WindowState = state;
|
||||
}
|
||||
}
|
||||
|
||||
/// The keyboard follows the operator to the other radio.
|
||||
private void FollowActiveRadio(int number)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user