MacOSX: problem with stucked mouse with modal forms



  • 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).


  • Lifetime Qt Champion

    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



  • 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.


  • Lifetime Qt Champion

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



  • 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.



  • @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.



  • 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).


  • Lifetime Qt Champion

    Sorry, for the late reply

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



  • 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.



  • 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.



  • 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).



  • 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).


  • Lifetime Qt Champion

    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


  • Lifetime Qt Champion

    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



  • 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.



  • 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.



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



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


  • Lifetime Qt Champion

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


  • Lifetime Qt Champion

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



  • I know, but first I must make heavy tests for my patch.Already found one more bug, but that bug exists without my patch too ... yes also about modal windows. Now modal windows works, but cannot when I try to close modal window via close button in title bar it does not work.



  • I know, but first I must make heavy tests for my patch.Already found one more bug, but that bug exists without my patch too ... yes also about modal windows. Now modal windows works, but cannot when I try to close modal window via close button in title bar it does not work.


  • Lifetime Qt Champion

    Even if its not 100% working you can submit to review, that will give you the help of other reviewers to pin-point the problem you are encountering. If you see that you have several unrelated bugs then do a submission for each separately.


  • Lifetime Qt Champion

    Even if its not 100% working you can submit to review, that will give you the help of other reviewers to pin-point the problem you are encountering. If you see that you have several unrelated bugs then do a submission for each separately.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.