jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java
changeset 20449 20326f6cd2aa
parent 18525 2d5db9a68add
child 21278 ef8a3a2a72f2
equal deleted inserted replaced
20448:0eef03207781 20449:20326f6cd2aa
   114      * If yes - hide the PopupMenu. If no - do nothing
   114      * If yes - hide the PopupMenu. If no - do nothing
   115      */
   115      */
   116     protected Point grabInputPoint = null;
   116     protected Point grabInputPoint = null;
   117     protected boolean hasPointerMoved = false;
   117     protected boolean hasPointerMoved = false;
   118 
   118 
       
   119     private AppContext disposeAppContext;
       
   120 
   119     /************************************************
   121     /************************************************
   120      *
   122      *
   121      * Mapping data
   123      * Mapping data
   122      *
   124      *
   123      ************************************************/
   125      ************************************************/
   172      *
   174      *
   173      ************************************************/
   175      ************************************************/
   174     XBaseMenuWindow() {
   176     XBaseMenuWindow() {
   175         super(new XCreateWindowParams(new Object[] {
   177         super(new XCreateWindowParams(new Object[] {
   176             DELAYED, Boolean.TRUE}));
   178             DELAYED, Boolean.TRUE}));
       
   179 
       
   180         disposeAppContext = AppContext.getAppContext();
   177     }
   181     }
   178 
   182 
   179     /************************************************
   183     /************************************************
   180      *
   184      *
   181      * Abstract methods
   185      * Abstract methods
   902     /**
   906     /**
   903      * Invokes disposal procedure on eventHandlerThread
   907      * Invokes disposal procedure on eventHandlerThread
   904      */
   908      */
   905     public void dispose() {
   909     public void dispose() {
   906         setDisposed(true);
   910         setDisposed(true);
   907         InvocationEvent ev = new InvocationEvent(target, new Runnable() {
   911 
       
   912         SunToolkit.invokeLaterOnAppContext(disposeAppContext, new Runnable()  {
   908             public void run() {
   913             public void run() {
   909                 doDispose();
   914                 doDispose();
   910             }
   915             }
   911         });
   916         });
   912         super.postEvent(ev);
       
   913     }
   917     }
   914 
   918 
   915     /**
   919     /**
   916      * Performs disposal of menu window.
   920      * Performs disposal of menu window.
   917      * Should be called only on eventHandlerThread
   921      * Should be called only on eventHandlerThread
   921         SurfaceData oldData = surfaceData;
   925         SurfaceData oldData = surfaceData;
   922         surfaceData = null;
   926         surfaceData = null;
   923         if (oldData != null) {
   927         if (oldData != null) {
   924             oldData.invalidate();
   928             oldData.invalidate();
   925         }
   929         }
   926         XToolkit.targetDisposedPeer(target, this);
       
   927         destroy();
   930         destroy();
   928     }
   931     }
   929 
   932 
   930     /**
   933     /**
   931      * Invokes event processing on eventHandlerThread
   934      * Invokes event processing on eventHandlerThread