Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. `containsMouse` is `false` after setting mouse coordinates from c++ backend
Forum Updated to NodeBB v4.3 + New Features

`containsMouse` is `false` after setting mouse coordinates from c++ backend

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
13 Posts 3 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R rghvdberg

    Title kinda says it.
    If I use the c++ backend to set the mouse coordinates (link) and move to cursor in a MouseArea, the containsMouse property of that area stays false.

    Is this a bug ?
    Qt 5.11

    ODБOïO Offline
    ODБOïO Offline
    ODБOï
    wrote on last edited by
    #2

    hi @rghvdberg ,is hoverEnabled true ?

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rghvdberg
      wrote on last edited by
      #3

      Yes , it's set to true

      kshegunovK 1 Reply Last reply
      0
      • R rghvdberg

        Yes , it's set to true

        kshegunovK Offline
        kshegunovK Offline
        kshegunov
        Moderators
        wrote on last edited by
        #4

        Which OS and/or windowing system is this?
        In principle the window manager should send you a mouse event with the new position after it processes the call to change the cursor position, could you install an event filter on the application and log if this is the case?

        Read and abide by the Qt Code of Conduct

        R 1 Reply Last reply
        0
        • R Offline
          R Offline
          rghvdberg
          wrote on last edited by
          #5

          I'm using Linux Mint 18.
          I'll checkout the eventFilter thing.

          1 Reply Last reply
          0
          • R Offline
            R Offline
            rghvdberg
            wrote on last edited by
            #6

            Forgot to mention it is the Cinnamon desktop.

            1 Reply Last reply
            0
            • R Offline
              R Offline
              rghvdberg
              wrote on last edited by
              #7

              could you install an event filter on the application

              Now I,m confused.
              Are we talking about a qt eventfilter or some other app / log thingy?
              (you might notice here I'm kinda new to these things ;-) )

              kshegunovK 1 Reply Last reply
              0
              • R Offline
                R Offline
                rghvdberg
                wrote on last edited by
                #8

                After struggling for an hour installing a qt eventFilter I've come to the conclusion I didn't need that. Lol
                I should read better 😁

                1 Reply Last reply
                0
                • R Offline
                  R Offline
                  rghvdberg
                  wrote on last edited by
                  #9

                  seems cinnamon uses Muffin / Mutter

                  wmctrl -m
                  Name: Mutter (Muffin)
                  Class: N/A
                  PID: N/A
                  Window manager's "showing the desktop" mode: N/A
                  

                  no clue yet how to get info from that

                  1 Reply Last reply
                  0
                  • kshegunovK kshegunov

                    Which OS and/or windowing system is this?
                    In principle the window manager should send you a mouse event with the new position after it processes the call to change the cursor position, could you install an event filter on the application and log if this is the case?

                    R Offline
                    R Offline
                    rghvdberg
                    wrote on last edited by
                    #10

                    @kshegunov to be clear, the mouse cursor does show up at the right location , but the MouseArea fails to register it is inside it. So the containsMouse flag stays false even when the mouse cursor is in it.

                    1 Reply Last reply
                    0
                    • R rghvdberg

                      could you install an event filter on the application

                      Now I,m confused.
                      Are we talking about a qt eventfilter or some other app / log thingy?
                      (you might notice here I'm kinda new to these things ;-) )

                      kshegunovK Offline
                      kshegunovK Offline
                      kshegunov
                      Moderators
                      wrote on last edited by
                      #11

                      @rghvdberg said in `containsMouse` is `false` after setting mouse coordinates from c++ backend:

                      Are we talking about a qt eventfilter or some other app / log thingy?

                      Yes, that's what we are talking about.

                      After struggling for an hour installing a qt eventFilter I've come to the conclusion I didn't need that. Lol
                      I should read better 😁

                      Then you solved your problem? I will repeat what I wrote before:

                      In principle the window manager should send you a mouse event with the new position after it processes the call to change the cursor position, could you install an event filter on the application and log if this is the case?

                      I want you to find out if there's an incoming mouse event after the call to QCursor::setPos to confirm or deny whether this is due to the window manager.

                      Read and abide by the Qt Code of Conduct

                      1 Reply Last reply
                      0
                      • R Offline
                        R Offline
                        rghvdberg
                        wrote on last edited by rghvdberg
                        #12

                        I used the eventfilter to log the mouse coordinates to the console. It shows that after the setPos the coordinates are updated perfectly.

                        Furthermore, I have a hot corner in Cinnamon. When the mouse is at top left of the screen (0,0) it triggers the "exposé" ; show all open windows.
                        When I do setPos(0,0), the desktop shows the exposé. It seems that the desktop is also updated.

                        Is this enough proof, because I have no clue how to snoop on the window manager.

                        kshegunovK 1 Reply Last reply
                        0
                        • R rghvdberg

                          I used the eventfilter to log the mouse coordinates to the console. It shows that after the setPos the coordinates are updated perfectly.

                          Furthermore, I have a hot corner in Cinnamon. When the mouse is at top left of the screen (0,0) it triggers the "exposé" ; show all open windows.
                          When I do setPos(0,0), the desktop shows the exposé. It seems that the desktop is also updated.

                          Is this enough proof, because I have no clue how to snoop on the window manager.

                          kshegunovK Offline
                          kshegunovK Offline
                          kshegunov
                          Moderators
                          wrote on last edited by kshegunov
                          #13

                          @rghvdberg said in `containsMouse` is `false` after setting mouse coordinates from c++ backend:

                          I used the eventfilter to log the mouse coordinates to the console. It shows that after the setPos the coordinates are updated perfectly.

                          Okay, assuming this is correct, which I have no reason to doubt, then you should file that as a bug report and/or write to the interest mailing list to (maybe) get answers from the developers.

                          Possibly related to QTBUG-56857 or QTBUG-65157.

                          Read and abide by the Qt Code of Conduct

                          1 Reply Last reply
                          0

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved