From df3d5362c39dd775b170ef644a0678eb5fb1036a Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Sat, 3 May 2008 16:33:00 +0000 Subject: [PATCH] * Platform/X11/X11GraphicsMode.cs, Platform/X11/X11GLNative.cs, Platform/X11/Structs.cs, Platform/X11/Functions.cs, Platform/X11/API.cs: Working on WindowBorder and WindowState support. --- Source/OpenTK/Platform/X11/API.cs | 157 +++++--- Source/OpenTK/Platform/X11/Functions.cs | 8 + Source/OpenTK/Platform/X11/Structs.cs | 57 --- Source/OpenTK/Platform/X11/X11GLNative.cs | 365 +++++++++++++----- Source/OpenTK/Platform/X11/X11GraphicsMode.cs | 4 +- 5 files changed, 383 insertions(+), 208 deletions(-) diff --git a/Source/OpenTK/Platform/X11/API.cs b/Source/OpenTK/Platform/X11/API.cs index ea71a019..ea4ef7e3 100644 --- a/Source/OpenTK/Platform/X11/API.cs +++ b/Source/OpenTK/Platform/X11/API.cs @@ -86,9 +86,9 @@ namespace OpenTK.Platform.X11 screenCount = Functions.XScreenCount(DefaultDisplay); //Debug.Print("Default Display: {0}, Default Screen: {1}, Default Root Window: {2}, Screen Count: {3}", // DefaultDisplay, DefaultScreen, RootWindow, ScreenCount); - Debug.Print("Display connection: {0}, Screen count: {1}", DefaultDisplay, ScreenCount); + Debug.Print("Display connection: {0}, Screen count: {1}", DefaultDisplay, ScreenCount); } - + static void CurrentDomain_ProcessExit(object sender, EventArgs e) { if (defaultDisplay != IntPtr.Zero) @@ -288,7 +288,7 @@ namespace OpenTK.Platform.X11 /// The X server arbitrarily chooses the keysyms_per_keycode_return value to be large enough to report all requested symbols. A special KeySym value of NoSymbol is used to fill in unused elements for individual KeyCodes. To free the storage returned by XGetKeyboardMapping(), use XFree(). /// XGetKeyboardMapping() can generate a BadValue error. /// Diagnostics: - /// BadValue: Some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can generate this error. + /// BadValue: Some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can generate this error. /// [DllImport(_dll_name, EntryPoint = "XGetKeyboardMapping")] public static extern KeySym GetKeyboardMapping(Display display, KeyCode first_keycode, int keycode_count, @@ -718,23 +718,23 @@ XF86VidModeGetGammaRampSize( unsafe internal struct Screen { - XExtData ext_data; /* hook for extension to hang buffer */ - IntPtr display; /* back pointer to display structure */ /* _XDisplay */ - Window root; /* Root window id. */ - int width, height; /* width and height of screen */ - int mwidth, mheight; /* width and height of in millimeters */ - int ndepths; /* number of depths possible */ - //Depth *depths; /* list of allowable depths on the screen */ - int root_depth; /* bits per pixel */ - //Visual* root_visual; /* root visual */ - IntPtr default_gc; /* GC for the root root visual */ // GC - Colormap cmap; /* default color map */ - UIntPtr white_pixel; // unsigned long - UIntPtr black_pixel; /* White and Black pixel values */ // unsigned long - int max_maps, min_maps; /* max and min color maps */ - int backing_store; /* Never, WhenMapped, Always */ - Bool save_unders; - long root_input_mask; /* initial root input mask */ + XExtData ext_data; /* hook for extension to hang buffer */ + IntPtr display; /* back pointer to display structure */ /* _XDisplay */ + Window root; /* Root window id. */ + int width, height; /* width and height of screen */ + int mwidth, mheight; /* width and height of in millimeters */ + int ndepths; /* number of depths possible */ + //Depth *depths; /* list of allowable depths on the screen */ + int root_depth; /* bits per pixel */ + //Visual* root_visual; /* root visual */ + IntPtr default_gc; /* GC for the root root visual */ // GC + Colormap cmap; /* default color map */ + UIntPtr white_pixel; // unsigned long + UIntPtr black_pixel; /* White and Black pixel values */ // unsigned long + int max_maps, min_maps; /* max and min color maps */ + int backing_store; /* Never, WhenMapped, Always */ + Bool save_unders; + long root_input_mask; /* initial root input mask */ } #pragma warning restore 0169 @@ -743,19 +743,78 @@ XF86VidModeGetGammaRampSize( #region unsafe internal class XExtData -#pragma warning disable 0169 - unsafe internal class XExtData { - int number; /* number returned by XRegisterExtension */ - XExtData next; /* next item on list of buffer for structure */ - delegate int FreePrivateDelegate(XExtData extension); + int number; /* number returned by XRegisterExtension */ + XExtData next; /* next item on list of buffer for structure */ + delegate int FreePrivateDelegate(XExtData extension); FreePrivateDelegate FreePrivate; /* called to free private storage */ - XPointer private_data; /* buffer private to this extension. */ + XPointer private_data; /* buffer private to this extension. */ }; - #pragma warning restore 0169 + #pragma warning restore 0169, 0649 + #endregion + + #region Motif + + [StructLayout(LayoutKind.Sequential)] + internal struct MotifWmHints + { + internal IntPtr flags; + internal IntPtr functions; + internal IntPtr decorations; + internal IntPtr input_mode; + internal IntPtr status; + + public override string ToString () + { + return string.Format("MotifWmHints private void RegisterAtoms(X11WindowInfo window) { - Debug.WriteLine("Registering atoms."); + Debug.WriteLine("Registering atoms."); + _atom_wm_destroy = Functions.XInternAtom(window.Display, "WM_DELETE_WINDOW", true); - _atom_wm_state = Functions.XInternAtom(window.Display, "_NET_WM_STATE", false); - _atom_wm_state_minimized = Functions.XInternAtom(window.Display, "_NET_WM_STATE_MINIMIZED", false); - _atom_wm_state_fullscreen = Functions.XInternAtom(window.Display, "_NET_WM_STATE_FULLSCREEN", false); - _atom_wm_state_maximized_horizontal = + _atom_net_wm_state = Functions.XInternAtom(window.Display, "_NET_WM_STATE", false); + _atom_net_wm_state_minimized = Functions.XInternAtom(window.Display, "_NET_WM_STATE_MINIMIZED", false); + _atom_net_wm_state_fullscreen = Functions.XInternAtom(window.Display, "_NET_WM_STATE_FULLSCREEN", false); + _atom_net_wm_state_maximized_horizontal = Functions.XInternAtom(window.Display, "_NET_WM_STATE_MAXIMIZED_HORZ", false); - _atom_wm_state_maximized_vertical = + _atom_net_wm_state_maximized_vertical = Functions.XInternAtom(window.Display, "_NET_WM_STATE_MAXIMIZED_VERT", false); - + + _atom_net_wm_allowed_actions = + Functions.XInternAtom(window.Display, "_NET_WM_ALLOWED_ACTIONS", false); + _atom_net_wm_action_resize = + Functions.XInternAtom(window.Display, "_NET_WM_ACTION_RESIZE", false); + _atom_net_wm_action_maximize_horizontally = + Functions.XInternAtom(window.Display, "_NET_WM_ACTION_MAXIMIZE_HORZ", false); + _atom_net_wm_action_maximize_vertically = + Functions.XInternAtom(window.Display, "_NET_WM_ACTION_MAXIMIZE_VERT", false); + // string[] atom_names = new string[] // { // //"WM_TITLE", @@ -218,20 +246,21 @@ namespace OpenTK.Platform.X11 } context = new GraphicsContext(mode, window); - // Set the window hints + // Set the window hints + SetWindowMinMax(_min_width, _min_height, -1, -1); + XSizeHints hints = new XSizeHints(); hints.x = 0; hints.y = 0; hints.width = width; hints.height = height; - hints.flags = (IntPtr)(XSizeHintsFlags.USSize | XSizeHintsFlags.USPosition); + hints.flags = (IntPtr)(XSizeHintsFlags.USSize);// | XSizeHintsFlags.USPosition); lock (API.Lock) { Functions.XSetWMNormalHints(window.Display, window.WindowHandle, ref hints); // Register for window destroy notification - IntPtr wm_destroy_atom = Functions.XInternAtom(window.Display, "WM_DELETE_WINDOW", true); - Functions.XSetWMProtocols(window.Display, window.WindowHandle, new IntPtr[] { wm_destroy_atom }, 1); + Functions.XSetWMProtocols(window.Display, window.WindowHandle, new IntPtr[] { _atom_wm_destroy }, 1); } Top = Left = 0; Right = Width; @@ -253,11 +282,22 @@ namespace OpenTK.Platform.X11 //context.CreateContext(true, null); - driver = new X11Input(window); - + driver = new X11Input(window); + + // HACK: This seems to reduce thread issues on Linux, due to race conditions. + // It does *not* solve the root cause, which is unknown at this point. + // + // What I suspect happens, is that either the glXChooseContext or glXCreateContext functions are called + // before the window is ready - or maybe before the window size is set which renders the viewport invalid? + // (can this happen?) or that there are pending events that somehow botch context creation up (seems like + // the fglrx driver is spawning a new thread, or waiting on something?) + // This issue *must* be resolved before the 1.0 release. + // Note that this has the side effect that sometimes, a resize event is missed. + //Functions.XSync(window.Display, true); + Debug.WriteLine("X11GLNative window created successfully!"); Debug.Unindent(); - + exists = true; } @@ -293,8 +333,13 @@ namespace OpenTK.Platform.X11 // A child was was created - nothing to do break; - case XEventName.ClientMessage: - this.OnDestroy(EventArgs.Empty); + case XEventName.ClientMessage: + if (e.ClientMessageEvent.ptr1 == _atom_wm_destroy) + this.OnDestroy(EventArgs.Empty); + else + Debug.Print("Niar"); + + break; case XEventName.DestroyNotify: @@ -607,21 +652,21 @@ namespace OpenTK.Platform.X11 bool minimized = false; Functions.XGetWindowProperty(window.Display, window.WindowHandle, - _atom_wm_state, IntPtr.Zero, new IntPtr (256), false, + _atom_net_wm_state, IntPtr.Zero, new IntPtr (256), false, IntPtr.Zero, out actual_atom, out actual_format, out nitems, out bytes_after, ref prop); if ((long)nitems > 0 && prop != IntPtr.Zero) { - Debug.Print("nitems: {0}", nitems.ToString()); for (int i = 0; i < (long)nitems; i++) { atom = (IntPtr)Marshal.ReadIntPtr(prop, i * IntPtr.Size); - if (atom == _atom_wm_state_maximized_horizontal || atom == _atom_wm_state_maximized_vertical) + if (atom == _atom_net_wm_state_maximized_horizontal || + atom == _atom_net_wm_state_maximized_vertical) maximized++; - else if (atom == _atom_wm_state_minimized) + else if (atom == _atom_net_wm_state_minimized) minimized = true; - else if (atom == _atom_wm_state_fullscreen) + else if (atom == _atom_net_wm_state_fullscreen) fullscreen = true; } Functions.XFree(prop); @@ -655,15 +700,15 @@ namespace OpenTK.Platform.X11 Functions.XMapWindow(window.Display, window.WindowHandle); else if (current_state == OpenTK.WindowState.Fullscreen) { - WindowBorder = _previous_window_border; - Functions.SendNetWMMessage(window, _atom_wm_state, _atom_state_remove, - _atom_wm_state_fullscreen, + //WindowBorder = _previous_window_border; + Functions.SendNetWMMessage(window, _atom_net_wm_state, _atom_remove, + _atom_net_wm_state_fullscreen, IntPtr.Zero); } else if (current_state == OpenTK.WindowState.Maximized) - Functions.SendNetWMMessage(window, _atom_wm_state, _atom_state_toggle, - _atom_wm_state_maximized_horizontal, - _atom_wm_state_maximized_vertical); + Functions.SendNetWMMessage(window, _atom_net_wm_state, _atom_toggle, + _atom_net_wm_state_maximized_horizontal, + _atom_net_wm_state_maximized_vertical); switch (value) { @@ -673,12 +718,23 @@ namespace OpenTK.Platform.X11 break; case OpenTK.WindowState.Maximized: - Functions.SendNetWMMessage(window, _atom_wm_state, _atom_state_add, - _atom_wm_state_maximized_horizontal, - _atom_wm_state_maximized_vertical); + // We can't resize the window if its border is fixed, so make it resizable first. + bool temporary_resizable = false; + if (WindowBorder == WindowBorder.Fixed) + { + temporary_resizable = true; + WindowBorder = WindowBorder.Resizable; + } + + Functions.SendNetWMMessage(window, _atom_net_wm_state, _atom_add, + _atom_net_wm_state_maximized_horizontal, + _atom_net_wm_state_maximized_vertical); Functions.XRaiseWindow(window.Display, window.WindowHandle); + if (temporary_resizable) + WindowBorder = WindowBorder.Fixed; + break; case WindowState.Minimized: @@ -688,11 +744,11 @@ namespace OpenTK.Platform.X11 break; case WindowState.Fullscreen: - _previous_window_border = this.WindowBorder; - this.WindowBorder = WindowBorder.Hidden; + //_previous_window_border = this.WindowBorder; + //this.WindowBorder = WindowBorder.Hidden; - Functions.SendNetWMMessage(window, _atom_wm_state, _atom_state_add, - _atom_wm_state_fullscreen, IntPtr.Zero); + Functions.SendNetWMMessage(window, _atom_net_wm_state, _atom_add, + _atom_net_wm_state_fullscreen, IntPtr.Zero); break; } @@ -707,18 +763,134 @@ namespace OpenTK.Platform.X11 { get { - return _window_border; + //return _window_border; + IntPtr actual_atom; + int actual_format; + IntPtr nitems; + IntPtr bytes_after; + IntPtr prop = IntPtr.Zero; + IntPtr atom; + XWindowAttributes attributes; + bool resizable = false, hidden = false; + +// IntPtr transient; // The window for which X11GLWindow is transient, if any. +// +// Functions.XGetTransientForHint(window.Display, window.WindowHandle, out transient); +// if (transient != IntPtr.Zero) +// return WindowBorder.Hidden; + + if (_decorations_hidden) + return WindowBorder.Hidden; + + Functions.XGetWindowProperty(window.Display, window.WindowHandle, + _atom_net_wm_allowed_actions, IntPtr.Zero, new IntPtr (256), false, + IntPtr.Zero, out actual_atom, out actual_format, out nitems, out bytes_after, ref prop); + + if ((long)nitems > 0 && prop != IntPtr.Zero) + { + for (int i = 0; i < (long)nitems; i++) + { + atom = (IntPtr)Marshal.ReadIntPtr(prop, i * IntPtr.Size); + + if (atom == _atom_net_wm_action_resize) + resizable = true; + //else if (atom + //return WindowBorder.Resizable; + +// if (atom == _atom_wm_state_maximized_horizontal || atom == _atom_wm_state_maximized_vertical) +// maximized++; +// else if (atom == _atom_wm_state_minimized) +// minimized = true; +// else if (atom == _atom_wm_state_fullscreen) +// fullscreen = true; + } + Functions.XFree(prop); + } + + if (resizable) + return WindowBorder.Resizable; + else + return WindowBorder.Fixed; + } set { - _window_border = value; - //Functions.XChangeProperty(window.Display, window.WindowHandle, + if (WindowBorder == value) + return; + + if (WindowBorder == WindowBorder.Hidden) + { + EnableWindowDecorations(); +// int error = Functions.XSetTransientForHint(window.Display, window.WindowHandle, IntPtr.Zero); +// if (error == 0) +// Debug.Print("Error"); + } + + + switch (value) + { + case WindowBorder.Fixed: + Debug.Print("Making WindowBorder fixed."); + SetWindowMinMax((short)Width, (short)Height, (short)Width, (short)Height); + + break; + + case WindowBorder.Resizable: + Debug.Print("Making WindowBorder resizable."); + SetWindowMinMax(_min_width, _min_height, -1, -1); + + break; + + case WindowBorder.Hidden: + Debug.Print("Making WindowBorder hidden."); + DisableWindowDecorations(); + //Functions.XSetTransientForHint(window.Display, window.WindowHandle, window.RootWindow); + break; + } + +// Functions.SendNetWMMessage(window, _atom_wm_state, _atom_state_add, +// _atom_wm_state_fullscreen, IntPtr.Zero); } } - #endregion - - #endregion + #endregion + + #endregion + + void SetWindowMinMax(short min_width, short min_height, short max_width, short max_height) + { + IntPtr dummy; + XSizeHints hints = new XSizeHints(); + + Functions.XGetWMNormalHints(window.Display, window.WindowHandle, ref hints, out dummy); + + if (min_width > 0 || min_height > 0) + { + hints.flags = (IntPtr)((int)hints.flags | (int)XSizeHintsFlags.PMinSize); + hints.min_width = min_width; + hints.min_height = min_height; + } + else + hints.flags = (IntPtr)((int)hints.flags & ~(int)XSizeHintsFlags.PMinSize); + + if (max_width > 0 || max_height > 0) + { + hints.flags = (IntPtr)((int)hints.flags | (int)XSizeHintsFlags.PMaxSize); + hints.max_width = max_width; + hints.max_height = max_height; + } + else + hints.flags = (IntPtr)((int)hints.flags & ~(int)XSizeHintsFlags.PMaxSize); + + + if (hints.flags != IntPtr.Zero) + { + // The Metacity team has decided that they won't care about this when clicking the maximize + // icon, will maximize the window to fill the screen/parent no matter what. + // http://bugzilla.ximian.com/show_bug.cgi?id=80021 + Functions.XSetWMNormalHints(window.Display, window.WindowHandle, ref hints); + } + } #region --- IResizable Members --- @@ -868,18 +1040,24 @@ namespace OpenTK.Platform.X11 #region void DisableWindowDecorations() void DisableWindowDecorations() - { - bool removed = false; - if (DisableMotifDecorations()) { Debug.Print("Removed decorations through motif."); removed = true; } - if (DisableGnomeDecorations()) { Debug.Print("Removed decorations through gnome."); removed = true; } - if (DisableIccmDecorations()) { Debug.Print("Removed decorations through ICCM."); removed = true; } + { + if (DisableMotifDecorations()) + { + Debug.Print("Removed decorations through motif."); + _decorations_hidden = true; + } + + //bool removed = false; + //if (DisableMotifDecorations()) { Debug.Print("Removed decorations through motif."); removed = true; } + //if (DisableGnomeDecorations()) { Debug.Print("Removed decorations through gnome."); removed = true; } + //if (DisableIccmDecorations()) { Debug.Print("Removed decorations through ICCM."); removed = true; } - if (removed) - { - Functions.XSetTransientForHint(this.window.Display, this.Handle, this.window.RootWindow); - Functions.XUnmapWindow(this.window.Display, this.Handle); - Functions.XMapWindow(this.window.Display, this.Handle); - } + //if (removed) + //{ + // Functions.XSetTransientForHint(this.window.Display, this.Handle, this.window.RootWindow); + // Functions.XUnmapWindow(this.window.Display, this.Handle); + // Functions.XMapWindow(this.window.Display, this.Handle); + //} } #region bool DisableMotifDecorations() @@ -891,8 +1069,8 @@ namespace OpenTK.Platform.X11 { MotifWmHints hints = new MotifWmHints(); hints.flags = (IntPtr)MotifFlags.Decorations; - Functions.XChangeProperty(this.window.Display, this.Handle, atom, atom, 32, PropertyMode.Replace, ref hints, 5 - /*Marshal.SizeOf(hints) / 4*/); + Functions.XChangeProperty(this.window.Display, this.Handle, atom, atom, 32, PropertyMode.Replace, + ref hints, /*Marshal.SizeOf(hints) / 4*/ 5); return true; } return false; @@ -904,30 +1082,12 @@ namespace OpenTK.Platform.X11 bool DisableGnomeDecorations() { - // Attempt to cover gnome panels. - //XEvent xev = new XEvent(); - //xev.ClientMessageEvent.window = this.window.Handle; - //xev.ClientMessageEvent.type = XEventName.ClientMessage; - //xev.ClientMessageEvent.message_type = Functions.XInternAtom(this.window.Display, Constants.XA_WIN_LAYER, false); - //xev.ClientMessageEvent.format = 32; - //xev.ClientMessageEvent.ptr1 = (IntPtr)WindowLayer.AboveDock; - //Functions.XSendEvent(this.window.Display, this.window.RootWindow, false, (IntPtr)EventMask.SubstructureNotifyMask, ref xev); - - //xev = new XEvent(); - //xev.ClientMessageEvent.window = this.window.Handle; - //xev.ClientMessageEvent.type = XEventName.ClientMessage; - //xev.ClientMessageEvent.message_type = Functions.XInternAtom(this.window.Display, Constants.XA_WIN_STATE, false); - //xev.ClientMessageEvent.format = 32; - //xev.ClientMessageEvent.ptr1 = (IntPtr)WindowState.; - //xev.ClientMessageEvent.ptr2 = (IntPtr)WindowLayer.AboveDock; - //Functions.XSendEvent(this.window.Display, this.window.RootWindow, false, (IntPtr)EventMask.SubstructureNotifyMask, ref xev); - IntPtr atom = Functions.XInternAtom(this.window.Display, Constants.XA_WIN_HINTS, true); if (atom != IntPtr.Zero) { IntPtr hints = IntPtr.Zero; - Functions.XChangeProperty(this.window.Display, this.Handle, atom, atom, 32, PropertyMode.Replace, ref hints, - /*Marshal.SizeOf(hints) / 4*/ 1); + Functions.XChangeProperty(this.window.Display, this.Handle, atom, atom, 32, PropertyMode.Replace, + ref hints, /*Marshal.SizeOf(hints) / 4*/ 1); return true; } @@ -944,8 +1104,8 @@ namespace OpenTK.Platform.X11 if (atom != IntPtr.Zero) { IntPtr hints = Functions.XInternAtom(this.window.Display, "_NET_WM_STATE_FULLSCREEN", true); - Functions.XChangeProperty(this.window.Display, this.Handle, atom, atom, 32, PropertyMode.Replace, ref hints, 1 - /*Marshal.SizeOf(hints) / 4*/); + Functions.XChangeProperty(this.window.Display, this.Handle, atom, atom, 32, PropertyMode.Replace, + ref hints, /*Marshal.SizeOf(hints) / 4*/ 1); return true; } return false; @@ -958,18 +1118,23 @@ namespace OpenTK.Platform.X11 #region void EnableWindowDecorations() void EnableWindowDecorations() - { - bool activated = false; - if (EnableMotifDecorations()) { Debug.Print("Activated decorations through motif."); activated = true; } - if (EnableGnomeDecorations()) { Debug.Print("Activated decorations through gnome."); activated = true; } - if (EnableIccmDecorations()) { Debug.Print("Activated decorations through ICCM."); activated = true; } + { + if (EnableMotifDecorations()) + { + Debug.Print("Activated decorations through motif."); + _decorations_hidden = false; + } + //bool activated = false; + //if (EnableMotifDecorations()) { Debug.Print("Activated decorations through motif."); activated = true; } + //if (EnableGnomeDecorations()) { Debug.Print("Activated decorations through gnome."); activated = true; } + //if (EnableIccmDecorations()) { Debug.Print("Activated decorations through ICCM."); activated = true; } - if (activated) - { - Functions.XSetTransientForHint(this.window.Display, this.Handle, this.window.RootWindow); - Functions.XUnmapWindow(this.window.Display, this.Handle); - Functions.XMapWindow(this.window.Display, this.Handle); - } + //if (activated) + //{ + // Functions.XSetTransientForHint(this.window.Display, this.Handle, this.window.RootWindow); + // Functions.XUnmapWindow(this.window.Display, this.Handle); + // Functions.XMapWindow(this.window.Display, this.Handle); + //} } #region bool EnableMotifDecorations() @@ -1022,8 +1187,8 @@ namespace OpenTK.Platform.X11 IntPtr hint = Functions.XInternAtom(this.window.Display, "_NET_WM_WINDOW_TYPE_NORMAL", true); if (hint != IntPtr.Zero) { - Functions.XChangeProperty(this.window.Display, this.Handle, hint, /*XA_ATOM*/(IntPtr)4, 32, PropertyMode.Replace, - ref hint, Marshal.SizeOf(hint) / 4); + Functions.XChangeProperty(this.window.Display, this.Handle, hint, /*XA_ATOM*/(IntPtr)4, 32, + PropertyMode.Replace, hint, Marshal.SizeOf(hint) / 4); } return true; } diff --git a/Source/OpenTK/Platform/X11/X11GraphicsMode.cs b/Source/OpenTK/Platform/X11/X11GraphicsMode.cs index 86864c91..341d48fa 100644 --- a/Source/OpenTK/Platform/X11/X11GraphicsMode.cs +++ b/Source/OpenTK/Platform/X11/X11GraphicsMode.cs @@ -84,7 +84,7 @@ namespace OpenTK.Platform.X11 try { - Functions.XLockDisplay(display); + //Functions.XLockDisplay(display); int screen = Functions.XDefaultScreen(display); IntPtr root = Functions.XRootWindow(display, screen); @@ -122,7 +122,7 @@ namespace OpenTK.Platform.X11 } finally { - Functions.XUnlockDisplay(display); + //Functions.XUnlockDisplay(display); } // Prepare Windows.Forms for creating OpenGL drawables.