From: thefiddler Date: Fri, 18 Jul 2014 15:16:27 +0000 (+0200) Subject: [X11] Workaround for issue #146 X-Git-Tag: 2.0-0~111^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a13a2f8e666d583872d3d814f404578e6ef4aa74;p=platform%2Fcore%2Fcsapi%2Fopentk.git [X11] Workaround for issue #146 Windows are now unmapped before being destroyed. --- diff --git a/Source/OpenTK/Platform/X11/X11GLNative.cs b/Source/OpenTK/Platform/X11/X11GLNative.cs index c1de141..9ae0784 100644 --- a/Source/OpenTK/Platform/X11/X11GLNative.cs +++ b/Source/OpenTK/Platform/X11/X11GLNative.cs @@ -825,7 +825,7 @@ namespace OpenTK.Platform.X11 case XEventName.ClientMessage: if (!isExiting && e.ClientMessageEvent.ptr1 == _atom_wm_destroy) { - Debug.WriteLine("Exit message received."); + Debug.Print("[X11] Exit message received for window {0:X} on display {1:X}", window.Handle, window.Display); CancelEventArgs ce = new CancelEventArgs(); OnClosing(ce); @@ -1624,6 +1624,8 @@ namespace OpenTK.Platform.X11 public void Exit() { + Debug.Print("[X11] Sending exit message window {0:X} on display {1:X}", window.Handle, window.Display); + XEvent ev = new XEvent(); ev.type = XEventName.ClientMessage; ev.ClientMessageEvent.format = 32; @@ -1644,10 +1646,12 @@ namespace OpenTK.Platform.X11 public void DestroyWindow() { - Debug.WriteLine("X11GLNative shutdown sequence initiated."); + Debug.Print("[X11] Destroying window {0:X} on display {1:X}", window.Handle, window.Display); + using (new XLock(window.Display)) { - Functions.XSync(window.Display, true); + Functions.XUnmapWindow(window.Display, window.Handle); + Functions.XSync(window.Display, false); Functions.XDestroyWindow(window.Display, window.Handle); exists = false; }