Wayland : Creating a fake screen in order for Qt not to crash
-
I'am having a trouble turning on off screen on wyaland .
Using these commands on my RPI5, ( using labwc)- wlr-randr --output HDMI-A-1 --on
- wlr-randr --output HDMI-A-1 --off
Makes my app crash the last log i can see as important is ;
QCoreApplication::postEvent: Unexpected null receiver qt.qpa.wayland: Creating a fake screen in order for Qt not to crash MainWindow::processExited Le processus NeoScheduler a termine par lui-memeIs there any solution ? is it a known issue ?
Thank you -
Hi, @The-Qt-Mayssa ,
can you please post a minimal compilable reproducer? -
Hello @Axel-Spoerl ,
I’m running a Qt Widgets application on Wayland (Raspberry Pi 5, wlroots-based compositor).
Qt version : 5.15.17The app is started with:
export QT_QPA_PLATFORM=wayland export WAYLAND_DISPLAY=wayland-0 ./myAppWhen I disable the display using:
wlr-randr --output HDMI-A-1 --offthe application crashes or becomes unstable.
This also happens when the command is executed via SSH.
When I re-enable the output:
wlr-randr --output HDMI-A-1 --onthe issue still occurs.
It seems that removing the output entirely from Wayland causes Qt to crash.
Questions:
- Is this a known limitation of Qt Widgets on Wayland?
- What is the recommended way to handle display power management in this setup?
- Should outputs be avoided from being fully disabled when using Qt?
Thanks for your help.
-
Well, that's not a reproducer.
It's how you start the app that crashes.
However, Qt 5.15 has been EOL for a long time.
The wayland implementation has been hardened recently.
Please use Qt 6.8 or later. -
Well, that's not a reproducer.
It's how you start the app that crashes.
However, Qt 5.15 has been EOL for a long time.
The wayland implementation has been hardened recently.
Please use Qt 6.8 or later.@Axel-Spoerl Passing to qt6 , is more complicated then that. The idea is to keep app working , fixing some bugs ( the eolution to qt6 is not an option today :// )
i start the app manually via a script launch.sh , that sets the exports values then ./myapp.Knowing the app crashes only when doing wlr-randr command to turn on off screen.
I already added logs to debug ( since i'm cross compiling to deploy on a light version of tirixie :') ) , i'm getting this as a last log2026.03.25 13:16:08 Creating a fake screen in order for Qt not to crash 2026.03.25 13:16:08[D] step Primary screen changed: QScreen(0x73a0270, name="") 2026.03.25 13:16:08[D] step Screen removed: QScreen(0x6ec0510, name="HDMI-A-1")the code:
QObject::connect(&app, &QGuiApplication::screenRemoved, [](QScreen *screen){ qDebug() << "step Screen removed:" << screen; }); QObject::connect(&app, &QGuiApplication::primaryScreenChanged, [](QScreen *screen){ qDebug() << "step Primary screen changed:" << screen; }); -
@The-Qt-Mayssa
I think we're talking in circles.
If you want someone in the forum to analyze the problem, you need to provide a minimal reproducer. In the unlikely case that it's a bug in Qt, it won't be fixed in an EOL version.
You will have to upgrade at some point anyway.