Lags on window resize with PySide6 and QML (linux)
-
Hi, I really want to use QML together with python, but for some reason I can't get window resizing to work properly. Every time a window is resized the content lags behind a bit and after un-maximizing the window the whole geometry seems to get stuck in that maximized state until the window is resized manually. In applications based on widgets this does not happen.
I use KDE wayland, but have tried to replicate this with: the application running on xwayland, KDE X11 and gnome (both with the application running on xwayland and natively again). In every case the issue was not as bad as on KDE with wayland, but it still persisted – instead of the content exiting the main window there is a black frame.
Any idea how to fix this?
I'm running python 3.10.4 in a miniconda environment with PySide version 6.3.1. My os is a rather fresh installation of archlinux with, as mentioned, KDE as my desktop environment. Haven't tried this on any other os or linux distribution.
The program I wrote is pretty basic.
main.py
import sys from PySide6.QtCore import Qt from PySide6.QtQml import QQmlApplicationEngine from PySide6.QtWidgets import QApplication if __name__ == "__main__": app = QApplication(sys.argv) engine = QQmlApplicationEngine() engine.quit.connect(app.quit) engine.load("main.qml") sys.exit(app.exec())
main.qml
import QtQuick import QtQuick.Controls ApplicationWindow { id: root visible: true minimumWidth: 600 minimumHeight: 400 color: "#363642" Item { anchors.fill: parent Rectangle { x: 0 y: 0 width: parent.width height: 90 color: "#2a2a35" } Rectangle { x: 0 y: 72 width: parent.width height: 36 radius: 18 color: "#363642" } } }