xbmc-pvr: add patch to use XSetErrorHandler() so libX11 doesnt call exit()

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2012-02-06 22:03:00 +01:00
parent 55e293a562
commit b79be47c1b

View File

@ -0,0 +1,38 @@
diff -Naur xbmc-f76c547/xbmc/windowing/X11/WinSystemX11.cpp xbmc-f76c547.patch/xbmc/windowing/X11/WinSystemX11.cpp
--- xbmc-f76c547/xbmc/windowing/X11/WinSystemX11.cpp 2012-02-06 15:19:03.037732518 +0100
+++ xbmc-f76c547.patch/xbmc/windowing/X11/WinSystemX11.cpp 2012-02-06 15:18:37.545260709 +0100
@@ -55,6 +55,8 @@
m_bWasFullScreenBeforeMinimize = false;
m_dpyLostTime = 0;
m_internalModeSwitch = false;
+
+ XSetErrorHandler(XErrorHandler);
}
CWinSystemX11::~CWinSystemX11()
@@ -596,4 +598,14 @@
m_resources.erase(i);
}
+int CWinSystemX11::XErrorHandler(Display* dpy, XErrorEvent* error)
+{
+ char buf[1024];
+ XGetErrorText(error->display, error->error_code, buf, sizeof(buf));
+ CLog::Log(LOGERROR, "CWinSystemX11::XErrorHandler: %s, type:%i, serial:%lu, error_code:%i, request_code:%i minor_code:%i",
+ buf, error->type, error->serial, (int)error->error_code, (int)error->request_code, (int)error->minor_code);
+
+ return 0;
+}
+
#endif
diff -Naur xbmc-f76c547/xbmc/windowing/X11/WinSystemX11.h xbmc-f76c547.patch/xbmc/windowing/X11/WinSystemX11.h
--- xbmc-f76c547/xbmc/windowing/X11/WinSystemX11.h 2012-02-06 15:19:03.038732537 +0100
+++ xbmc-f76c547.patch/xbmc/windowing/X11/WinSystemX11.h 2012-02-06 15:17:16.253756180 +0100
@@ -84,6 +84,7 @@
private:
bool IsSuitableVisual(XVisualInfo *vInfo);
+ static int XErrorHandler(Display* dpy, XErrorEvent* error);
CStopWatch m_screensaverReset;
};