Results 1 to 1 of 1

Thread: get global cursor position on wayland with qt6

  1. #1
    Join Date
    Jul 2012
    Posts
    248
    Thanks
    29
    Thanked 15 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default get global cursor position on wayland with qt6

    Hi,

    QCursor::pos() ideally returns global position of the cursor. But for Wayland (current Ubuntu LTS) it returns a local position within the parent window.
    This is actually documented by Qt, but: Back in Qt5 it worked just fine!

    Problem is this breaks the popular floating dock library Qt-Advanced-docking-system, see this issue: https://github.com/githubuser0xFFFF/...tem/issues/738

    The 6.9.0 tag is actually misleading, it affects the entire 6.x series.
    Other docking libraries seem to implement everything without QCursor::pos(), but here it's quiet deeply ingrained and hard to get rid of.

    Question: how would one go about using the Wayland native platform api to get the current global cursor position?
    I tried some Claude suggestions, but it always returns the relative location within a parent window.
    Last edited by d_stranz; Yesterday at 16:08. Reason: Added [qtclass] tags

Similar Threads

  1. [Qt6] StartDrag making crash on Qt6
    By Alundra in forum Qt Programming
    Replies: 6
    Last Post: 12th December 2020, 22:18
  2. Replies: 0
    Last Post: 18th October 2018, 15:01
  3. Choosing startup screen in Weston + Wayland
    By Prisco in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 26th February 2018, 08:46
  4. eglfs vs wayland for graphicsview
    By denizlitr in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 13th June 2013, 09:31
  5. Can't seem to get global screen position
    By huilui in forum Qt Programming
    Replies: 10
    Last Post: 27th August 2012, 08:13

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.