BrowserWindow: Add OnBoundsChanged event

While not being an original Electron event, this one includes the bounds values,
saving the additional roundtrip for calling GetBoundsAsync
This commit is contained in:
softworkz
2026-01-21 06:09:57 +01:00
parent 682a1c38ed
commit 6c95dfd476
4 changed files with 27 additions and 1 deletions

View File

@@ -186,6 +186,19 @@ public class BrowserWindow : ApiBase
remove => RemoveEvent(value, Id);
}
/// <summary>
/// Emitted when the window is moved or resized.
/// </summary>
/// <remarks>
/// While not being an original Electron event, this one includes the bounds values,
/// saving the additional roundtrip for calling <see cref="GetBoundsAsync"/>.
/// </remarks>
public event Action<Rectangle> OnBoundsChanged
{
add => AddEvent(value, Id);
remove => RemoveEvent(value, Id);
}
/// <summary>
/// macOS: Emitted once when the window is moved to a new position.
/// </summary>