Browse Source

Removed functionality implemented by #1190.

pull/1553/head
Steven Kirk 8 years ago
parent
commit
2f64e0f952
  1. 7
      src/Avalonia.Controls/Window.cs
  2. 1
      src/Avalonia.DesignerSupport/Remote/Stubs.cs
  3. 24
      src/Windows/Avalonia.Win32/Interop/UnmanagedMethods.cs
  4. 19
      src/Windows/Avalonia.Win32/WindowImpl.cs

7
src/Avalonia.Controls/Window.cs

@ -148,9 +148,6 @@ namespace Avalonia.Controls
impl.WindowStateChanged = HandleWindowStateChanged;
_maxPlatformClientSize = PlatformImpl?.MaxClientSize ?? default(Size);
Screens = new Screens(PlatformImpl?.Screen);
if (PlatformImpl != null)
PlatformImpl.WindowStateChanged = s => WindowState = s;
}
/// <inheritdoc/>
@ -321,11 +318,13 @@ namespace Avalonia.Controls
protected virtual void HandleWindowStateChanged(WindowState state)
{
WindowState = state;
if (state == WindowState.Minimized)
{
Renderer.Stop();
}
else if (state == WindowState.Normal)
else
{
Renderer.Start();
}

1
src/Avalonia.DesignerSupport/Remote/Stubs.cs

@ -33,7 +33,6 @@ namespace Avalonia.DesignerSupport.Remote
public Action<Point> PositionChanged { get; set; }
public WindowState WindowState { get; set; }
public Action<WindowState> WindowStateChanged { get; set; }
public IRenderer CreateRenderer(IRenderRoot root) => new ImmediateRenderer(root);
public void Dispose()
{

24
src/Windows/Avalonia.Win32/Interop/UnmanagedMethods.cs

@ -104,30 +104,6 @@ namespace Avalonia.Win32.Interop
ForceMinimize = 11
}
public enum SysCommands
{
SC_SIZE = 0xF000,
SC_MOVE = 0xF010,
SC_MINIMIZE = 0xF020,
SC_MAXIMIZE = 0xF030,
SC_NEXTWINDOW = 0xF040,
SC_PREVWINDOW = 0xF050,
SC_CLOSE = 0xF060,
SC_VSCROLL = 0xF070,
SC_HSCROLL = 0xF080,
SC_MOUSEMENU = 0xF090,
SC_KEYMENU = 0xF100,
SC_ARRANGE = 0xF110,
SC_RESTORE = 0xF120,
SC_TASKLIST = 0xF130,
SC_SCREENSAVE = 0xF140,
SC_HOTKEY = 0xF150,
SC_DEFAULT = 0xF160,
SC_MONITORPOWER = 0xF170,
SC_CONTEXTHELP = 0xF180,
SC_SEPARATOR = 0xF00F,
}
public enum SystemMetric
{
SM_CXSCREEN = 0, // 0x00

19
src/Windows/Avalonia.Win32/WindowImpl.cs

@ -650,25 +650,6 @@ namespace Avalonia.Win32
return IntPtr.Zero;
case UnmanagedMethods.WindowsMessage.WM_SYSCOMMAND:
if (WindowStateChanged != null)
{
switch ((SysCommands)wParam)
{
case SysCommands.SC_MINIMIZE:
WindowStateChanged(WindowState.Minimized);
break;
case SysCommands.SC_MAXIMIZE:
WindowStateChanged(WindowState.Maximized);
break;
case SysCommands.SC_RESTORE:
WindowStateChanged(WindowState.Normal);
break;
}
}
break;
case UnmanagedMethods.WindowsMessage.WM_MOVE:
PositionChanged?.Invoke(new Point((short)(ToInt32(lParam) & 0xffff), (short)(ToInt32(lParam) >> 16)));
return IntPtr.Zero;

Loading…
Cancel
Save