-
Notifications
You must be signed in to change notification settings - Fork 73
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
Lineplot window doesn't open on Wayland #4135
Comments
Hi, I don't have access to a machine to try this. To be sure, can you check which version of Qt and which binding Also, can you run the following code from from silx import sx; import numpy as np
w = sx.imshow(np.arange(100*100).reshape(100, 100)) To know which platform is used by default, you can run |
I am also on Gnome on Wayland (Ubuntu 22.04) and I cannot reproduce this, whether it is with Python 3.9 or 3.12. I think further information is needed then: see the instructions given by @t20100 |
Thanks for looking into this! Sorry for my delayed response.
Qt version 5.15.2, Qt binding PyQt5
At the moment it's matplotlib. Behavior is unchanged for opengl (after restart and confirming it's using opengl).
The lineplot also doesn't show up here.
It looks to me like that's also using qt5? Only in the first line it's
|
Can you try to run this script? It reproduces what from PyQt5 import QtCore, QtGui, QtWidgets
class MainWindow(QtWidgets.QMainWindow):
def __init__(self):
super().__init__()
btn = QtWidgets.QPushButton("Press")
self.setCentralWidget(btn)
btn.clicked.connect(self._clicked)
def _clicked(self):
print("new window")
new_window = QtWidgets.QMainWindow(self)
new_window.show()
app = QtWidgets.QApplication([])
window = MainWindow()
window.setAttribute(QtCore.Qt.WA_DeleteOnClose)
window.show()
app.exec() You can also try with the latest version of PyQt5 (5.15.11) and with other Qt bindings: PyQt6 and/or PySide6 to see if it is better. |
Thanks! When I click "Press" the script does open a new window. This works both with It just occured to me that e.g. the histogram window inside |
...but to me the lineplot is by far the most used feature! 😃 I understand though that this is not high priority for you. The workaround with |
Thanks for opening the issue! It's the first time we hear about this issue. I currently don't have much time to work on this project, but we'll figure out what is going wrong (It might take some time since we cannot reproduce it though). I would still bet on an issue with sub-windows in your particular set-up: Did you try with the latest Could you try this code? It's almost the same as the previous one, except for from PyQt5 import QtCore, QtGui, QtWidgets
class MainWindow(QtWidgets.QMainWindow):
def __init__(self):
super().__init__()
btn = QtWidgets.QPushButton("Press")
self.setCentralWidget(btn)
btn.clicked.connect(self._clicked)
def _clicked(self):
print("new window")
new_window = QtWidgets.QMainWindow(self, flags=QtCore.Qt.Dialog)
new_window.show()
app = QtWidgets.QApplication([])
window = MainWindow()
window.setAttribute(QtCore.Qt.WA_DeleteOnClose)
window.show()
app.exec() You can also try patching silx/src/silx/gui/plot/tools/profile/manager.py Lines 141 to 142 in a7da263
|
Thanks for coming back on this.
Ha! It seems to work with I see no downside of switching my overall workflow to The default of silx seems to be qt5, though? Installed with
This code opens a new window on click. The previous version of it also worked though.
Curiously, this does not change anything. Qt5 doesn't work, Qt6 works. |
+1
Yes, installing Qt5 has reaching the end of regular support and only receives updates under extended commercial support, so it's timely to consider switching the default to Qt6. I'm worried it will be tedious to find a workaround for this issue with pyqt5 since we are not able to reproduce it. |
When I use
silx view <file>
, look at an 2D image and do any line profile, the extra window with the line plot does not appear. No error is reported.When I use
the extra window does pop up.
What surprises me is that I'm used to
ipython3 --gui=qt5
working without any issues on Wayland, while silx appears to require the explicit QT flag.I'm on Fedora 40, Gnome on Wayland. silx is installed via pipx and running under Python 3.12.
The text was updated successfully, but these errors were encountered: