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

[XWayland] No displayChanged event after setDisplayMode call

    XMLWordPrintable

    Details

      Description

      After setDisplayMode call window gets scaled correctly to requested resolution, however root window does not receive ConfigureNotify event, so java is unaware that screen size has changed. So this is the reason of failure of following tests:

          FAIL: java/awt/FullScreen/FullscreenWindowProps/FullscreenWindowProps.java
          FAIL: java/awt/FullScreen/NoResizeEventOnDMChangeTest/NoResizeEventOnDMChangeTest.java

      Root cause:

      """
      This is using XRandR which is also an X11 only protocol. Similarly to point #1, Xwayland is not the display server in Wayland, it's just a Wayland client and the Wayland compositor is the actual display server.

      As Wayland clients are not allowed to change the resolution in Wayland (this is by design, it's not an oversight), XRandR in Xwayland is just an emulation, mostly read-only, it doesn't actually change the resolution.

      For legacy games which relied on XRandR to adjust the screen size to their capacity, Xwayland will emulate that using a viewport to scale the (fullscreen, unreparented) window so it appears as if the resolution was changed, as you noticed, but the actual screen size doesn't change and therefore the root window is not resized and hence won't get a configure notify.

      Also worth noting that the XRandR emulation is per window/X11 client, whereas the root window is shared between all X11 clients, but maybe we could send a fake ConfigureNotify event to the given client, I would need to check if that's doable.
      """



      This MR (https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/731) adds notification, however it has several issues:

          There is no event when you are trying to change to native resolution from another.
          XRRScreenChangeNotifyEvent always has native resolution reported. (we are not using it though)
          It might be a minor one, but on X11 session there is no events reported if you are trying to change to the same resolution.

      Reported as https://gitlab.freedesktop.org/xorg/xserver/-/issues/1305

        Attachments

          Activity

            People

            Assignee:
            azvegint Alexander Zvegintsev
            Reporter:
            azvegint Alexander Zvegintsev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: