How to hide borders in a QTDialog under Wayland?
-
I'm developing a Qt application in Python that I would like make compatible with Sway/Wayland.
This simple script is supposed to create a modal window without borders neither title:
import sys from PyQt5.QtWidgets import QApplication, QDialog, QLabel from PyQt5.QtCore import Qt app = QApplication(sys.argv) d = QDialog() d.setModal(True) d.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint) d.setMinimumWidth(400) d.setMinimumHeight(400) d.setMaximumWidth(400) d.setMaximumHeight(400) QLabel('Hello world', d) d.show() sys.exit(app.exec_())
But the borders are still here:
It seems that this is not an issue with Sway, so I suppose it's a Qt issue?
-
Hi and welcome to devnet,
I don't see anything that is related to border nor title in your code. So I would say that either your code is incomplete or you don't have the correct expectation from Wayland. You are also not showing how you start your application.
-
@SGaist said in How to hide borders in a QTDialog under Wayland?:
Hi and welcome to devnet,
Thank you! :)
I don't see anything that is related to border nor title in your code.
It's this line:
d.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint)
You are also not showing how you start your application.
To execute under Wayland I do:
QT_QPA_PLATFORM=wayland-egl .venv/bin/python ./main.py
And for X11 (where borders are not present) I do:
QT_QPA_PLATFORM=xcb .venv/bin/python ./main.py
-
@roipoussiere said in How to hide borders in a QTDialog under Wayland?:
d.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint)
That line doesn't appear in the code of your original post.
Can you give more information about your Wayland setup ?
-
@SGaist said in How to hide borders in a QTDialog under Wayland?:
That line doesn't appear in the code of your original post.
I edited my post to add this specific line few minutes after submitting it. It's strange that you don't see it.
Can you give more information about your Wayland setup ?
I use Sway Window manager with the default config.
You can find here (after clinking on Details) the logs when executing my script with
WAYLAND_DEBUG=client
. -
Any news here?
Can someone confirm that this is a Qt issue on Wayland?
-
I reported this bug here: https://bugreports.qt.io/browse/QTBUG-80702