jdk/src/solaris/classes/sun/awt/X11/XBaseWindow.java
changeset 4191 ca8d3ef845c8
parent 3288 db82a42da273
child 4214 0fa32d38146b
equal deleted inserted replaced
4190:227655c2ff8c 4191:ca8d3ef845c8
   822      * We should always grab both keyboard and pointer to control event flow
   822      * We should always grab both keyboard and pointer to control event flow
   823      * on popups. This also simplifies synthetic grab implementation.
   823      * on popups. This also simplifies synthetic grab implementation.
   824      * The active grab overrides activated automatic grab.
   824      * The active grab overrides activated automatic grab.
   825      */
   825      */
   826     public boolean grabInput() {
   826     public boolean grabInput() {
   827         grabLog.log(Level.FINE, "Grab input on {0}", new Object[] {this});
   827         if (grabLog.isLoggable(Level.FINE)) {
       
   828             grabLog.log(Level.FINE, "Grab input on {0}", new Object[] {String.valueOf(this)});
       
   829         }
   828 
   830 
   829         XToolkit.awtLock();
   831         XToolkit.awtLock();
   830         try {
   832         try {
   831             if (XAwtState.getGrabWindow() == this &&
   833             if (XAwtState.getGrabWindow() == this &&
   832                 XAwtState.isManualGrab())
   834                 XAwtState.isManualGrab())
   885 
   887 
   886     static void ungrabInput() {
   888     static void ungrabInput() {
   887         XToolkit.awtLock();
   889         XToolkit.awtLock();
   888         try {
   890         try {
   889             XBaseWindow grabWindow = XAwtState.getGrabWindow();
   891             XBaseWindow grabWindow = XAwtState.getGrabWindow();
   890             grabLog.log(Level.FINE, "UnGrab input on {0}", new Object[] {grabWindow});
   892             if (grabLog.isLoggable(Level.FINE)) {
       
   893                 grabLog.log(Level.FINE, "UnGrab input on {0}",
       
   894                                         new Object[] {String.valueOf(grabWindow)});
       
   895             }
   891             if (grabWindow != null) {
   896             if (grabWindow != null) {
   892                 grabWindow.ungrabInputImpl();
   897                 grabWindow.ungrabInputImpl();
   893                 if (!XToolkit.getSunAwtDisableGrab()) {
   898                 if (!XToolkit.getSunAwtDisableGrab()) {
   894                     XlibWrapper.XUngrabPointer(XToolkit.getDisplay(), XConstants.CurrentTime);
   899                     XlibWrapper.XUngrabPointer(XToolkit.getDisplay(), XConstants.CurrentTime);
   895                     XlibWrapper.XUngrabKeyboard(XToolkit.getDisplay(), XConstants.CurrentTime);
   900                     XlibWrapper.XUngrabKeyboard(XToolkit.getDisplay(), XConstants.CurrentTime);
   938         XPropertyEvent msg = xev.get_xproperty();
   943         XPropertyEvent msg = xev.get_xproperty();
   939         if (XPropertyCache.isCachingSupported()) {
   944         if (XPropertyCache.isCachingSupported()) {
   940             XPropertyCache.clearCache(window, XAtom.get(msg.get_atom()));
   945             XPropertyCache.clearCache(window, XAtom.get(msg.get_atom()));
   941         }
   946         }
   942         if (eventLog.isLoggable(Level.FINER)) {
   947         if (eventLog.isLoggable(Level.FINER)) {
   943             eventLog.log(Level.FINER, "{0}", new Object[] {msg});
   948             eventLog.log(Level.FINER, "{0}", new Object[] {String.valueOf(msg)});
   944         }
   949         }
   945     }
   950     }
   946 
   951 
   947     public void handleDestroyNotify(XEvent xev) {
   952     public void handleDestroyNotify(XEvent xev) {
   948         XAnyEvent xany = xev.get_xany();
   953         XAnyEvent xany = xev.get_xany();
  1019     }
  1024     }
  1020     public void handleXCrossingEvent(XEvent xev) {
  1025     public void handleXCrossingEvent(XEvent xev) {
  1021     }
  1026     }
  1022     public void handleConfigureNotifyEvent(XEvent xev) {
  1027     public void handleConfigureNotifyEvent(XEvent xev) {
  1023         XConfigureEvent xe = xev.get_xconfigure();
  1028         XConfigureEvent xe = xev.get_xconfigure();
  1024         insLog.log(Level.FINER, "Configure, {0}",
  1029         if (insLog.isLoggable(Level.FINER)) {
  1025                    new Object[] {xe});
  1030             insLog.log(Level.FINER, "Configure, {0}",
       
  1031                        new Object[] {String.valueOf(xe)});
       
  1032         }
  1026         x = xe.get_x();
  1033         x = xe.get_x();
  1027         y = xe.get_y();
  1034         y = xe.get_y();
  1028         width = xe.get_width();
  1035         width = xe.get_width();
  1029         height = xe.get_height();
  1036         height = xe.get_height();
  1030     }
  1037     }