< prev index next >

src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java

Print this page

        

@@ -680,10 +680,12 @@
         int newScreenNum = 0;
         GraphicsDevice gds[] = XToolkit.localEnv.getScreenDevices();
         GraphicsConfiguration newGC = null;
         Rectangle screenBounds;
 
+        XToolkit.awtUnlock();
+        try {
         for (int i = 0; i < gds.length; i++) {
             screenBounds = gds[i].getDefaultConfiguration().getBounds();
             if (newBounds.intersects(screenBounds)) {
                 horizAmt = Math.min(newBounds.x + newBounds.width,
                                     screenBounds.x + screenBounds.width) -

@@ -703,10 +705,13 @@
                     newScreenNum = i;
                     newGC = gds[i].getDefaultConfiguration();
                 }
             }
         }
+        } finally {
+            XToolkit.awtLock();
+        }
         if (newScreenNum != curScreenNum) {
             if (log.isLoggable(PlatformLogger.Level.FINEST)) {
                 log.finest("XWindowPeer: Moved to a new screen");
             }
             executeDisplayChangedOnEDT(newGC);
< prev index next >