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
Closing the splash screen sends PySide6
message boxes to the back on Windows
#8338
Comments
Hmm, the message box seems to display as expected on my test systems, but it could be a timing issue. Either way, if you are using splash in onedir mode, you are essentially mixing tkinter and PySide6 in the same process, and I'm not really sure if that's supposed to work. What happens if you close the splash before instantiating |
Two questions:
I doubt that, because ...
You mean like this? import sys
if hasattr(sys, "_MEIPASS"):
import pyi_splash
pyi_splash.close()
from PySide6.QtWidgets import QApplication, QMessageBox, QWidget
app = QApplication()
QMessageBox.information(QWidget(), "Title", "Message") Exactly the same thing, in both cases. When doing the opposite, namely, closing the splash screen long after the message box has appeared ... import sys
from PySide6.QtWidgets import QApplication, QMessageBox, QWidget
app = QApplication()
if hasattr(sys, "_MEIPASS"):
import pyi_splash
from PySide6.QtCore import QTimer
QTimer.singleShot(5000, pyi_splash.close)
QMessageBox.information(QWidget(), "Title", "Message") ... I can observe the following:
So I think there are two sub-issues here:
I care about the first issue more than the second, because that is one I can influence. This works, for example, at the expense of having another unnecessary window open:
But this is not too bad - it's basically a limitation of |
Yes - since the report was about Windows, I tried to reproduce it there (Win 10 and Win 11 VMs, and Win 10 on my notebook).
Aha, that makes more sense. I'm running the build and program from the command-prompt, and while I can see the dialog, it is indeed unfocused. If I do a onefile build with splash screen instead, the dialog is focused - because the splash is displayed in the parent process and the PySide dialog in the child process, so there is no overlap between the two. FWIW, I don't think that using PyInstaller's splash makes much sense in onedir applications that use Qt bindings, since you can show up a Qt-based splash at the start of your program. (Whereas in onefile, the splash is there to inform users that something is happening while the program is unpacking itself, so before you could show your own splash screen from the program). |
Aha, thanks for the further explanations. I can confirm that it does not happen in |
Description of the issue
In some modes, my PySide6 app exits with nothing more than a message box. However, when I deploy my app with a splash screen, that message box is hidden behind all other windows.
Context information (for bug reports)
pyinstaller --version
:6.4.0
scoop
A minimal example program which shows the error
Then run
or even
In both cases, the message box opens in the foreground.
You can also remove
pyi_splash.close()
and runBut restore the original code above and run
Notice how the message box is opened in the background.
I tried closing the splash screen after opening the message box (using the
QTimer
code), but that also sends the message box to the background.The text was updated successfully, but these errors were encountered: