mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-07-15 13:52:23 +08:00
~ Keep original X messages as they're kind of useful for debugging
Signed-off-by: Alexis Maiquez Murcia <almamu@almamu.com>
This commit is contained in:
parent
28f0868caa
commit
f4988158ad
@ -13,6 +13,8 @@
|
|||||||
|
|
||||||
using namespace WallpaperEngine::Render;
|
using namespace WallpaperEngine::Render;
|
||||||
|
|
||||||
|
XErrorHandler originalErrorHandler;
|
||||||
|
|
||||||
void CustomXIOErrorExitHandler (Display* dsp, void* userdata)
|
void CustomXIOErrorExitHandler (Display* dsp, void* userdata)
|
||||||
{
|
{
|
||||||
auto context = static_cast <CContext*> (userdata);
|
auto context = static_cast <CContext*> (userdata);
|
||||||
@ -25,11 +27,15 @@ void CustomXIOErrorExitHandler (Display* dsp, void* userdata)
|
|||||||
context->initializeViewports ();
|
context->initializeViewports ();
|
||||||
}
|
}
|
||||||
|
|
||||||
int CustomXErrorHandler (Display* dsp, XErrorEvent* event)
|
int CustomXErrorHandler (Display* dpy, XErrorEvent* event)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
std::cerr << "Detected X error" << std::endl;
|
std::cerr << "Detected X error" << std::endl;
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
|
|
||||||
|
// call the original handler so we can keep some information reporting
|
||||||
|
originalErrorHandler (dpy, event);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,6 +44,7 @@ int CustomXIOErrorHandler (Display* dsp)
|
|||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
std::cerr << "Detected X IO error" << std::endl;
|
std::cerr << "Detected X IO error" << std::endl;
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,7 +72,7 @@ void CContext::initializeViewports ()
|
|||||||
#ifdef HAVE_XSETIOERROREXITHANDLER
|
#ifdef HAVE_XSETIOERROREXITHANDLER
|
||||||
XSetIOErrorExitHandler (this->m_display, CustomXIOErrorExitHandler, this);
|
XSetIOErrorExitHandler (this->m_display, CustomXIOErrorExitHandler, this);
|
||||||
#endif /* HAVE_XSETIOERROREXITHANDLER */
|
#endif /* HAVE_XSETIOERROREXITHANDLER */
|
||||||
XSetErrorHandler (CustomXErrorHandler);
|
originalErrorHandler = XSetErrorHandler (CustomXErrorHandler);
|
||||||
XSetIOErrorHandler (CustomXIOErrorHandler);
|
XSetIOErrorHandler (CustomXIOErrorHandler);
|
||||||
|
|
||||||
int xrandr_result, xrandr_error;
|
int xrandr_result, xrandr_error;
|
||||||
|
Loading…
Reference in New Issue
Block a user