QT5 Application Screen not refreshing after resolution change through Linux framebuffer.
-
wrote on 20 Sept 2022, 14:47 last edited by Kishan Mandaliya
Having issue at runtime after changing framebuffer resolution,
I have Qt 5.14.2 running on top of linuxfb platform plugin. My QApplication come up in 1024X768 resolution, then change to 1280x1024 resolution using ioctl call to fbdev.
The resolution changed and I can confirm looking at fbset output. The problem I am seeing is that after changing the resolution to 1280x1024 Qt still reports it as 1024X768.Using below code I could resolved that issue and after Qt reported correct resolution also.
QWindowSystemInterface::handleScreenGeometryChange(qApp->screens().first(), QRect(0,0,xNewWidth,yNewHeight), QRect(0,0,cur_xres,cur_yres));
QWindowSystemInterface::setSynchronousWindowSystemEvents(true);
// Print out resolution from Qt
QRect res = QApplication::desktop()->screenGeometry();
qDebug << " QApplication resolution is now "<< res.width() << "x"<< res.height() ;But still screen striding have seen as you can see below screenshot,
In QT4 below code was handling screen refreshment after changing fbdev resolutions, it was working fine. However in QT5 QWSServer is gone, and QPA abstraction layer introduced. What is replacement for blow code in QT5?
QScreen *screen = QScreen::instance(); screen->disconnect(); screen->connect(/dev/fb0); QWSServer *qwsserver = QWSServer::instance(); qwsserver->refresh();
Application works normal after restarting QT Application.
Does anyone help how to force Qt to refresh/recheck/update the resolution it is reporting? Or what might be missing from the linuxfb plugin to notify Qt that something has changed under the hood?
1/1