Xpra-org / xpra-html5

HTML5 client for Xpra
Mozilla Public License 2.0
203 stars 55 forks source link

xpra shadows 1080x1920 screen / html5 client shows partial screen #206

Open fweng322 opened 2 years ago

fweng322 commented 2 years ago

Describe the bug With a special use case we're using vertical screen with resolution 1080x1920. Running xpra shadow --use-display=yes :0 --bind-tcp=0.0.0.0:33445 starts the xpra server. However when connecting to the server I could only see partial screen and no mouse/keyboard control at all.

To Reproduce Steps to reproduce the behavior:

  1. xpra shadow --use-display=yes :0 --bind-tcp=0.0.0.0:33445
  2. Open chrome (101.0) to connect http://this.ip:33445/

System Information (please complete the following information):

Additional context A screenshot is here: https://nextcloud.slat.org/index.php/s/P447B3SSBcFi5Ay you can see only middle part of the desktop is shown.

I can launch a program from the xpra menu Start->(desktop menu) but the mouse and keyboard has no effects.

totaam commented 2 years ago

Not sure how this is meant to work. If your browser window is too small to display the whole desktop, you will have to change the browser window scaling to see it. Adding scrollbars to the html5 client would also be possible.

This begs the question: why use shadow mode in the first place?

fweng322 commented 2 years ago

Not sure how this is meant to work. If your browser window is too small to display the whole desktop, you will have to change the browser window scaling to see it. Adding scrollbars to the html5 client would also be possible.

Does HTML5 client (Browser) automatically add scroll bar when the height is larger than browser?

This begs the question: why use shadow mode in the first place?

When we tried xpra start-desktop --use-display=yes :0 --bind-tcp=0.0.0.0:33445 , our screen became all black right after starting xpra server and could not get it back unless we re-plug HDMI cable. Using shadow mode would not have this problem. But honestly I have no idea what shadow mode means here ... maybe I have missed too much in the documentation

totaam commented 2 years ago

Does HTML5 client (Browser) automatically add scroll bar when the height is larger than browser?

IIRC, no, but this shouldn't be too hard to add.

When we tried xpra start-desktop --use-display=yes :0 --bind-tcp=0.0.0.0:33445 , our screen became all black

Well, yes. If :0 is your existing desktop session. It might do that. But why :0? And why start-desktop?

fweng322 commented 2 years ago

Does HTML5 client (Browser) automatically add scroll bar when the height is larger than browser?

IIRC, no, but this shouldn't be too hard to add.

When we tried xpra start-desktop --use-display=yes :0 --bind-tcp=0.0.0.0:33445 , our screen became all black

Well, yes. If :0 is your existing desktop session. It might do that. But why :0? And why start-desktop?

I want to control the existing :0 desktop from remote (like teamviewer or anydesk would do). Those (start-desktop / shadow) way were what I've tried and "seemed to work".

Could you please suggest the correct way to use xpra to remote control the existing desktop?

fweng322 commented 2 years ago

Does HTML5 client (Browser) automatically add scroll bar when the height is larger than browser?

IIRC, no, but this shouldn't be too hard to add.

And IIRC at first we tried this, all the desktop were scaled down with ratio into the browser. But I have no idea when and why it became what the screenshot shows.

totaam commented 2 years ago

Could you please suggest the correct way to use xpra to remote control the existing desktop?

xpra shadow is what you want if the session already exists, and only for that case as it is much slower than xpra start-desktop or xpra start.

fweng322 commented 2 years ago

Could you please suggest the correct way to use xpra to remote control the existing desktop?

xpra shadow is what you want if the session already exists, and only for that case as it is much slower than xpra start-desktop or xpra start.

Thank you.

Is there any way to 1) scale the display size down to specific size, e.g. from 1080x1920 to 540x960? 2) debug why my mouse click does not work? I could see mouse cursor moving (inner and outer together) but could not click anything. Keyboard seems not worked either. Is there any info I could trace or help me find where the problem is?

ehfd commented 2 years ago

@totaam This is the same issue that I have told you about a few days ago. Shadowing is required when people want to start an Xorg server with the NVIDIA driver and use full desktop streaming with Xpra. The best way is not to add a scroll bar, but enable fitting the window for local scaling automatically for full desktops. Else, not only does it not work on vertical monitors, but the problem arises for HiDPI client environments.

Similar issue: https://github.com/Xpra-org/xpra-html5/issues/75 Fork that if merged, might solve the issue: https://github.com/selkies-project/xpra-html5 Possible example of a solution: https://github.com/selkies-project/selkies-gstreamer/commit/2f7b3fc3879d2d9da3c126c45e509546016d0e74#diff-0d304525ef8be0fc0d86e5cc687c61589e8805f12bc5c7fd2181d893d111d23b

P.S. Moving this issue to xpra-html5 is desired.

totaam commented 2 years ago

@ehfd did you try @basilgello 's "client width" in xpra-html5 v5?

https://github.com/Xpra-org/xpra-html5/issues/75#issuecomment-882411033

ehfd commented 2 years ago

@totaam I did. But it would be more preferable to automate that with CSS. Even if I did that, the problem highlighted by this issue is still there.

fweng322 commented 2 years ago

I changed the topic of this issue to reflect display size problem. For keyboard / mouse problem I found that it seemed not related to the display size so I'll start another issue.

totaam commented 2 years ago

TBH, I'm not sure what either option would do. I'm really not a Javascript guy.

What I do know is that the html5 client needs to tell the server about the actual render size, so that if there's any downscaling needed then it will be applied server-side, before compression - not client side which is a complete waste of CPU and bandwidth.

The new ticket for clicks not working is: Xpra-org/xpra#3542

totaam commented 1 year ago

Shadowing is required when people want to start an Xorg server with the NVIDIA driver and use full desktop streaming with Xpra.

@ehfd No, that is incorrect. It isn't strictly required. A much better way is to take over the display, or to let xpra start the accelerated display server: https://github.com/Xpra-org/xpra/blob/master/docs/Usage/OpenGL.md#taking-over-an-existing-display (shadow should really be avoided if at all possible)

ehfd commented 1 year ago

@totaam Hmm, okay, I got to test that.

stdedos commented 2 months ago

Also https://github.com/Xpra-org/xpra/issues/2458 would be useful in that case (or https://github.com/Xpra-org/xpra-html5/issues/75, but there may be bw savings to be gained)