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

JavaFX choppy with NVIDIA G-SYNC

    XMLWordPrintable

Details

    • x86_64
    • windows_10

    Description

      ADDITIONAL SYSTEM INFORMATION :
      Win 10, GTX 980 ti

      A DESCRIPTION OF THE PROBLEM :
      Enabling G-SYNC for windowed applications and having focus in the JavaFX window causes the mouse to be choppy when moving over the whole monitor. (Simple UI, no animations. FRAPS shows that the window has ~2 fps.)


      CUSTOMER SUBMITTED WORKAROUND :
      Workaround 1 - cause repainting
      Selecting text or resizing the window increases fps up to the monitor refresh rate (120 fps), which makes the movement look normal.

      Using AnimationTimer produces 120fps, but also consumes CPU:

      private boolean focus = false;

      public void setStageAndSetupListeners(Stage stage) {
          stage.focusedProperty().addListener((ov, onHidden, onShown) -> focus = ov.getValue());

          AnimationTimer timer = new AnimationTimer() {
              @Override
              public void handle(long now) {
                  if (focus) {
                      label.setVisible(false);
                      label.setVisible(true);
                  }
              }
          };
          timer.start();
      }


      Workaround 2: -Dprism.order=sw
      Breaks font rendering - <attached screenshot>


      Workaround 3: -Dprism.forceUploadingPainter=true
      It seems to work, but it is "intended for testing and not recommended for production"
      https://mail.openjdk.org/pipermail/openjfx-dev/2020-March/025466.html


      FREQUENCY : always


      Attachments

        Activity

          People

            kcr Kevin Rushforth
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: