openstudiocoalition / OpenStudioApplication

The OpenStudio Application is a fully featured graphical interface to OpenStudio models including envelope, loads, schedules, and HVAC.
https://openstudiocoalition.org
Other
136 stars 25 forks source link

MacOS: Close Does Not Work #760

Open ed-p-may opened 1 month ago

ed-p-may commented 1 month ago

Issue

On MacOS, the red 'close' button in the toolbar, and Command-Q do not work. Nothing happens when they are clicked / enetered. The only way to quit the application is to mouse-select File, then Exit

Screenshot 2024-10-11 at 9 36 49 AM

Expected Behavior

Should quit like a normal Mac application on Command-Q, red-close-button, or File/Exit

Environment

jmarrec commented 1 month ago

Works on Ubuntu at least.

We are overriding the closeEvent for the MainWindow.

https://github.com/openstudiocoalition/OpenStudioApplication/blob/20695eebc7848f3a0e27a30ee9060ef3616e8179/src/openstudio_lib/MainWindow.cpp#L154-L161

jmarrec commented 1 month ago

Works on my M1 mac too, Sequoia 15.0, OpenstudioApp 1.8.0

close_mac

jmarrec commented 1 month ago

Is the QMainWindow not being enabled when you try this? https://doc.qt.io/qt-6/qwidget.html#enabled-prop

jmarrec commented 1 month ago

Marking this as "Can't Reproduce" for now but not closing it (Otherwise at least in a couple of weeks if there hasn't been any activity I'll know I can close it)

If you can help us reproduce @ed-p-may that'd be great! A simple set of steps to reproduce the issue would go a long way.

Also, is this an Intel or an Arm (M-series) mac?

What I have tried:

  1. Launch OpenStudioApp 1.8.0
  2. Wait for the loading to finish, and the main window becomes enabled (no longer greyed out/locked)
  3. Either click the Red cross close button, or do CMD+Q. Both work
ed-p-may commented 1 month ago

Thanks @jmarrec - I just did a reinstall and now it appears to be working as expected - thanks for taking a look! Seems to be working now though.

ed-p-may commented 3 weeks ago

Hi @jmarrec , all,

I ran into this bug again just now. I think I identified when it happens for me:

  1. First, make sure that OSM-Application is completely closed / quit
  2. Select a valid .oms file in the Finder, double click the file to launch the Application Screenshot 2024-11-01 at 2 17 50 PM
  3. The Application launches, and asks you to to Save to Don't Save the current file. Select Don't Save Screenshot 2024-11-01 at 2 17 59 PM
  4. The file opens in OpenStudio App
  5. Now the red-dot and/or Command-Q are non-responsive. The only way to quite is to manually select File / Exit with the mouse. Screenshot 2024-11-01 at 2 18 05 PM

When I open the App first, and then open the file using File / Open, or if the the App is already open, and then I double-click the file, the quite all works as expected. It is only if the App is closed and I double-click a .osm file to launch it that I encounter this bug.

@ed-p-may