Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resize desktop size with regard to browser window size #1557

Closed
totaam opened this issue Jun 27, 2017 · 32 comments
Closed

Resize desktop size with regard to browser window size #1557

totaam opened this issue Jun 27, 2017 · 32 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Jun 27, 2017

Issue migrated from trac ticket # 1557

component: html5 | priority: major | resolution: fixed

2017-06-27 13:26:21: esarmien created the issue


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

@totaam
Copy link
Collaborator Author

totaam commented Jun 27, 2017

2017-06-27 13:27:18: esarmien commented


"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. :-)

@totaam
Copy link
Collaborator Author

totaam commented Jun 28, 2017

2017-06-28 10:38:01: antoine changed status from new to assigned

@totaam
Copy link
Collaborator Author

totaam commented Jun 28, 2017

2017-06-28 10:38:01: antoine changed component from android to html5

@totaam
Copy link
Collaborator Author

totaam commented Jun 28, 2017

2017-06-28 10:38:01: antoine commented


Original discussion: #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)

@totaam
Copy link
Collaborator Author

totaam commented Jul 1, 2017

2017-07-01 13:16:16: antoine commented


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

@totaam
Copy link
Collaborator Author

totaam commented Jul 2, 2017

2017-07-02 10:09:37: antoine commented


  • 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.

@totaam
Copy link
Collaborator Author

totaam commented Jul 2, 2017

2017-07-02 11:13:11: antoine commented


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.

@totaam
Copy link
Collaborator Author

totaam commented Jul 3, 2017

2017-07-03 13:19:05: antoine changed status from assigned to new

@totaam
Copy link
Collaborator Author

totaam commented Jul 3, 2017

2017-07-03 13:19:05: antoine changed owner from antoine to esarmien

@totaam
Copy link
Collaborator Author

totaam commented Jul 3, 2017

2017-07-03 13:19:05: antoine commented


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)

@totaam
Copy link
Collaborator Author

totaam commented Jul 5, 2017

2017-07-05 22:29:10: esarmien changed owner from esarmien to Antoine Martin

@totaam
Copy link
Collaborator Author

totaam commented Jul 5, 2017

2017-07-05 22:29:10: esarmien commented


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.

@totaam
Copy link
Collaborator Author

totaam commented Jul 6, 2017

2017-07-06 04:50:45: antoine changed status from new to closed

@totaam
Copy link
Collaborator Author

totaam commented Jul 6, 2017

2017-07-06 04:50:45: antoine set resolution to fixed

@totaam
Copy link
Collaborator Author

totaam commented Jul 6, 2017

2017-07-06 04:50:45: antoine commented


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

@totaam
Copy link
Collaborator Author

totaam commented Jul 6, 2017

2017-07-06 11:51:47: antoine commented


Minor improvements:

  • r16202 handle clients requesting invalid sizes more gracefully (ie: GTK handling the aspect ratio limits differently)
  • r16203 workaround buggy GTK on macos

@totaam
Copy link
Collaborator Author

totaam commented Jul 8, 2017

2017-07-08 11:38:16: antoine commented


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

@totaam
Copy link
Collaborator Author

totaam commented Jul 9, 2017

2017-07-09 16:19:24: antoine commented


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

@totaam
Copy link
Collaborator Author

totaam commented Dec 10, 2018

2018-12-10 16:48:11: pmeijer commented


Is this enabled by default or what options do I need to pass into xpra besides (--html=on)?
Are you guys on github? It's really awkward to track (no pun intended) the changes here. I found ​some repositories but they don't seem to be synced with this repo..
Thanks for an awesome application! Saved my day

@totaam
Copy link
Collaborator Author

totaam commented Dec 10, 2018

2018-12-10 17:17:22: antoine commented


  • no options are needed, this is supported in the html5 and python clients
  • we have no intention of syncing with a github repository again - there are third party repositories that do that

@totaam
Copy link
Collaborator Author

totaam commented Dec 10, 2018

2018-12-10 17:31:09: pmeijer commented


Replying to [comment:13 Antoine Martin]:

  • no options are needed, this is supported in the html5 and python clients
  • we have no intention of syncing with a github repository again - there are third party repositories that do that

OK, I'm using a browser (Chrome) as client. My problem to solve right now is that there is a huge window from one of the apps and there's no "global" scroll and the --max-size=800x600 doesn't seem to help either. Any other path around it?
Thanks for the fast reply!

@totaam
Copy link
Collaborator Author

totaam commented Dec 10, 2018

2018-12-10 18:13:37: antoine commented


OK, I'm using a browser (Chrome) as client. My problem to solve right now is that there is a huge window from one of the apps and there's no "global" scroll and the --max-size=800x600 doesn't seem to help either. Any other path around it?
This problem is unrelated to this ticket.
Try the beta 2.5 builds and use max-size on the server side.
The max-size switch is not configurable from the html5 client.

@totaam
Copy link
Collaborator Author

totaam commented May 30, 2019

2019-05-30 22:24:21: esarmien commented


Hi Antoine,

I think this problem has reappeared. I am using the latest stable XPRA on Fedora 30. I am including the generated bugreport zip. Resizing the browser window does not resize the desktop. I tried resizing in all different ways.

Best,
Evan

@totaam
Copy link
Collaborator Author

totaam commented May 30, 2019

2019-05-30 22:24:40: esarmien uploaded file bugreport (1).zip (157.1 KiB)

Resize not workig

@totaam
Copy link
Collaborator Author

totaam commented May 30, 2019

2019-05-30 22:30:48: esarmien commented


Please also see https://imgur.com/a/lZI82TY

@totaam
Copy link
Collaborator Author

totaam commented Jun 17, 2019

2019-06-17 05:56:39: antoine changed status from closed to reopened

@totaam
Copy link
Collaborator Author

totaam commented Jun 17, 2019

2019-06-17 05:56:39: antoine removed resolution (was fixed)

@totaam
Copy link
Collaborator Author

totaam commented Jun 17, 2019

2019-06-17 05:56:39: antoine edited the issue description

@totaam
Copy link
Collaborator Author

totaam commented Jun 17, 2019

2019-06-17 05:56:39: antoine commented


I can reproduce the problem.

@totaam
Copy link
Collaborator Author

totaam commented Jun 17, 2019

2019-06-17 07:04:39: antoine changed status from reopened to closed

@totaam
Copy link
Collaborator Author

totaam commented Jun 17, 2019

2019-06-17 07:04:39: antoine set resolution to fixed

@totaam
Copy link
Collaborator Author

totaam commented Jun 17, 2019

2019-06-17 07:04:39: antoine commented


Fixed in r22967. (will backport)

You can apply the fixes by hand or use the html5 client copy found here: [https://xpra.org/html5].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant