Move window to 2nd display

Hi

This is the silimar issue to How to start separate Qt applications on two independent displays.

My set is Verdin-Plus and Development Board connected to 2 displays under TorizonCore OS.
Torizon(BSP) version is 5.4.193-5.7.0+git.f78299297185.
1st display is LVDS-1: 10"capasitive-touch LCD[1280x800] connected via Verdin DSI to LVDS Adapter.
2nd display is HDMI-A-1: HDMI display[1280x1024] connected via Native HDMI port.

I just modified the code as follows from Qt sample code of sliders.
Unfortunately slider window does not move to 2nd display and it’s still on 1st display.
The same code works fine on Windows PC and slider window is on 2nd display after changing the display geometry to window.move(1920, 0) which is for my PC.

This issue has been fixed?
If so, please let me know how to solve or some reference sites explaining the solution.

Thanks and regards
ujsugi

---- main() Modified —
#include <QtWidgets/QApplication>
#include
#include
#include
#include
#include “window.h”

using namespace std;

int main(int argc, char argv[])
{
#ifdef Q_OS_ANDROID
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
QApplication app(argc, argv);
QList <QScreen
> screens = app.screens();
QList <QScreen*>::iterator pos;
int i=0;
QRect r;
for(pos=screens.begin(); pos!=screens.end(); ++pos){
r = (*pos)->geometry();
int w = (*pos)->geometry().width();
int h = (*pos)->geometry().height();
printf(“screen[%d] = (%d, %d)\n”, i++, w, h); // See the below!!!
}

Window window;
window.show();

// window.move(r.bottomLeft()); // Not work!!!???
window.move(1280, 0); // Not work??? → window.move(1920, 0) for my PC
// window.showMinimized();
// window.showMaximized();
// window.showFullScreen();

return app.exec();

}

Display geometry output as follows
screen[0] = (1280, 800)
screen[1] = (1280, 1024)

Greetings @ujsugi,

I’m admittedly not too familiar with Qt applications and such. However, we do have an article that might help you: Working with Weston on TorizonCore | Toradex Developer Center

Using this app-id method described in the article it’s possible to tell Weston to redirect an application to a certain display. This should generally work on all kinds of applications.

Also if you haven’t already it might be worth a try to ask your question on the Qt forums, for a more Qt specific answer as well.

Best Regards,
Jeremias

Jeremias

Thanks for your quick prompt.
I tried to redirect with app-ids and I got it work for 2 appications to be displayed in different LCD.
This way works with kiosk-shell only, doesn’t it?

Thanks and regards
Y.Sugiyama

I tried to redirect with app-ids and I got it work for 2 appications to be displayed in different LCD.

Glad to hear it works!

This way works with kiosk-shell only, doesn’t it?

I believe so. This is backed up by the official Weston documentation: Weston kiosk-shell — weston 12.0.90 documentation

Best Regards,
Jeremias

Jeremias

Thanks for supporting.
Regarding official Weston documentation, 2 applications are set to 1 screen as below. In this case, how to choose which one is emerged and which one is hidden?
Docker stop command like $ docker stop org.domain.app1 is one but I like to know if there is any other way to do that with keyboard connected to Torizon like ALT+TAB…

[output]
name=screen0
app-ids=org.domain.app1,com.domain.app2

Thanks and regards
ujsugi

Regarding official Weston documentation, 2 applications are set to 1 screen as below. In this case, how to choose which one is emerged and which one is hidden?

So I just tried this as a test. I set 2 applications under app-ids. I launched one application and it showed up on the display. When I tried to launch the other application it exited immediately without displaying anything. If I switch the order I start the applications then the other application takes the screen instead and then the 2nd application exits without displaying anything.

I used simple Qt example graphical apps as my test applications. So it doesn’t seem like you can do 2 applications on one screen with method, or maybe it requires special configuration. It depends on how Weston handles this I guess. I can’t seem to find any Weston documentation explaining how this case is handled.

Best Regards,
Jeremias