zahirtezcan's picture

X Window check should consider running on Windows

Project:The Open Toolkit library
Category:bug report

In static constructor of Configuration class, there is a code segment like this:

 // Detect whether X is present.
            // Hack: it seems that this check will cause X to initialize itself on Mac OS X Leopard and newer.
            // We don't want that (we'll be using the native interfaces anyway), so we'll avoid this check
            // when we detect Mac OS X.
            if (!RunningOnMacOS)
                try { runningOnX11 = OpenTK.Platform.X11.API.DefaultDisplay != IntPtr.Zero; }
                catch { }

Shouldn't that if statement contain && !runningOnWindows ? Windows platform is checked and runningOnWindows is true, but still checks for X Window. While debugging on VS i get 3 exceptions (one for EGL and 2 for X11 API), and this kind of fix will remove 2 of them i guess. Although, the exceptions are just breakpoints for the debugger but it is still annoying

note: i know about the exceptions menu item in debug menu, but it removes the all exceptions of same type, and i won't want to miss "TypeInitializationException"s


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jdomnitz's picture


Status:open» confirmed

Fixing this does indeed get rid of the exceptions (and speed up window creation) with no negative effects.