Browse Source

Linux: Use synchronous X11 error handling in debug builds

tags/2021-05-28
ed 4 years ago
parent
commit
7901eb6ca1
3 changed files with 13 additions and 0 deletions
  1. +1
    -0
      modules/juce_gui_basics/native/x11/juce_linux_X11_Symbols.cpp
  2. +4
    -0
      modules/juce_gui_basics/native/x11/juce_linux_X11_Symbols.h
  3. +8
    -0
      modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp

+ 1
- 0
modules/juce_gui_basics/native/x11/juce_linux_X11_Symbols.cpp View File

@@ -181,6 +181,7 @@ bool X11Symbols::loadAllSymbols()
makeSymbolBinding (xSetWMNormalHints, "XSetWMNormalHints"), makeSymbolBinding (xSetWMNormalHints, "XSetWMNormalHints"),
makeSymbolBinding (xStringListToTextProperty, "XStringListToTextProperty"), makeSymbolBinding (xStringListToTextProperty, "XStringListToTextProperty"),
makeSymbolBinding (xSync, "XSync"), makeSymbolBinding (xSync, "XSync"),
makeSymbolBinding (xSynchronize, "XSynchronize"),
makeSymbolBinding (xTranslateCoordinates, "XTranslateCoordinates"), makeSymbolBinding (xTranslateCoordinates, "XTranslateCoordinates"),
makeSymbolBinding (xrmUniqueQuark, "XrmUniqueQuark"), makeSymbolBinding (xrmUniqueQuark, "XrmUniqueQuark"),
makeSymbolBinding (xUngrabPointer, "XUngrabPointer"), makeSymbolBinding (xUngrabPointer, "XUngrabPointer"),


+ 4
- 0
modules/juce_gui_basics/native/x11/juce_linux_X11_Symbols.h View File

@@ -453,6 +453,10 @@ public:
(::Display*, Bool), (::Display*, Bool),
void) void)
JUCE_GENERATE_FUNCTION_WITH_DEFAULT (XSynchronize, xSynchronize,
(::Display*, Bool),
int)
JUCE_GENERATE_FUNCTION_WITH_DEFAULT (XTranslateCoordinates, xTranslateCoordinates, JUCE_GENERATE_FUNCTION_WITH_DEFAULT (XTranslateCoordinates, xTranslateCoordinates,
(::Display*, ::Window, ::Window, int, int, int*, int*, ::Window*), (::Display*, ::Window, ::Window, int, int, int*, int*, ::Window*),
Bool) Bool)


+ 8
- 0
modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp View File

@@ -30,6 +30,10 @@ namespace juce
#if JUCE_DEBUG && ! defined (JUCE_DEBUG_XERRORS) #if JUCE_DEBUG && ! defined (JUCE_DEBUG_XERRORS)
#define JUCE_DEBUG_XERRORS 1 #define JUCE_DEBUG_XERRORS 1
#if ! defined (JUCE_DEBUG_XERRORS_SYNCHRONOUSLY)
#define JUCE_DEBUG_XERRORS_SYNCHRONOUSLY 1
#endif
#endif #endif
#if JUCE_MODULE_AVAILABLE_juce_gui_extra #if JUCE_MODULE_AVAILABLE_juce_gui_extra
@@ -2719,6 +2723,10 @@ bool XWindowSystem::initialiseXDisplay()
if (display == nullptr) if (display == nullptr)
return false; return false;
#if JUCE_DEBUG_XERRORS_SYNCHRONOUSLY
X11Symbols::getInstance()->xSynchronize (display, True);
#endif
// Create a context to store user data associated with Windows we create // Create a context to store user data associated with Windows we create
windowHandleXContext = (XContext) X11Symbols::getInstance()->xrmUniqueQuark(); windowHandleXContext = (XContext) X11Symbols::getInstance()->xrmUniqueQuark();


Loading…
Cancel
Save