I have a customized linux (Debian, we've removed the desktop environment), where we run our application with X11. The screen size is 1024x768, and the app's window fills the screen. Now the application's window's width is 2048, and an other monitor is connected to the computer with HDMI. The resolution of the second monitor is also 1024x768.

We have 2 problems:

Case 1: If the HDMI is pluged, and I start the computer, and our app starts after the boot process, we can see that our window fills the two monitors. But in this case if I touch the computer's screen (touchscreen) on the (X;Y) position, the system thinks we've touched that screen on (X*2;Y).

Case 2: If the HDMI is unplugged, and I start the computer, our app starts after the boot process. I plug the HDMI AFTER THIS, and I reconfigure the X11 to use dual monitor. In this case I can see my app on the computer's screen, but I can not see the left half of my app on the second screen, only the X11 background. The touch works perfectly, but my mouse cursor stucks on the first screen.

This is the command what I use for X11 configuration:

xrandr --output HDMI1 --mode 1024x768 --pos 1024x0 --rotate normal --output eDP1 --mode 1024x768 --pos 0x0 --rotate normal

I always execute this command before starting my application. What is the problem (or problems)?


My application is a Qt-based program using eglfs platform. The source of the problem was the eglfs, if I execute the following commands before running my app, then the xrandr works perfectly:

xrandr --fb 2048x768 export QT_QPA_EGLFS_WIDTH=2048 export QT_QPA_EGLFS_HEIGHT=768

The touch is still wrong, but I think that it is an other problem, so I open a new question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.