Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MAC] Double-click to open a file and cannot activate the minimized NN window #543

Open
ErickWei opened this issue Apr 7, 2024 · 5 comments
Labels
macos Related specifically to macOS

Comments

@ErickWei
Copy link
Contributor

ErickWei commented Apr 7, 2024

When NN is already open and minimized, double-clicking another file will not wake up NN. The NN window needs to be restored manually, then the file will be imported by NN.

Kapture.2024-04-07.at.12.36.39.webm
@ErickWei ErickWei changed the title Double-click to open a file and cannot activate the minimized NN window [MAC] Double-click to open a file and cannot activate the minimized NN window Apr 7, 2024
@ErickWei
Copy link
Contributor Author

ErickWei commented Apr 7, 2024

But on windows,is another issue.
When NN is already open and minimized, double-clicking another file can activate NN window,but the file not loaded at all.

@dail8859
Copy link
Owner

dail8859 commented Apr 7, 2024

When NN is already open and minimized, double-clicking another file can activate NN window,but the file not loaded at all.

It is working fine for me. I'm on Windows 11, master branch, using Qt6.5.3

@dail8859
Copy link
Owner

dail8859 commented Apr 7, 2024

Mac works a bit differently when opening files. It send an event to the application and is handled here:

// Handle the QFileOpenEvent to open files on MacOS X.
if (event->type() == QEvent::FileOpen) {
QFileOpenEvent *fileOpenEvent = static_cast<QFileOpenEvent*>(event);
qInfo("QFileOpenEvent %s", qUtf8Printable(fileOpenEvent->file()));
openFiles(QStringList() << fileOpenEvent->file());
return true;
}

And again the bringWindowToForeground() method might need updated as well, but it is weird it is not receiving the request to open the file.

@dail8859 dail8859 added the macos Related specifically to macOS label Apr 7, 2024
@ErickWei
Copy link
Contributor Author

ErickWei commented Apr 8, 2024

Windows server 2022,NN is the last release version.

Kapture.2024-04-08.at.08.33.21.webm

When NN is already open and minimized, double-clicking another file can activate NN window,but the file not loaded at all.

It is working fine for me. I'm on Windows 11, master branch, using Qt6.5.3

@dail8859
Copy link
Owner

dail8859 commented Apr 8, 2024

Windows server 2022,NN is the last release version.

That is very odd. Not sure if the debug logs points to any indication of the cause...or if more debug info needs added to that part of the application to help. The third party library used for that SingleApplication is likely the cause but I cannot say that for certain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
macos Related specifically to macOS
Projects
None yet
Development

No branches or pull requests

2 participants