2412 try { 2413 // Wait for OOPS ConfigureNotify event 2414 awtLockWait(timeout); 2415 } catch (InterruptedException e) { 2416 throw new RuntimeException(e); 2417 } 2418 // This "while" is a protection from spurious 2419 // wake-ups. However, we shouldn't wait for too long 2420 if ((System.currentTimeMillis() - start > timeout) && timeout >= 0) { 2421 throw new OperationTimedOut(Long.toString(System.currentTimeMillis() - start)); 2422 } 2423 } 2424 // Don't take into account OOPS ConfigureNotify event 2425 return getEventNumber() - event_number > 1; 2426 } finally { 2427 removeEventDispatcher(win.getWindow(), oops_waiter); 2428 eventLog.finer("Exiting syncNativeQueue"); 2429 awtUnlock(); 2430 } 2431 } 2432 public void grab(Window w) { 2433 if (w.getPeer() != null) { 2434 ((XWindowPeer)w.getPeer()).setGrab(true); 2435 } 2436 } 2437 2438 public void ungrab(Window w) { 2439 if (w.getPeer() != null) { 2440 ((XWindowPeer)w.getPeer()).setGrab(false); 2441 } 2442 } 2443 /** 2444 * Returns if the java.awt.Desktop class is supported on the current 2445 * desktop. 2446 * <p> 2447 * The methods of java.awt.Desktop class are supported on the Gnome desktop. 2448 * Check if the running desktop is Gnome by checking the window manager. 2449 */ 2450 public boolean isDesktopSupported(){ 2451 return XDesktopPeer.isDesktopSupported(); 2452 } 2453 2454 public DesktopPeer createDesktopPeer(Desktop target){ 2455 return new XDesktopPeer(); 2456 } 2457 | 2412 try { 2413 // Wait for OOPS ConfigureNotify event 2414 awtLockWait(timeout); 2415 } catch (InterruptedException e) { 2416 throw new RuntimeException(e); 2417 } 2418 // This "while" is a protection from spurious 2419 // wake-ups. However, we shouldn't wait for too long 2420 if ((System.currentTimeMillis() - start > timeout) && timeout >= 0) { 2421 throw new OperationTimedOut(Long.toString(System.currentTimeMillis() - start)); 2422 } 2423 } 2424 // Don't take into account OOPS ConfigureNotify event 2425 return getEventNumber() - event_number > 1; 2426 } finally { 2427 removeEventDispatcher(win.getWindow(), oops_waiter); 2428 eventLog.finer("Exiting syncNativeQueue"); 2429 awtUnlock(); 2430 } 2431 } 2432 @SuppressWarnings("deprecation") 2433 public void grab(Window w) { 2434 if (w.getPeer() != null) { 2435 ((XWindowPeer)w.getPeer()).setGrab(true); 2436 } 2437 } 2438 2439 @SuppressWarnings("deprecation") 2440 public void ungrab(Window w) { 2441 if (w.getPeer() != null) { 2442 ((XWindowPeer)w.getPeer()).setGrab(false); 2443 } 2444 } 2445 /** 2446 * Returns if the java.awt.Desktop class is supported on the current 2447 * desktop. 2448 * <p> 2449 * The methods of java.awt.Desktop class are supported on the Gnome desktop. 2450 * Check if the running desktop is Gnome by checking the window manager. 2451 */ 2452 public boolean isDesktopSupported(){ 2453 return XDesktopPeer.isDesktopSupported(); 2454 } 2455 2456 public DesktopPeer createDesktopPeer(Desktop target){ 2457 return new XDesktopPeer(); 2458 } 2459 |