Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp
- index 62cf554..d547b71 100644
- --- a/xbmc/windowing/X11/WinSystemX11.cpp
- +++ b/xbmc/windowing/X11/WinSystemX11.cpp
- @@ -42,6 +42,32 @@
- using namespace std;
- +/* X11 Error handler and error functions */
- +static int x11_error_code = 0;
- +static int (*x11_old_error_handler)(Display *, XErrorEvent *);
- +
- +static int x11_error_handler(Display *dpy, XErrorEvent *error)
- +{
- + x11_error_code = error->error_code;
- + return 0;
- +}
- +
- +static void x11_trap_errors(void)
- +{
- + x11_error_code = 0;
- + x11_old_error_handler = XSetErrorHandler(x11_error_handler);
- +}
- +
- +static int x11_untrap_errors(void)
- +{
- + XSetErrorHandler(x11_old_error_handler);
- + if(x11_error_code)
- + {
- + CLog::Log(LOGERROR, "XLIB Error catched err(0x%08x)\n", x11_error_code);
- + }
- + return x11_error_code;
- +}
- +
- CWinSystemX11::CWinSystemX11() : CWinSystemBase()
- {
- m_eWindowSystem = WINDOW_SYSTEM_X11;
- @@ -471,8 +497,14 @@ void CWinSystemX11::CheckDisplayEvents()
- bool bGotEvent(false);
- bool bTimeout(false);
- XEvent Event;
- - while (XCheckTypedEvent(m_dpy, m_RREventBase + RRScreenChangeNotify, &Event))
- + bool bEvent = true;
- + while (true)
- {
- + x11_trap_errors();
- + bool bEvent = XCheckTypedEvent(m_dpy, m_RREventBase + RRScreenChangeNotify, &Event);
- + if(x11_untrap_errors() || !bEvent)
- + break;
- +
- if (Event.type == m_RREventBase + RRScreenChangeNotify)
- {
- CLog::Log(LOGDEBUG, "%s: Received RandR event %i", __FUNCTION__, Event.type);
Add Comment
Please, Sign In to add comment