Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8136528

Minimized window busy loop (cause and fix for JDK-8088772)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8u60
    • javafx
    • x86_64
    • windows_7

      FULL PRODUCT VERSION :


      A DESCRIPTION OF THE PROBLEM :
      When window is minimized, d3d present is skipped, hence vsync does not block.

      This causes busy message loop pulse->render->pulse when scene changes every frame:

      In PresentingPainter
          @Override public void run() {
      ...
                  valid = validateStageGraphics();
                  if (!valid) {
      ...
                      return;
                  }
      ... present skipped when minimized ...

          protected boolean validateStageGraphics() {
      ...
              return sceneState.isWindowVisible() && !sceneState.isWindowMinimized();
          }

      PaintCollector.done:
      ...
      if (needsHint && !toolkit.hasNativeSystemVsync()) {
      toolkit.vsyncHint();
      }
      ...
      QuantumToolkit.vsyncHint:
      if (isVsyncEnabled()) {
      ...
      postPulse();
      }

      There may be other open bugs caused by this problem, like high cpu on minimize, etc.

      ----------------------------
      The following quick fix solves the issue but more elaborate design may be required:

      PaintCollector.done:
      ...
      if (needsHint && !toolkit.hasNativeSystemVsync() &&
      sceneState.isValid() && sceneState.isWindowVisible()
      && !sceneState.isWindowMinimized()){
      toolkit.vsyncHint();
      }

      Note it relies on the fact that QuantumRenderer is initialized with single thread.

      If more info is required please contact fedor.losev@gmail.com


      REPRODUCIBILITY :
      This bug can be reproduced always.

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: