private boolean isUpdateApplicable(
     RemoteDesktopServerEvent e, RemoteDesktopServerEvent evt, float passRatio) {
   if (e.getUpdateRect() != null && evt.getUpdateRect() != null) {
     Rectangle intersect = e.getUpdateRect().intersection(evt.getUpdateRect());
     if (intersect != null && !intersect.isEmpty()) {
       float ratio =
           100
               * (intersect.width * intersect.height)
               / (e.getUpdateRect().width * e.getUpdateRect().height);
       return ratio >= passRatio;
     }
   }
   return false;
 }
Esempio n. 2
0
 void flushBuffers() {
   if (isVisible() && !nativeBounds.isEmpty() && !isFullScreenMode) {
     try {
       LWCToolkit.invokeAndWait(
           new Runnable() {
             @Override
             public void run() {
               // Posting an empty to flush the EventQueue without blocking the main thread
             }
           },
           target);
     } catch (InvocationTargetException e) {
       e.printStackTrace();
     }
   }
 }