src/solaris/native/sun/awt/awt_xembed_server.c
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -642,16 +642,23 @@
}
}
return dim;
}
-Boolean isMapped(Window w) {
+Boolean isMapped(JNIEnv* env, Window w) {
XWindowAttributes attr;
Status status = 0;
- WITH_XERROR_HANDLER(xerror_ignore_bad_window);
- status = XGetWindowAttributes(awt_display, w, &attr);
- RESTORE_XERROR_HANDLER;
+ jboolean errorOccurredFlag;
+ jobject errorHandlerRef;
+ jobject savedError;
+ unsigned char xerror_code;
+
+ EXEC_WITH_XERROR_HANDLER(env, "sun/awt/X11/XErrorHandler$IgnoreBadWindowHandler",
+ "()Lsun/awt/X11/XErrorHandler$IgnoreBadWindowHandler;", JNI_FALSE,
+ errorHandlerRef, errorOccurredFlag,
+ status = XGetWindowAttributes(awt_display, w, &attr));
+ xerror_code = GET_XERROR_CODE(env, savedError);
if (status == 0 || xerror_code != Success) {
return False;
}
return !(attr.map_state == IsUnmapped);
}
@@ -683,11 +690,11 @@
CARD32 flags;
Boolean new_mapped, currently_mapped;
sdata->version = *data;
flags = *(data+1);
new_mapped = (flags & XEMBED_MAPPED) != 0;
- currently_mapped = isMapped(sdata->handle);
+ currently_mapped = isMapped(env, sdata->handle);
if (new_mapped != currently_mapped) {
if (new_mapped) {
XMapWindow(awt_display, sdata->handle);
} else {
XUnmapWindow(awt_display, sdata->handle);