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.8k 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 Offline
    R Offline
    rghvdberg
    wrote on 21 Jul 2018, 19:10 last edited by aha_1980
    #1

    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

    O 1 Reply Last reply 21 Jul 2018, 19:27
    0
    • R rghvdberg
      21 Jul 2018, 19:10

      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

      O Offline
      O Offline
      ODБOï
      wrote on 21 Jul 2018, 19:27 last edited by
      #2

      hi @rghvdberg ,is hoverEnabled true ?

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rghvdberg
        wrote on 21 Jul 2018, 19:45 last edited by
        #3

        Yes , it's set to true

        K 1 Reply Last reply 21 Jul 2018, 22:17
        0
        • R rghvdberg
          21 Jul 2018, 19:45

          Yes , it's set to true

          K Offline
          K Offline
          kshegunov
          Moderators
          wrote on 21 Jul 2018, 22:17 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 22 Jul 2018, 15:49
          0
          • R Offline
            R Offline
            rghvdberg
            wrote on 22 Jul 2018, 08:16 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 22 Jul 2018, 08:22 last edited by
              #6

              Forgot to mention it is the Cinnamon desktop.

              1 Reply Last reply
              0
              • R Offline
                R Offline
                rghvdberg
                wrote on 22 Jul 2018, 08:44 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 ;-) )

                K 1 Reply Last reply 22 Jul 2018, 21:09
                0
                • R Offline
                  R Offline
                  rghvdberg
                  wrote on 22 Jul 2018, 09:50 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 22 Jul 2018, 15:46 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
                    • K kshegunov
                      21 Jul 2018, 22:17

                      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 22 Jul 2018, 15:49 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
                        22 Jul 2018, 08:44

                        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 ;-) )

                        K Offline
                        K Offline
                        kshegunov
                        Moderators
                        wrote on 22 Jul 2018, 21:09 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 23 Jul 2018, 02:35 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.

                          K 1 Reply Last reply 24 Jul 2018, 16:43
                          0
                          • R rghvdberg
                            23 Jul 2018, 02:35

                            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.

                            K Offline
                            K Offline
                            kshegunov
                            Moderators
                            wrote on 24 Jul 2018, 16:43 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

                            1/13

                            21 Jul 2018, 19:10

                            • Login

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