1. 29 Apr, 2021 1 commit
    • Erik Kurzinger's avatar
      xwayland-eglstream: fix X11 rendering to flipping GL / VK window · 07f26e16
      Erik Kurzinger authored
      
      
      If a window is being used for direct rendering with OpenGL or Vulkan, and is
      using the flipping path for presentation, it's pixmap will be set to a dma-buf
      backed pixmap created by the client-side GL driver. However, this means that
      xwl_glamor_eglstream_post_damage won't work since it requires that the pixmap
      has an EGLSurface that it can render to, which dma-buf backed pixmaps do not.
      
      In this case, though, xwl_glamor_eglstream_post_damage is not necessary since
      glamor will have rendered directly to the pixmap, so we can simply pass it
      directly to the compositor. There's no need for the intermediate copy we
      normally do in that function.
      
      Therefore, this change adds an early-return case to post_damage for dma-buf
      backed pixmaps, and removes the corresponding asserts from that function and
      allow_commits.
      Signed-off-by: Erik Kurzinger's avatarErik Kurzinger <ekurzinger@nvidia.com>
      Acked-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      07f26e16
  2. 09 Apr, 2021 4 commits
  3. 24 Mar, 2021 1 commit
  4. 05 Mar, 2021 2 commits
  5. 03 Mar, 2021 1 commit
    • Olivier Fourdan's avatar
      xwayland: Delay cursor visibility update · 97ed0048
      Olivier Fourdan authored
      
      
      Xwayland won't emulate XWarpPointer requests if the cursor is visible,
      this is to avoid having the cursor jumping on screen and preventing
      random X11 clients from controlling the pointer in Wayland, while
      allowing games which use that mechanism with a hidden cursor to work in
      Xwayland.
      
      There are, however, games which tend to do it in the wrong order, i.e.
      show the cursor before moving the pointer, and because Xwayland will not
      allow an X11 client to move the pointer while the cursor is visible, the
      requests will fail.
      
      Add a workaround for such X11 clients, when the cursor is being shown,
      keep it invisible until the cursor is actually moved. This way, X11
      clients which show their cursor just before moving it would still have a
      chance to succeed.
      
      v2: Add a timeout to show the cursor for well behaved clients.
      v3: Some cleanup (Michel)
      v4: Do not cancel cursor delay when updating the cursor to avoid
          delaying cursor visibility indefinitely if the client keeps
          settings different cursors (Michel)
      Signed-off-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      Tested-by: Jaap Buurman jaapbuurman@gmail.com
      Reviewed-by: Michel Dänzer's avatarMichel Dänzer <mdaenzer@redhat.com>
      Closes: xorg/xserver#734
      97ed0048
  6. 17 Feb, 2021 1 commit
    • Peter Hutterer's avatar
      xwayland: use get_pointer_device() for enter/leave handling too · 20c78f38
      Peter Hutterer authored
      In Weston, clicking the window decoration of an Xwayland client gives us a
      wl_pointer.button event immediately followed by a wl_pointer.leave event.
      The leave event does not contain any button state information, so the button
      remains logically down in the DIX.
      
      Once the pointer button is released, a wl_pointer.enter event is sent with
      the current button state (zero). This needs to trigger a ButtonRelease event
      but for that we need to ensure that the device is the same as the one we send
      ButtonPress events through.
      
      Fixes a regression introduced in a4095162
      
      .
      Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
      Reviewed-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      20c78f38
  7. 16 Feb, 2021 1 commit
  8. 15 Feb, 2021 5 commits
  9. 02 Feb, 2021 1 commit
    • Olivier Fourdan's avatar
      xwayland: Translate keyboard grabs on the root window · c7730cfe
      Olivier Fourdan authored and Olivier Fourdan's avatar Olivier Fourdan committed
      
      
      When an X11 client issues an active grab on the keyboard, Xwayland
      forward this to the Wayland compositor using the Xwayland specific
      protocol "xwayland-keyboard-grab" if it can find the corresponding
      Xwayland window.
      
      Some X11 clients (typically older games) however try to issue the
      keyboard grab on the X11 root window, which has obviously no matching
      Xwayland window. In such a case, the grab is simply ignored and the game
      will not work as expected.
      
      To workaround that issue, if an X11 client issues a keyboard grab on the
      root window, Xwayland will search for a toplevel window belonging to the
      same X11 client that it can use as the grab window instead.
      
      This way, the grab can be forwarded to the Wayland compositor that can
      either grant or deny the request based on the window and its internal
      policies.
      
      The heuristic picks the first realized toplevel window belonging to the
      client so that the Wayland compositor will send it the keyboard events,
      and the Xserver grab mechanism will then take care of routing the events
      to the expected X11 window by itself.
      
      v2: Make the test more clear (Dor Askayo <dor.askayo@gmail.com>)
      Signed-off-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      Acked-by: Jonas Ådahl's avatarJonas Ådahl <jadahl@gmail.com>
      See-also: https://gitlab.gnome.org/GNOME/mutter/-/issues/1249
      c7730cfe
  10. 29 Jan, 2021 2 commits
  11. 22 Jan, 2021 1 commit
  12. 08 Jan, 2021 1 commit
  13. 15 Dec, 2020 2 commits
  14. 14 Dec, 2020 1 commit
    • Tony Lindgren's avatar
      xwayland: fix GL version check for GLES only devices · 65673b02
      Tony Lindgren authored and Olivier Fourdan's avatar Olivier Fourdan committed
      We currently bail out early for GLES only devices, and call
      epoxy_gl_version() too early for GLES only that will make GLES only
      devices return NULL for glGetString(GL_RENDERER).
      
      Let's also add a check to see if we need to recreate the context to
      avoid pointless warnings for GLES only devices as suggested by
      Olivier Fourdan <ofourdan@redhat.com>.
      
      Fixes: a506b4ec
      
       - xwayland: make context current to check GL version
      Signed-off-by: Tony Lindgren's avatarTony Lindgren <tony@atomide.com>
      65673b02
  15. 10 Dec, 2020 3 commits
    • Olivier Fourdan's avatar
      xwayland: Hold window buffer until released · f95d81e8
      Olivier Fourdan authored
      
      
      The window buffer mechanism would free the pixmap and its corresponding
      Wayland buffer as soon as window buffers are disposed.
      
      Typically when the X11 window is unrealized, the current window buffer
      is still used by the Wayland compositor and yet Xwayland will destroy
      the buffer.
      
      As a matter of fact, Xwayland should not destroy the Wayland buffer
      before the wl_buffer.release event is received.
      
      Add a reference counter to the window buffer similar to the to pixmap
      reference counter to keep the buffer around until the release callback
      is received.
      
      Increase that reference counter on the buffer which will be attached to
      the surface, and drop that reference when receiving the release callback
      notification.
      
      v2: Use a specific reference counter on the buffer rather than relying
          on the pixmap refcnt (Michel Dänzer <mdaenzer@redhat.com>)
      Signed-off-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: Michel Dänzer's avatarMichel Dänzer <mdaenzer@redhat.com>
      Acked-by: Martin Peres ...
      f95d81e8
    • Olivier Fourdan's avatar
      xwayland: Hold cursor buffer until released · 85d8eac4
      Olivier Fourdan authored
      
      
      The cursor code would destroy the buffer as soon as the cursor is
      unrealized on X11 side.
      
      Yet, the Wayland compositor may still be using the buffer as long as a
      released callback has not been received.
      
      Increase the reference counter on the pixmap to hold a reference on the
      pixmap when attaching it to the surface and use the new pixmap release
      callback mechanism to release that reference when the buffer is
      released.
      Signed-off-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      Acked-by: Martin Roukala's avatarMartin Peres <martin.peres@mupuf.org>
      Reviewed-by: Michel Dänzer's avatarMichel Dänzer <mdaenzer@redhat.com>
      85d8eac4
    • Olivier Fourdan's avatar
      xwayland: Factorize common cursor code · 79afbd60
      Olivier Fourdan authored
      
      
      The seat and tablet cursor functions are very similar, factorize the
      commonalities to simplify the code and reduce the copy/paste.
      Signed-off-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: Michel Dänzer's avatarMichel Dänzer <mdaenzer@redhat.com>
      79afbd60
  16. 08 Dec, 2020 1 commit
  17. 23 Nov, 2020 1 commit
  18. 19 Nov, 2020 1 commit
  19. 17 Nov, 2020 1 commit
    • Michel Dänzer's avatar
      xwayland: Add and hook up test script · 250db870
      Michel Dänzer authored and Michel Dänzer's avatar Michel Dänzer committed
      
      
      It runs XTS via piglit on (non-rootless) Xwayland on weston using the
      headless backend.
      
      Xwayland might use glamor if enabled in the build, but we're making sure
      it uses software rendering.
      
      v2:
      * Use weston-info to wait for weston to be ready, instead of just a
        fixed sleep. (Martin Peres)
      v3:
      * Build wayland 1.18 & weston 9.0 locally, since the packages in Debian
        buster are too old for current Xwayland.
      Acked-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
      250db870
  20. 10 Nov, 2020 3 commits
  21. 09 Nov, 2020 3 commits
  22. 30 Oct, 2020 1 commit
  23. 22 Sep, 2020 2 commits