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

Taking screenshots on x11 composite desktop produce wrong result

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 7, 8, 9
    • Fix Version/s: 9
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b130
    • OS:
      linux

      Description

      The Robot code that grabs the content of the screen uses the default root window. On composite desktop the root window does not contain the final composited desktop, so screenshots taken using this window will generally have black areas instead of transparent or translucent ones, as is demonstrated on the attached screenshots.

      The proposed solution is to determine if the desktop is composited or not, and then get a reference to the correct window id, which is either the root window or the compositor owned one.

      This bug is quite likely related to:

      https://bugs.openjdk.java.net/browse/JDK-7043455

      I believe that the original fix that was backed out by 7043455 because it was trying to acquire the composite window, which is wrong since the XCompositeGetOverlayWindow would always return a valid window id.

      The proposed fix uses an Atom to detect if the window manager is a composite wm:

      https://specifications.freedesktop.org/wm-spec/1.4/ar01s08.html

        Attachments

          Activity

            People

            • Assignee:
              neugens Mario Torre
              Reporter:
              neugens Mario Torre
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: