Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-132579

Cursor hotspot and cursor image are not updated atomically on Wayland

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.8
    • QPA: Wayland
    • None
    • Linux/Wayland

    Description

      Qt updates the cursor in two steps:

      • set hotspot
      • attach a buffer

      This can result in the cursor unexpectedly jumping if the compositor updates the cursor between set hotspot and attach a buffer steps, e.g. https://bugs.kde.org/show_bug.cgi?id=488398. In order to ensure that cursor updates are atomic and there are no glitches, QtWayland needs to update the cursor differently:

      • if the cursor needs to be updated after receiving an enter event, a new buffer should be attached to the surface before the wl_pointer.set_cursor() request
      wl_surface.offset(surface, 0, 0)
      wl_surface.attach(surface, buffer, 0, 0)
      wl_surface.commit(surface)
      wl_pointer.set_cursor(pointer, surface, hot_x, hot_y)
      • if the cursor needs to be updated after wl_pointer.set_cursor(), wl_surface.offset should be used
        wl_surface.offset(surface, old_hot_x - new_hot_x, old_hot_y - new_hot_y)
        wl_surface.attach(surface)
        wl_surface.commit(surface)

      Note that wl_surface.offset doesn't take an absolute hotspot position, instead it takes an offset relative to the old hotspot position. wl_pointer.set_cursor takes an absolute hotspot position.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            davidedmundson David Edmundson
            zzag Vlad Zahorodnii
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes