Open YuXHe15 opened 1 year ago
I did a little research around stackoverflow and one answer mentioned that it could happen when the window id passed is not correct, which can be found here: https://stackoverflow.com/questions/34704542/in-linux-get-window-class-raise-x-error-of-failed-request-badwindow-invalid I don't know if it would be helpful
Hi there,
I get the exact same error output. I'm working with virtualenv. I tried with pyqt5, pyqt6, pyside6 (using os.environ["QT_API"]
) and get the same error as soon as the BackgroundPlotter
is instantiated.
I did several tests to understand if the issue is related to pyqt/pyside or qtpy or pyvista or pyvistaqt:
Here is an example that works. But if I uncomment QtInteractor
or BackgroundPlotter
lines I get the same error message.
import os
os.environ["QT_API"] = "pyside6"
from qtpy.QtWidgets import *
from pyvistaqt import QtInteractor, BackgroundPlotter
class MainWindow(QDialog):
def __init__(self, parent=None):
QDialog.__init__(self, parent)
self.frame = QFrame()
vlayout = QVBoxLayout()
self.frame.setLayout(vlayout)
if __name__ == '__main__':
import sys
app = QApplication(sys.argv)
# Produces X error: BadWindow
#plotter = BackgroundPlotter(False, app=app)
win = MainWindow()
# Produces X error: BadWindow
#interactor = QtInteractor(win)
win.show()
sys.exit(app.exec())
I wonder if it's related to my Qt installation, or Wayland. My config:
Additional information: The issue only occurs on Wayland. Running the problematic example on X11 works. As a workaround, you can force Qt to use X11 instead of Wayland:
export QT_QPA_PLATFORM=xcb
python app.py
Same problem with Ubuntu 24.04 LTS which defaults to Wayland.
Hi I was trying the small example of pyvistaqt, namely
while I got error:
After checking line by line I found it happends after creating the instance plotter of BackgoundPlotter()
My system is Ubuntu 22.04.2 LTS, using python 3.10