102 }
103
104 /**
105 * Unsets a current synthetic error handler. Must be called with the acquired AWT lock.
106 */
107 public static void RESTORE_XERROR_HANDLER() {
108 // Wait until all requests are processed by the X server
109 // and only then uninstall the error handler.
110 XSync();
111 current_error_handler = null;
112 }
113
114 /**
115 * Should be called under LOCK.
116 */
117 public static int SAVED_XERROR_HANDLER(long display, XErrorEvent error) {
118 if (saved_error_handler != 0) {
119 // Default XErrorHandler may just terminate the process. Don't call it.
120 // return XlibWrapper.CallErrorHandler(saved_error_handler, display, error.pData);
121 }
122 if (log.isLoggable(PlatformLogger.FINE)) {
123 log.fine("Unhandled XErrorEvent: " +
124 "id=" + error.get_resourceid() + ", " +
125 "serial=" + error.get_serial() + ", " +
126 "ec=" + error.get_error_code() + ", " +
127 "rc=" + error.get_request_code() + ", " +
128 "mc=" + error.get_minor_code());
129 }
130 return 0;
131 }
132
133 /**
134 * Called from the native code when an error occurs.
135 */
136 private static int globalErrorHandler(long display, long event_ptr) {
137 if (noisyAwtHandler) {
138 XlibWrapper.PrintXErrorEvent(display, event_ptr);
139 }
140 XErrorEvent event = new XErrorEvent(event_ptr);
141 saved_error = event;
142 try {
|
102 }
103
104 /**
105 * Unsets a current synthetic error handler. Must be called with the acquired AWT lock.
106 */
107 public static void RESTORE_XERROR_HANDLER() {
108 // Wait until all requests are processed by the X server
109 // and only then uninstall the error handler.
110 XSync();
111 current_error_handler = null;
112 }
113
114 /**
115 * Should be called under LOCK.
116 */
117 public static int SAVED_XERROR_HANDLER(long display, XErrorEvent error) {
118 if (saved_error_handler != 0) {
119 // Default XErrorHandler may just terminate the process. Don't call it.
120 // return XlibWrapper.CallErrorHandler(saved_error_handler, display, error.pData);
121 }
122 if (log.isLoggable(PlatformLogger.Level.FINE)) {
123 log.fine("Unhandled XErrorEvent: " +
124 "id=" + error.get_resourceid() + ", " +
125 "serial=" + error.get_serial() + ", " +
126 "ec=" + error.get_error_code() + ", " +
127 "rc=" + error.get_request_code() + ", " +
128 "mc=" + error.get_minor_code());
129 }
130 return 0;
131 }
132
133 /**
134 * Called from the native code when an error occurs.
135 */
136 private static int globalErrorHandler(long display, long event_ptr) {
137 if (noisyAwtHandler) {
138 XlibWrapper.PrintXErrorEvent(display, event_ptr);
139 }
140 XErrorEvent event = new XErrorEvent(event_ptr);
141 saved_error = event;
142 try {
|