From c80cac88caaa5b8e205aeb2a9bbe2810efa96776 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Mon, 19 Oct 2009 21:32:33 +0000 Subject: [PATCH] Revert WindowBorder and WindowState value changes. Use Nullable types to detect when WindowBorder and WindowState is not set. --- Source/OpenTK/Platform/Windows/WinGLNative.cs | 12 ++++++++---- Source/OpenTK/WindowBorder.cs | 2 +- Source/OpenTK/WindowState.cs | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Source/OpenTK/Platform/Windows/WinGLNative.cs b/Source/OpenTK/Platform/Windows/WinGLNative.cs index 2cce1834..ba25740e 100644 --- a/Source/OpenTK/Platform/Windows/WinGLNative.cs +++ b/Source/OpenTK/Platform/Windows/WinGLNative.cs @@ -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 previous_window_border; // Set when changing to fullscreen state. + Nullable 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; } } } diff --git a/Source/OpenTK/WindowBorder.cs b/Source/OpenTK/WindowBorder.cs index 3fbd2367..2d94de03 100644 --- a/Source/OpenTK/WindowBorder.cs +++ b/Source/OpenTK/WindowBorder.cs @@ -12,7 +12,7 @@ namespace OpenTK /// /// The window has a resizable border. A window with a resizable border can be resized by the user or programmatically. /// - Resizable = 1, + Resizable = 0, /// /// The window has a fixed border. A window with a fixed border can only be resized programmatically. /// diff --git a/Source/OpenTK/WindowState.cs b/Source/OpenTK/WindowState.cs index 7afcadae..64a72612 100644 --- a/Source/OpenTK/WindowState.cs +++ b/Source/OpenTK/WindowState.cs @@ -20,7 +20,7 @@ namespace OpenTK /// /// The window is in its normal state. /// - Normal = 1, + Normal = 0, /// /// The window is minimized to the taskbar (also known as 'iconified'). ///