Browse Source
Merge branch 'master' into fixes/win32-consistent-minimize-restore-window-size
pull/8574/head
Dan Walmsley
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with
35 additions and
3 deletions
-
native/Avalonia.Native/src/OSX/WindowImpl.mm
-
samples/IntegrationTestApp/MainWindow.axaml.cs
-
samples/IntegrationTestApp/ShowWindowTest.axaml
-
tests/Avalonia.IntegrationTests.Appium/WindowTests.cs
-
tests/Avalonia.IntegrationTests.Appium/WindowTests_MacOS.cs
|
|
|
@ -121,7 +121,7 @@ void WindowImpl::BringToFront() |
|
|
|
{ |
|
|
|
if(Window != nullptr) |
|
|
|
{ |
|
|
|
if (![Window isMiniaturized]) |
|
|
|
if ([Window isVisible] && ![Window isMiniaturized]) |
|
|
|
{ |
|
|
|
if(IsDialog()) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -99,6 +99,7 @@ namespace IntegrationTestApp |
|
|
|
|
|
|
|
foreach (var window in lifetime.Windows) |
|
|
|
{ |
|
|
|
window.Show(); |
|
|
|
if (window.WindowState == WindowState.Minimized) |
|
|
|
window.WindowState = WindowState.Normal; |
|
|
|
} |
|
|
|
|
|
|
|
@ -3,7 +3,7 @@ |
|
|
|
x:Class="IntegrationTestApp.ShowWindowTest" |
|
|
|
Name="SecondaryWindow" |
|
|
|
Title="Show Window Test"> |
|
|
|
<Grid ColumnDefinitions="Auto,Auto" RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto"> |
|
|
|
<Grid ColumnDefinitions="Auto,Auto" RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto"> |
|
|
|
<Label Grid.Column="0" Grid.Row="1">Client Size</Label> |
|
|
|
<TextBox Name="ClientSize" Grid.Column="1" Grid.Row="1" IsReadOnly="True" |
|
|
|
Text="{Binding ClientSize, Mode=OneWay}"/> |
|
|
|
@ -31,5 +31,6 @@ |
|
|
|
<ComboBoxItem>Maximized</ComboBoxItem> |
|
|
|
<ComboBoxItem>Fullscreen</ComboBoxItem> |
|
|
|
</ComboBox> |
|
|
|
<Button Name="HideButton" Grid.Row="8" Command="{Binding $parent[Window].Hide}">Hide</Button> |
|
|
|
</Grid> |
|
|
|
</Window> |
|
|
|
|
|
|
|
@ -131,7 +131,8 @@ namespace Avalonia.IntegrationTests.Appium |
|
|
|
Assert.True(clientSize.Width >= current.ScreenRect.Width); |
|
|
|
Assert.True(clientSize.Height >= current.ScreenRect.Height); |
|
|
|
|
|
|
|
windowState.Click(); |
|
|
|
windowState.SendClick(); |
|
|
|
|
|
|
|
_session.FindElementByName("Normal").SendClick(); |
|
|
|
|
|
|
|
current = GetWindowInfo(); |
|
|
|
|
|
|
|
@ -211,6 +211,35 @@ namespace Avalonia.IntegrationTests.Appium |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
[PlatformFact(TestPlatforms.MacOS)] |
|
|
|
public void Hidden_Child_Window_Is_Not_Reshown_When_Parent_Clicked() |
|
|
|
{ |
|
|
|
var mainWindow = _session.FindElementByAccessibilityId("MainWindow"); |
|
|
|
|
|
|
|
// We don't use dispose to close the window here, because it seems that hiding and re-showing a window
|
|
|
|
// causes Appium to think it's a different window.
|
|
|
|
OpenWindow(null, ShowWindowMode.Owned, WindowStartupLocation.Manual); |
|
|
|
|
|
|
|
var secondaryWindow = FindWindow(_session, "SecondaryWindow"); |
|
|
|
var hideButton = secondaryWindow.FindElementByAccessibilityId("HideButton"); |
|
|
|
|
|
|
|
hideButton.Click(); |
|
|
|
|
|
|
|
var windows = _session.FindElementsByXPath("XCUIElementTypeWindow"); |
|
|
|
Assert.Single(windows); |
|
|
|
|
|
|
|
mainWindow.Click(); |
|
|
|
|
|
|
|
windows = _session.FindElementsByXPath("XCUIElementTypeWindow"); |
|
|
|
Assert.Single(windows); |
|
|
|
|
|
|
|
_session.FindElementByAccessibilityId("RestoreAll").Click(); |
|
|
|
|
|
|
|
// Close the window manually.
|
|
|
|
secondaryWindow = FindWindow(_session, "SecondaryWindow"); |
|
|
|
secondaryWindow.GetChromeButtons().close.Click(); |
|
|
|
} |
|
|
|
|
|
|
|
private IDisposable OpenWindow(PixelSize? size, ShowWindowMode mode, WindowStartupLocation location) |
|
|
|
{ |
|
|
|
var sizeTextBox = _session.FindElementByAccessibilityId("ShowWindowSize"); |
|
|
|
|