843 public boolean isUnderMouse() { 844 return contentView.isUnderMouse(); 845 } 846 847 public CPlatformView getContentView() { 848 return contentView; 849 } 850 851 @Override 852 public long getLayerPtr() { 853 return contentView.getWindowLayerPtr(); 854 } 855 856 private void validateSurface() { 857 SurfaceData surfaceData = getSurfaceData(); 858 if (surfaceData instanceof CGLSurfaceData) { 859 ((CGLSurfaceData)surfaceData).validate(); 860 } 861 } 862 863 private void flushBuffers() { 864 if (isVisible() && !nativeBounds.isEmpty()) { 865 try { 866 LWCToolkit.invokeAndWait(new Runnable() { 867 @Override 868 public void run() { 869 //Posting an empty to flush the EventQueue without blocking the main thread 870 } 871 }, target); 872 } catch (InterruptedException | InvocationTargetException e) { 873 e.printStackTrace(); 874 } 875 } 876 } 877 878 /************************************************************* 879 * Callbacks from the AWTWindow and AWTView objc classes. 880 *************************************************************/ 881 private void deliverWindowFocusEvent(boolean gained, CPlatformWindow opposite){ 882 // Fix for 7150349: ingore "gained" notifications when the app is inactive. 883 if (gained && !((LWCToolkit)Toolkit.getDefaultToolkit()).isApplicationActive()) { 884 focusLogger.fine("the app is inactive, so the notification is ignored"); | 843 public boolean isUnderMouse() { 844 return contentView.isUnderMouse(); 845 } 846 847 public CPlatformView getContentView() { 848 return contentView; 849 } 850 851 @Override 852 public long getLayerPtr() { 853 return contentView.getWindowLayerPtr(); 854 } 855 856 private void validateSurface() { 857 SurfaceData surfaceData = getSurfaceData(); 858 if (surfaceData instanceof CGLSurfaceData) { 859 ((CGLSurfaceData)surfaceData).validate(); 860 } 861 } 862 863 void flushBuffers() { 864 if (isVisible() && !nativeBounds.isEmpty() && !isFullScreenMode) { 865 try { 866 LWCToolkit.invokeAndWait(new Runnable() { 867 @Override 868 public void run() { 869 //Posting an empty to flush the EventQueue without blocking the main thread 870 } 871 }, target); 872 } catch (InterruptedException | InvocationTargetException e) { 873 e.printStackTrace(); 874 } 875 } 876 } 877 878 /************************************************************* 879 * Callbacks from the AWTWindow and AWTView objc classes. 880 *************************************************************/ 881 private void deliverWindowFocusEvent(boolean gained, CPlatformWindow opposite){ 882 // Fix for 7150349: ingore "gained" notifications when the app is inactive. 883 if (gained && !((LWCToolkit)Toolkit.getDefaultToolkit()).isApplicationActive()) { 884 focusLogger.fine("the app is inactive, so the notification is ignored"); |