mpogue2 / SquareDesk

Fully-featured music player and sequence designer, designed for square dance callers
10 stars 4 forks source link

Bug: Context Menu > Load Playlist... doesn't work first time after app starts #1100

Open mpogue2 opened 5 months ago

mpogue2 commented 5 months ago

Always works the second time.

mpogue2 commented 4 months ago

1.0.7 does not have this problem. 1.0.7 built with Macosx14.5 DOES have this problem. Top-of-tree with 14.5 executed from within QtCreator works fine. Top-of-tree with 14.5 executed from command line, executable inside the build directory, works fine. Top-of-tree with 14.5 double-clicked from finder DOES have this problem.

Geez.

mpogue2 commented 4 months ago

This problem was not fixed by upgrading to Qt6.7.1 .

mpogue2 commented 4 months ago

Actually, NONE of the playlist context menu items work the first time the playlist context is instantiated. It's not just the Load Playlist... item that fails. They all work the SECOND time it's instantiated.

With debug output going to the debug.log file, I can see that loadPlaylistFromFileToSlot() is never getting called the first time, and it's always being called the second time.

mpogue2 commented 4 months ago

AND, after much testing:

mpogue2 commented 4 months ago

Even weirder:

mpogue2 commented 4 months ago

Commit: e2a075219a9ff720a0a15fd2a07e1f503e493bf3 fixes this.

This is SO weird. It has something to do with the internal state of the mainWindow, and I was able to get it back to a good state by doing setVisible(false), then setVisible(true). Don't ask me why this works, but I was poking around doing a LOT of different things with mainWindow and splashScreen visibility to try to simulate clicking away from SquareDesk and back again at app start time, and this method seemed to work 100% of the time.