bug 1331320 install X11 error handler through Xlib in plugin process as GTK2 does not use g_error r=glandium

MozReview-Commit-ID: 9Io2fABc2hI

--HG--
extra : rebase_source : 7da1b83d5003d49d0eaddd94509f50a40c043825
This commit is contained in:
Karl Tomlinson 2017-01-13 20:50:58 +13:00
parent 95e2f855f2
commit 671fdc9bae
4 changed files with 10 additions and 5 deletions

View File

@ -24,6 +24,7 @@
#include "nsXULAppAPI.h"
#ifdef MOZ_X11
# include "nsX11ErrorHandler.h"
# include "mozilla/X11Util.h"
#endif
#include "mozilla/ipc/ProcessChild.h"
@ -593,7 +594,7 @@ PluginModuleChild::InitGraphics()
#endif
#ifdef MOZ_X11
// Do this after initializing GDK, or GDK will install its own handler.
XRE_InstallX11ErrorHandler();
InstallX11ErrorHandler();
#endif
return true;
}

View File

@ -72,6 +72,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
]
if CONFIG['MOZ_X11']:
EXPORTS += ['nsX11ErrorHandler.h']
UNIFIED_SOURCES += [
'nsX11ErrorHandler.cpp',
]

View File

@ -149,7 +149,6 @@ X11Error(Display *display, XErrorEvent *event) {
}
}
#if (MOZ_WIDGET_GTK != 3)
void
InstallX11ErrorHandler()
{
@ -161,4 +160,3 @@ InstallX11ErrorHandler()
XSynchronize(display, True);
}
}
#endif

View File

@ -5,8 +5,13 @@
#ifdef MOZ_X11
#include <X11/Xlib.h>
#if (MOZ_WIDGET_GTK != 3)
/**
* InstallX11ErrorHandler is not suitable for processes running with GTK3 as
* GDK3 will replace the handler. This is still used for the plugin process,
* which runs with GTK2.
**/
void InstallX11ErrorHandler();
#endif
extern "C" int X11Error(Display *display, XErrorEvent *event);
#endif