From f785209fbf1f975b3b9a2116cf18cb87cacf8e80 Mon Sep 17 00:00:00 2001 From: Jerome St-Louis Date: Tue, 2 Aug 2016 23:07:36 -0400 Subject: [PATCH] ecere/gui/Window: Fixed lock-up closing code editor while Finding in Files on Unix --- ecere/src/gui/Window.ec | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/ecere/src/gui/Window.ec b/ecere/src/gui/Window.ec index 3617f72..182c359 100644 --- a/ecere/src/gui/Window.ec +++ b/ecere/src/gui/Window.ec @@ -42,6 +42,37 @@ import "MessageBox" import "WindowList" import "i18n" +#if (defined(__unix__) || defined(__APPLE__)) && !defined(__ANDROID__) && !defined(__EMSCRIPTEN__) +#define property _property +#define new _new +#define class _class +#define uint _uint + +#define Window X11Window +#define Cursor X11Cursor +#define Font X11Font +#define Display X11Display +#define Time X11Time +#define KeyCode X11KeyCode +#define Picture X11Picture + +#include + +#undef Window +#undef Cursor +#undef Font +#undef Display +#undef Time +#undef KeyCode +#undef Picture + +#undef uint +#undef new +#undef property +#undef class + +#endif + // Had to define this here for native decorations support, because the menu bar is part of total decoration's size, but not part of the system decorations #ifdef HIGH_DPI define skinMenuHeight = 40; @@ -585,11 +616,20 @@ private: if(fileMonitor) { int i, lockCount = guiApp.lockMutex.lockCount; +#if (defined(__unix__) || defined(__APPLE__)) && !defined(__ANDROID__) && !defined(__EMSCRIPTEN__) + if(xGlobalDisplay) + XUnlockDisplay(xGlobalDisplay); +#endif + for(i = 0; i < lockCount; i++) guiApp.lockMutex.Release(); delete fileMonitor; for(i = 0; i < lockCount; i++) guiApp.lockMutex.Wait(); +#if (defined(__unix__) || defined(__APPLE__)) && !defined(__ANDROID__) && !defined(__EMSCRIPTEN__) + if(xGlobalDisplay) + XLockDisplay(xGlobalDisplay); +#endif } #endif -- 1.8.3.1