jdk/src/solaris/classes/sun/awt/X11/XEmbedCanvasPeer.java
changeset 17679 a81555868357
parent 16839 d0f2e97b7359
child 18178 ee71c923891d
equal deleted inserted replaced
17678:ec24ad8455ec 17679:a81555868357
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   299     Rectangle getClientBounds() {
   299     Rectangle getClientBounds() {
   300         XToolkit.awtLock();
   300         XToolkit.awtLock();
   301         try {
   301         try {
   302             XWindowAttributes wattr = new XWindowAttributes();
   302             XWindowAttributes wattr = new XWindowAttributes();
   303             try {
   303             try {
   304                 XToolkit.WITH_XERROR_HANDLER(XErrorHandler.IgnoreBadWindowHandler.getInstance());
   304                 XErrorHandlerUtil.WITH_XERROR_HANDLER(XErrorHandler.IgnoreBadWindowHandler.getInstance());
   305                 int status = XlibWrapper.XGetWindowAttributes(XToolkit.getDisplay(),
   305                 int status = XlibWrapper.XGetWindowAttributes(XToolkit.getDisplay(),
   306                                                               xembed.handle, wattr.pData);
   306                                                               xembed.handle, wattr.pData);
   307 
   307 
   308                 XToolkit.RESTORE_XERROR_HANDLER();
   308                 XErrorHandlerUtil.RESTORE_XERROR_HANDLER();
   309 
   309 
   310                 if (status == 0 ||
   310                 if ((status == 0) ||
   311                     (XToolkit.saved_error != null &&
   311                     ((XErrorHandlerUtil.saved_error != null) &&
   312                      XToolkit.saved_error.get_error_code() != XConstants.Success)) {
   312                     (XErrorHandlerUtil.saved_error.get_error_code() != XConstants.Success))) {
   313                     return null;
   313                     return null;
   314                 }
   314                 }
   315 
   315 
   316                 return new Rectangle(wattr.get_x(), wattr.get_y(), wattr.get_width(), wattr.get_height());
   316                 return new Rectangle(wattr.get_x(), wattr.get_y(), wattr.get_width(), wattr.get_height());
   317             } finally {
   317             } finally {