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 (xStringListToTextProperty, "XStringListToTextProperty"),
makeSymbolBinding (xSync, "XSync"),
makeSymbolBinding (xSynchronize, "XSynchronize"),
makeSymbolBinding (xTranslateCoordinates, "XTranslateCoordinates"),
makeSymbolBinding (xrmUniqueQuark, "XrmUniqueQuark"),
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),
void)
JUCE_GENERATE_FUNCTION_WITH_DEFAULT (XSynchronize, xSynchronize,
(::Display*, Bool),
int)
JUCE_GENERATE_FUNCTION_WITH_DEFAULT (XTranslateCoordinates, xTranslateCoordinates,
(::Display*, ::Window, ::Window, int, int, int*, int*, ::Window*),
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)
#define JUCE_DEBUG_XERRORS 1
#if ! defined (JUCE_DEBUG_XERRORS_SYNCHRONOUSLY)
#define JUCE_DEBUG_XERRORS_SYNCHRONOUSLY 1
#endif
#endif
#if JUCE_MODULE_AVAILABLE_juce_gui_extra
@@ -2719,6 +2723,10 @@ bool XWindowSystem::initialiseXDisplay()
if (display == nullptr)
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
windowHandleXContext = (XContext) X11Symbols::getInstance()->xrmUniqueQuark();


Loading…
Cancel
Save