Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. MacOSX: problem with stucked mouse with modal forms
Forum Updated to NodeBB v4.3 + New Features

MacOSX: problem with stucked mouse with modal forms

Scheduled Pinned Locked Moved General and Desktop
24 Posts 3 Posters 6.5k 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.
  • Z Offline
    Z Offline
    zeljko
    wrote on last edited by
    #1

    Using Qt-4.8.6 on intel mac 10.6.8. Everything is fine except that sometimes mouse is stucked (does not respond to clicks, but responds to keyboard).
    Find out that internal widget qt_button_down in qapplication_mac.mm is setted up to 0 when starting modal dialogs - see QApplicationPrivate::enterModal_sys(QWidget *widget), but it's not setted up to 0 when closing modal widget when it should be.

    So: When only one modal window is opened (from non modal widget eg. from QMainWindow, clicking on QPushButton) everything is perfect, but when another modal widget is opened from current modal widget then after closing second modal widget via QPushButton, first one does not respond to mouse clicks (even close button (x) does nothing). After closing first modal window with escape key, focus goes non-modal widget QPushButton and that's fine.
    Mouse does not respond (clicks), so start first modal form again via keyboard (key return on focused QPushButton) and close it via mouse click (it works not since enterModal_sys() sets qt_button_down to 0) - mouse is ok.
    Could this be an bug in QApplicationPrivate::leaveModal_sys(QWidget *widget) ? Should it reset qt_button_down if it belongs to some of it's children or window by itself ?
    In all cases mouseGrabber is fine (null).

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      That might indeed be bug. You should go on the "bug report system":http://bugreports.qt-project.org and check whether it's something known. If not, please consider opening a new report providing a minimal compilable example showing the problem. If it's already known don't hesitate to add your findings and the example if one is missing

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        zeljko
        wrote on last edited by
        #3

        Yes, I know that I can report it to the bugtracker, but just want to know if someone else got this problem. Besides that I'm pretty busy with my job and need some time to create quality example which triggers that bug without huge explanations. Thanks for your answer.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Then, lets try to summarize it: if you open a modal dialog from a modal dialog, the bug triggers ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • mrdebugM Offline
            mrdebugM Offline
            mrdebug
            wrote on last edited by
            #5

            Hi.
            I had a different problem with Mac OSX 10.6.
            When I had minimizing a form and then restore the form went to freeze.
            The problem was resolved upgrading to 10.7 or best.

            Need programmers to hire?
            www.labcsp.com
            www.denisgottardello.it
            GMT+1
            Skype: mrdebug

            1 Reply Last reply
            0
            • Z Offline
              Z Offline
              zeljko
              wrote on last edited by
              #6

              @SGaist: As i can see it depends how modal window is closed and what it does after closing. This triggers bug every time (thi is how it is my application):
              1.Open modal window (w1).
              2.Open another modal window from that window (w2) (PrintPreview)
              3.Open another modal window from w2 (w3) (My own print dialog)
              Now:
              If you close w3 on close button -> that's fine - works ok, but if you press button OK some slot which does some operation after closing (eg. put sleep(100) or printing in my case) when button OK is pressed ) then w2 is stucked. App does not respond to mouse clicks.
              Escape key is mapped to all forms so I'm closing w2 with Escape. W1 also does not respond to mouse clicks, ok Escape again. Main app window does not respond to clicks also, now by keyboard I start w1 again , and guess what: mouse clicks works. That's why I'm suspicious about QApplicationPrivate::leaveModal_sys(QWidget *widget) which does not reset some internal state, but it's done when QApplicationPrivate::enterModal_sys and qt_modal_stack is created, in case when closed modal form is doing some job before deleting itself.
              NOTE: with Qt-4.7.4 (Carbon) everything works fine.

              1 Reply Last reply
              0
              • Z Offline
                Z Offline
                zeljko
                wrote on last edited by
                #7

                hm...seem that it's something with QPushButton::default() or QPushButton::autoDefault().
                Forms which does not have QPushButton::default() setted up does not have such problem (no default button on form).

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Sorry, for the late reply

                  Can you post a minimal code sample to reproduce this ? Just to ensure the same setup is used

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • Z Offline
                    Z Offline
                    zeljko
                    wrote on last edited by
                    #9

                    Here is example of problem (always reproducible)
                    http://holobit.homelinux.com:38180/downloads/modalWindowsQtCocoaBug.tar.gz

                    Howto reproduce (best way): start modalWins.app (open modalWins.app or by dbl click in Finder).
                    Click "Create modal form" button, then click "New dialog", in New dialog form click "New Dialog" , so you have at least 2 dialogs + modal form opened.
                    Click OK to close dialog. Click OK again to close second dialog.
                    Now try to click anything in modal form ? Can you ? I guess not.
                    Ok, now press ESC, so modal form is closed and only QMainWindow is opened. Can you click any button ? No.

                    1 Reply Last reply
                    0
                    • Z Offline
                      Z Offline
                      zeljko
                      wrote on last edited by
                      #10

                      Here is example of problem (always reproducible)
                      http://holobit.homelinux.com:38180/downloads/modalWindowsQtCocoaBug.tar.gz

                      Howto reproduce (best way): start modalWins.app (open modalWins.app or by dbl click in Finder).
                      Click "Create modal form" button, then click "New dialog", in New dialog form click "New Dialog" , so you have at least 2 dialogs + modal form opened.
                      Click OK to close dialog. Click OK again to close second dialog.
                      Now try to click anything in modal form ? Can you ? I guess not.
                      Ok, now press ESC, so modal form is closed and only QMainWindow is opened. Can you click any button ? No.

                      1 Reply Last reply
                      0
                      • Z Offline
                        Z Offline
                        zeljko
                        wrote on last edited by
                        #11

                        Another note: when you extract tar.gz inside buildXXXX directory is already compiled modalWins.app, so you don't need to install build tools on mac.
                        Tested on Mavericks 9.5 (intel mac 64bit).

                        1 Reply Last reply
                        0
                        • Z Offline
                          Z Offline
                          zeljko
                          wrote on last edited by
                          #12

                          Another note: when you extract tar.gz inside buildXXXX directory is already compiled modalWins.app, so you don't need to install build tools on mac.
                          Tested on Mavericks 9.5 (intel mac 64bit).

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by
                            #13

                            The application itself is not deployed so it won't run.

                            Anyway, it's reproducible on 10.8.

                            You should check the "bug report system":http://bugreports.qt.io to see if you find something similar

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            0
                            • SGaistS Offline
                              SGaistS Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on last edited by
                              #14

                              The application itself is not deployed so it won't run.

                              Anyway, it's reproducible on 10.8.

                              You should check the "bug report system":http://bugreports.qt.io to see if you find something similar

                              Interested in AI ? www.idiap.ch
                              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                              1 Reply Last reply
                              0
                              • Z Offline
                                Z Offline
                                zeljko
                                wrote on last edited by
                                #15

                                Yes, something similar is here https://bugreports.qt.io/browse/QTBUG-40585 (I've attached this example here), but there's more similar bugs (3-4 at least) about modal windows on MacOSX.
                                I hope that someone will fix it before 4.8.7 is out. This really makes Qt 4.8.6 unuseable under mac cocoa.

                                1 Reply Last reply
                                0
                                • Z Offline
                                  Z Offline
                                  zeljko
                                  wrote on last edited by
                                  #16

                                  Yes, something similar is here https://bugreports.qt.io/browse/QTBUG-40585 (I've attached this example here), but there's more similar bugs (3-4 at least) about modal windows on MacOSX.
                                  I hope that someone will fix it before 4.8.7 is out. This really makes Qt 4.8.6 unuseable under mac cocoa.

                                  1 Reply Last reply
                                  0
                                  • Z Offline
                                    Z Offline
                                    zeljko
                                    wrote on last edited by
                                    #17

                                    I've attached patch to QTBUG-40585 which fixes problem for me.

                                    1 Reply Last reply
                                    0
                                    • Z Offline
                                      Z Offline
                                      zeljko
                                      wrote on last edited by
                                      #18

                                      I've attached patch to QTBUG-40585 which fixes problem for me.

                                      1 Reply Last reply
                                      0
                                      • SGaistS Offline
                                        SGaistS Offline
                                        SGaist
                                        Lifetime Qt Champion
                                        wrote on last edited by
                                        #19

                                        You should submit your patch through gerrit and make it reviewed for inclusion in Qt

                                        Interested in AI ? www.idiap.ch
                                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                        1 Reply Last reply
                                        0
                                        • SGaistS Offline
                                          SGaistS Offline
                                          SGaist
                                          Lifetime Qt Champion
                                          wrote on last edited by
                                          #20

                                          You should submit your patch through gerrit and make it reviewed for inclusion in Qt

                                          Interested in AI ? www.idiap.ch
                                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/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