OpenStudioApplication icon indicating copy to clipboard operation
OpenStudioApplication copied to clipboard

Mac app does not alert user if EPW is reset on open

Open macumber opened this issue 2 years ago • 5 comments

Issue overview

Reported by @brgix in detail here https://github.com/openstudiocoalition/OpenStudioApplication/issues/653#issuecomment-1872964638

Details

Environment

Some additional details about your environment for this issue (if relevant):

  • Platform (Operating system, version): Mac M1 13.5
  • Version of OpenStudioApplication (if using an intermediate build, include SHA): 1.7.0-rc1

macumber avatar Dec 31 '23 20:12 macumber

Testing with https://github.com/rd2/tbd/blob/402f9f5acaa95e85bfdae33d28ea115e125db683/spec/files/osms/in/warehouse.osm#L6865-L6877

On Ubuntu, no issue. But I can reproduce the lockup of the App on Mac M1 (regardless of whether I use the classic or the C++ CLI)

jmarrec avatar Jan 08 '24 11:01 jmarrec

Seems like the issue is the two QMessageBox atop each other or something. It makes the mainwindow lose the focus I think.

image

If I comment out the lines here: https://github.com/openstudiocoalition/OpenStudioApplication/blob/a1f218a2d16bbfad2c00ac11cc1d5e46f212a8e8/src/openstudio_lib/OSDocument.cpp#L356-L357

then it works fine.

If I make it a direct call (not a QTimer::singleShot) it also works, but the second qmessagebox isn't showed. The one triggered from https://github.com/openstudiocoalition/OpenStudioApplication/blob/a1f218a2d16bbfad2c00ac11cc1d5e46f212a8e8/src/openstudio_app/OpenStudioApp.cpp#L375

I've also tried making the QMessageBox::warning point to a nullptr parent but that doesn't work either. Tried with OSAppBase::instance()->mainWidget() too

I've also tried moving the call after the waitDialog is hidden and the state of the MainWindow is restored, but wasVisible is actually false yo begin with anyways.

https://github.com/openstudiocoalition/OpenStudioApplication/blob/a1f218a2d16bbfad2c00ac11cc1d5e46f212a8e8/src/openstudio_lib/OSDocument.cpp#L300-L309

TL;DR: I don't know how to properly fix this one. As a workaround we can hide the dialog box. @macumber Any ideas?

jmarrec avatar Jan 08 '24 11:01 jmarrec

Bad workaround for now at #663

jmarrec avatar Jan 08 '24 12:01 jmarrec

Downgraded to regular bug since crash is fixed

macumber avatar Jan 22 '24 04:01 macumber

New scope of this bug would be to re-enable the warning to the user on Mac

macumber avatar Jan 22 '24 04:01 macumber