xpra icon
Bug tracker and wiki

Opened 5 months ago

Closed 5 months ago

Last modified 5 months ago

#1557 closed enhancement (fixed)

Resize desktop size with regard to browser window size

Reported by: esarmien Owned by: Antoine Martin
Priority: major Milestone: 2.1
Component: html5 Version: trunk
Keywords: Cc:

Description

Hi Antoine,

We discussed this in a previous ticket.

At Harvard's Institute for Quantitative Social Science, we are going to be replacing NoMachine? site-wide with XPRA, running XPRA in containers and deploying them to Kubernetes to serve desktops to our academics and staff.

One crucial feature for us is to have the desktop size resize according to the desktop window, if possible, I would like:

  • The desktop to be the full size of the browser window initially
  • Resize accordingly when the browser window is resized

I imagine you could do this by using jQuery to intercept resize events and passing these to xrandr

Best,
Evan

Change History (11)

comment:1 Changed 5 months ago by esarmien

"One crucial feature for us is to have the desktop size resize according to the desktop window"

What I menat is resize desktop size according to BROWSER window

We will exclusively be using the HTML5 functionality in XPRA. Our users are social scientists and have had enough trouble downloading the NoMachine? client. Love the simplicity of HTML5. :-)

comment:2 Changed 5 months ago by Antoine Martin

Component: androidhtml5
Milestone: 2.1
Status: newassigned

Original discussion: ticket:1551#comment:16.

Related to #530 and #56.

We should be able to:

  • handle "desktop" windows differently and hide the window frame (as per other window types), make them centered within the browser window
  • actually handle browser resize events via randr (not sure why we don't already, the non-desktop mode does)

This should be easy and can be done for 2.1. Doing the same for the python client will be a little bit harder, but should be done at the same time.

Note: until #56 is dealt with, the resolution of the desktop may not match the browser's frame exactly. (hence why we need to make the view centered, to make it nicer to look at)

comment:3 Changed 5 months ago by Antoine Martin

Partially implemented in r16158 for the HTML5 client. This part was quite easy.

Still TODO:

  • center the desktop window and add a border around it
  • handle more than one desktop window forwarded by grouping them in a DIV container (for desktop sessions with multiple virtual screens)
  • python client update
  • generate more X11 dummy resolutions to reduce wasted space

comment:4 Changed 5 months ago by Antoine Martin

  • r16159: center desktop windows on screen, change screen background colour
  • r16160: add script to generate modelines, add those to the xorg.conf

With these changes, the solution works very well.
Unfortunately, I think that this has been implemented the wrong way: the resize should be triggered as a window event, not as a hook on the desktop-resize packet.
That's how the python client will be implemented, the html5 client should be changed to use the same method.

Last edited 5 months ago by Antoine Martin (previous) (diff)

comment:5 Changed 5 months ago by Antoine Martin

Implemented in the python client in r16165 (this is a server-side change only!).
r16162 was needed to fix a bug in the client handling of size hints (this needs to be backported)

The HTML5 client should be converted to use the same code path.

comment:6 Changed 5 months ago by Antoine Martin

Owner: changed from Antoine Martin to esarmien
Status: assignednew

Done in r16172: the desktop area is resized when the browser connects, and resized every time the browser window area changes.

@esarmien: please close if this works for you.
There are beta builds with these changes here: http://xpra.org/beta (done 64-bit builds for centos 7.3, fedora 26 and debian stretch - more later)

comment:7 Changed 5 months ago by esarmien

Owner: changed from esarmien to Antoine Martin

Wow, Antoine! This is great. I really appreciate the work you put into this. Our users will love it.

You can resolve this ticket. Is there any way you can track progress on removing the borders around the screen? That would be great, but, not as important as this.

comment:8 Changed 5 months ago by Antoine Martin

Resolution: fixed
Status: newclosed

The black borders are due to the lack of support for arbitrary resolutions in the dummy driver, you can subscribe to this ticket: #56

comment:9 Changed 5 months ago by Antoine Martin

Minor improvements:

  • r16202 handle clients requesting invalid sizes more gracefully (ie: GTK handling the aspect ratio limits differently)
  • r16203 workaround buggy GTK on macos
Last edited 5 months ago by Antoine Martin (previous) (diff)

comment:10 Changed 5 months ago by Antoine Martin

r16221 adds rate limiting to client resize requests to prevent dos.
Note: because this uses a timer, we should cancel it if we receive a resize notification directly from the X11 server (ie: when the user also uses a randr resizing tool of some sort) - meh.

See also #1567

Last edited 5 months ago by Antoine Martin (previous) (diff)

comment:11 Changed 5 months ago by Antoine Martin

This makes the Xdummy server a little bit slower to start, so r16252 increases the timeout used in the automated tests.

Note: See TracTickets for help on using tickets.