Revert WindowBorder and WindowState value changes.

Use Nullable types to detect when WindowBorder and WindowState is not set.
This commit is contained in:
the_fiddler 2009-10-19 21:32:33 +00:00
parent 65e9d6d969
commit c80cac88ca
3 changed files with 10 additions and 6 deletions

View file

@ -60,8 +60,9 @@ namespace OpenTK.Platform.Windows
bool disposed;
bool exists;
WinWindowInfo window, child_window;
WindowBorder windowBorder = WindowBorder.Resizable, previous_window_border;
WindowBorder deferred_window_border; // Set to avoid changing borders during fullscreen states.
WindowBorder windowBorder = WindowBorder.Resizable;
Nullable<WindowBorder> previous_window_border; // Set when changing to fullscreen state.
Nullable<WindowBorder> deferred_window_border; // Set to avoid changing borders during fullscreen state.
WindowState windowState = WindowState.Normal;
bool borderless_maximized_window_state = false; // Hack to get maximized mode with hidden border (not normally possible).
bool focused;
@ -910,8 +911,11 @@ namespace OpenTK.Platform.Windows
// Restore previous window border or apply pending border change when leaving fullscreen mode.
if (exiting_fullscreen)
{
WindowBorder = deferred_window_border != 0 ? deferred_window_border : previous_window_border;
deferred_window_border = previous_window_border = 0;
WindowBorder =
deferred_window_border.HasValue ? deferred_window_border.Value :
previous_window_border.HasValue ? previous_window_border.Value :
WindowBorder;
deferred_window_border = previous_window_border = null;
}
}
}

View file

@ -12,7 +12,7 @@ namespace OpenTK
/// <summary>
/// The window has a resizable border. A window with a resizable border can be resized by the user or programmatically.
/// </summary>
Resizable = 1,
Resizable = 0,
/// <summary>
/// The window has a fixed border. A window with a fixed border can only be resized programmatically.
/// </summary>

View file

@ -20,7 +20,7 @@ namespace OpenTK
/// <summary>
/// The window is in its normal state.
/// </summary>
Normal = 1,
Normal = 0,
/// <summary>
/// The window is minimized to the taskbar (also known as 'iconified').
/// </summary>