Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/SFML/Window/Linux/Display.cpp b/src/SFML/Window/Linux/Display.cpp
- index 2420268..f46e525 100644
- --- a/src/SFML/Window/Linux/Display.cpp
- +++ b/src/SFML/Window/Linux/Display.cpp
- @@ -26,6 +26,7 @@
- // Headers
- ////////////////////////////////////////////////////////////
- #include <SFML/Window/Linux/Display.hpp>
- +#include <X11/Xlib.h>
- #include <cassert>
- @@ -43,6 +44,9 @@ namespace priv
- ////////////////////////////////////////////////////////////
- Display* OpenDisplay()
- {
- + // Ensure thread-safety
- + XInitThreads();
- +
- if (referenceCount == 0)
- sharedDisplay = XOpenDisplay(NULL);
- referenceCount++;
- diff --git a/src/SFML/Window/Linux/VideoModeImpl.cpp b/src/SFML/Window/Linux/VideoModeImpl.cpp
- index 0b8aca8..8c439f0 100644
- --- a/src/SFML/Window/Linux/VideoModeImpl.cpp
- +++ b/src/SFML/Window/Linux/VideoModeImpl.cpp
- @@ -42,6 +42,9 @@ std::vector<VideoMode> VideoModeImpl::getFullscreenModes()
- {
- std::vector<VideoMode> modes;
- + // Ensure thread-safety
- + XInitThreads();
- +
- // Open a connection with the X server
- Display* display = OpenDisplay();
- if (display)
- @@ -119,6 +122,9 @@ VideoMode VideoModeImpl::getDesktopMode()
- {
- VideoMode desktopMode;
- + // Ensure thread-safety
- + XInitThreads();
- +
- // Open a connection with the X server
- Display* display = OpenDisplay();
- if (display)
- diff --git a/src/SFML/Window/Linux/WindowImplX11.cpp b/src/SFML/Window/Linux/WindowImplX11.cpp
- index 3cf2293..b38e6e6 100644
- --- a/src/SFML/Window/Linux/WindowImplX11.cpp
- +++ b/src/SFML/Window/Linux/WindowImplX11.cpp
- @@ -30,6 +30,7 @@
- #include <SFML/Window/Linux/Display.hpp>
- #include <SFML/System/Utf.hpp>
- #include <SFML/System/Err.hpp>
- +#include <X11/Xlib.h>
- #include <X11/Xutil.h>
- #include <X11/keysym.h>
- #include <X11/extensions/Xrandr.h>
- @@ -72,6 +73,9 @@ m_oldVideoMode(-1),
- m_hiddenCursor(0),
- m_keyRepeat (true)
- {
- + // Ensure thread-safety
- + XInitThreads();
- +
- // Open a connection with the X server
- m_display = OpenDisplay();
- m_screen = DefaultScreen(m_display);
- @@ -101,6 +105,9 @@ m_oldVideoMode(-1),
- m_hiddenCursor(0),
- m_keyRepeat (true)
- {
- + // Ensure thread-safety
- + XInitThreads();
- +
- // Open a connection with the X server
- m_display = OpenDisplay();
- m_screen = DefaultScreen(m_display);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement