private bool class_registered;
private bool disposed;
private bool exists;
- private WinWindowInfo window, child_window;
+ private WinWindowInfo window;
private WindowBorder windowBorder = WindowBorder.Resizable;
private Nullable<WindowBorder> previous_window_border; // Set when changing to fullscreen state.
private Nullable<WindowBorder> deferred_window_border; // Set to avoid changing borders during fullscreen state.
scale_y = ScaleY(y);
}
- // To avoid issues with Ati drivers on Windows 6+ with compositing enabled, the context will not be
- // bound to the top-level window, but rather to a child window docked in the parent.
window = new WinWindowInfo(
CreateWindow(
scale_x, scale_y, scale_width, scale_height,
title, options, device, IntPtr.Zero),
null);
- child_window = new WinWindowInfo(
- CreateWindow(
- 0, 0, ClientSize.Width, ClientSize.Height,
- title, options, device, window.Handle),
- window);
Functions.DragAcceptFiles(window.Handle, true);
exists = true;
Functions.GetClientRect(handle, out rect);
client_rectangle = rect.ToRectangle();
- Functions.SetWindowPos(child_window.Handle, IntPtr.Zero, 0, 0, ClientRectangle.Width, ClientRectangle.Height,
+ Functions.SetWindowPos(window.Handle, IntPtr.Zero, bounds.X, bounds.Y, bounds.Width, bounds.Height,
SetWindowPosFlags.NOZORDER | SetWindowPosFlags.NOOWNERZORDER |
SetWindowPosFlags.NOACTIVATE | SetWindowPosFlags.NOSENDCHANGING);
{
// If the mouse is captured we get spurious MOUSELEAVE events.
// So ignore WM_MOUSELEAVE if capture count != 0.
- if (mouse_capture_count == 0 )
+ if (mouse_capture_count == 0)
{
mouse_outside_window = true;
// Mouse tracking is disabled automatically by the OS
Functions.UnregisterClass(ClassName, Instance);
}
window.Dispose();
- child_window.Dispose();
OnClosed(EventArgs.Empty);
}
{
if (mouse_capture_count == 0)
{
- Functions.SetCapture(child_window.Handle);
+ Functions.SetCapture(window.Handle);
}
mouse_capture_count++;
}
{
TrackMouseEventStructure me = new TrackMouseEventStructure();
me.Size = TrackMouseEventStructure.SizeInBytes;
- me.TrackWindowHandle = child_window.Handle;
+ me.TrackWindowHandle = window.Handle;
me.Flags = TrackMouseEventFlags.LEAVE;
if (!Functions.TrackMouseEvent(ref me))
}
}
- public override bool Exists { get { return exists; } }
+ public override bool Exists { get { return exists; } }
public override MouseCursor Cursor
{
// Make sure client size doesn't change when changing the border style.
Size client_size = ClientSize;
- Win32Rectangle rect = Win32Rectangle.From(client_size);
+ Win32Rectangle rect = Win32Rectangle.From(bounds);
Functions.AdjustWindowRectEx(ref rect, new_style, false, ParentStyleEx);
// This avoids leaving garbage on the background window.
public override IWindowInfo WindowInfo
{
- get { return child_window; }
+ get { return window; }
}
protected override void Dispose(bool calledManually)