termux / termux-x11

Termux X11 add-on application.
https://termux.dev
GNU General Public License v3.0
2.14k stars 314 forks source link

Can add the center display mode? #319

Closed lsl330 closed 1 year ago

lsl330 commented 1 year ago

I hope to add a centered display mode, now with termux-x11 display, if the resolution can not be spread across the screen, the result will be displayed to the left, the right will leave a large string of blank. This is very uncomfortable. Can you add a centered display, so that the content of the display is placed in the middle of the screen, leaving a black border on the left and right.

twaik commented 1 year ago

Are you tasking about wine? It sounds like effect of "Emulate virtual desktop" feature. termux-x11 stretches image to fit the whole screen, with no exceptions, but it does not handle wine's Emulate virtual desktop.

lsl330 commented 1 year ago

Are you tasking about wine? It sounds like effect of "Emulate virtual desktop" feature. stretches image to fit the whole screen, with no exceptions, but it does not handle wine's .termux-x11``Emulate virtual desktop

But in x11, display resolution mode, exact mod can not set their own resolution. For example, I set the resolution to 19201080, however, my phone's resolution is 24001080. x11 will output a 1920 1080 screen. But the screen will be displayed on the left side of the phone, while the right side seems to leave a large blank. What I'm asking is, in this case, is it possible to have the 19201080 output result centered in a 2400*1080 screen? This seems to have nothing to do with the display of wine

twaik commented 1 year ago

Post a screenshot.

twaik commented 1 year ago

With "Emulate virtual desktop" option wine creates 800x600 window and uses it as a root window. There is no option to handle this.

lsl330 commented 1 year ago

I just tried it, and if I choose exact mode and set the resolution to 19201080, the display output will stretch all over the screen. That is, it becomes 24001080. But at the same time, the output screen will be Stretch display. So, is there a way to output the screen by certen display after setting the resolution in exact mode?

twaik commented 1 year ago

Do you use Google translate? I see words and understand what they mean, but do not see the meaning of sentences.

lsl330 commented 1 year ago

Screenshot_2023-05-24-09-25-27-900_com termux x11 Here's the screenshot, in exact mode, he will stretch to full screen instead of centering the screen proportionally. Also, now with box64droid you can set your own resolution before running, so it's not just possible to use 800*600 for output.

lsl330 commented 1 year ago

Do you use Google translate? I see words and understand what they mean, but do not see the meaning of sentences.

yes,i use deepl to translate to engligh,sorry

twaik commented 1 year ago

It looks like a problem of Xvfb/Xwayland or Wine. Or a problem of Wine working on top of Xvfb/Xwayland. Anyway I have no idea how to fix this.

twaik commented 1 year ago

What happens if you start xfce4-session? Is this rectangle filled?

lsl330 commented 1 year ago

It looks like a problem of Xvfb/Xwayland or Wine. Or a problem of Wine working on top of Xvfb/Xwayland. Anyway I have no idea how to fix this.

yes,it use xvfb

lsl330 commented 1 year ago

What happens if you start xfce4-session? Is this rectangle filled?

sorry,how to start xfce4-session,can you give me an example

twaik commented 1 year ago

It is described in readme.

twaik commented 1 year ago

It looks like I can reproduce this.

![image](https://github.com/termux/termux-x11/assets/9674930/c2917f1e-5f58-4285-a9f5-8ea6e2bb6214)

It looks like you have a display cutout and Android simply prevents hiding some content. I can make termux-x11 ignore this. I'll make a fix soon.

lsl330 commented 1 year ago

It looks like I can reproduce this.

It looks like you have a display cutout and Android simply prevents hiding some content. I can make termux-x11 ignore this. I'll make a fix soon.

thank you very much!!

twaik commented 1 year ago

Fixed by https://github.com/termux/termux-x11/commit/ee2224e474ce0c184de7a2c9c454c658f8afe249.