jdk/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java
changeset 30469 bac0a7ff7e1e
parent 29922 7b9c1e1532cf
child 30471 c1568a2416a8
equal deleted inserted replaced
30468:a016d2637922 30469:bac0a7ff7e1e
   603                 long w = 0;
   603                 long w = 0;
   604                 if (windowToXWindow(ev.get_xany().get_window()) != null) {
   604                 if (windowToXWindow(ev.get_xany().get_window()) != null) {
   605                     Component owner =
   605                     Component owner =
   606                         XKeyboardFocusManagerPeer.getInstance().getCurrentFocusOwner();
   606                         XKeyboardFocusManagerPeer.getInstance().getCurrentFocusOwner();
   607                     if (owner != null) {
   607                     if (owner != null) {
   608                         XWindow ownerWindow = (XWindow) AWTAccessor.getComponentAccessor().getPeer(owner);
   608                         XWindow ownerWindow = AWTAccessor.getComponentAccessor().getPeer(owner);
   609                         if (ownerWindow != null) {
   609                         if (ownerWindow != null) {
   610                             w = ownerWindow.getContentWindow();
   610                             w = ownerWindow.getContentWindow();
   611                         }
   611                         }
   612                     }
   612                     }
   613                 }
   613                 }
  2447             removeEventDispatcher(win.getWindow(), oops_waiter);
  2447             removeEventDispatcher(win.getWindow(), oops_waiter);
  2448             eventLog.finer("Exiting syncNativeQueue");
  2448             eventLog.finer("Exiting syncNativeQueue");
  2449             awtUnlock();
  2449             awtUnlock();
  2450         }
  2450         }
  2451     }
  2451     }
  2452     @SuppressWarnings("deprecation")
       
  2453     public void grab(Window w) {
  2452     public void grab(Window w) {
  2454         if (w.getPeer() != null) {
  2453         final Object peer = AWTAccessor.getComponentAccessor().getPeer(w);
  2455             ((XWindowPeer)w.getPeer()).setGrab(true);
  2454         if (peer != null) {
  2456         }
  2455             ((XWindowPeer) peer).setGrab(true);
  2457     }
  2456         }
  2458 
  2457     }
  2459     @SuppressWarnings("deprecation")
  2458 
  2460     public void ungrab(Window w) {
  2459     public void ungrab(Window w) {
  2461         if (w.getPeer() != null) {
  2460         final Object peer = AWTAccessor.getComponentAccessor().getPeer(w);
  2462            ((XWindowPeer)w.getPeer()).setGrab(false);
  2461         if (peer != null) {
       
  2462             ((XWindowPeer) peer).setGrab(false);
  2463         }
  2463         }
  2464     }
  2464     }
  2465     /**
  2465     /**
  2466      * Returns if the java.awt.Desktop class is supported on the current
  2466      * Returns if the java.awt.Desktop class is supported on the current
  2467      * desktop.
  2467      * desktop.