mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
b=576933 ignore BadDevice errors from XCloseDevice (for GDK2) r=roc
--HG-- extra : transplant_source : %E1r%B5%F0N%40K%A6%80%5E%F1%CB%1D%16%ED%7E%D9%89%81%22
This commit is contained in:
parent
c46b9f0eef
commit
84e619f764
@ -56,9 +56,6 @@ using mozilla::plugins::PluginProcessChild;
|
||||
extern "C" {
|
||||
static int
|
||||
X11Error(Display *display, XErrorEvent *event) {
|
||||
nsCAutoString notes;
|
||||
char buffer[BUFSIZE];
|
||||
|
||||
// Get an indication of how long ago the request that caused the error was
|
||||
// made.
|
||||
unsigned long age = NextRequest(display) - event->serial;
|
||||
@ -81,9 +78,10 @@ X11Error(Display *display, XErrorEvent *event) {
|
||||
if (tmpDisplay) {
|
||||
int nExts;
|
||||
char** extNames = XListExtensions(tmpDisplay, &nExts);
|
||||
int first_error;
|
||||
if (extNames) {
|
||||
for (int i = 0; i < nExts; ++i) {
|
||||
int major_opcode, first_event, first_error;
|
||||
int major_opcode, first_event;
|
||||
if (XQueryExtension(tmpDisplay, extNames[i],
|
||||
&major_opcode, &first_event, &first_error)
|
||||
&& major_opcode == event->request_code) {
|
||||
@ -97,9 +95,21 @@ X11Error(Display *display, XErrorEvent *event) {
|
||||
XFreeExtensionList(extNames);
|
||||
}
|
||||
XCloseDisplay(tmpDisplay);
|
||||
|
||||
#ifdef MOZ_WIDGET_GTK2
|
||||
// GDK2 calls XCloseDevice the devices that it opened on startup, but
|
||||
// the XI protocol no longer ensures that the devices will still exist.
|
||||
// If they have been removed, then a BadDevice error results. Ignore
|
||||
// this error.
|
||||
if (message.EqualsLiteral("XInputExtension.4") &&
|
||||
event->error_code == first_error + 0) {
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
char buffer[BUFSIZE];
|
||||
if (message.IsEmpty()) {
|
||||
buffer[0] = '\0';
|
||||
} else {
|
||||
@ -107,6 +117,7 @@ X11Error(Display *display, XErrorEvent *event) {
|
||||
buffer, sizeof(buffer));
|
||||
}
|
||||
|
||||
nsCAutoString notes;
|
||||
if (buffer[0]) {
|
||||
notes.Append(buffer);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user