Browser resizing

Top  Previous  Next

 

When the browser window is resized by the end-user, you can make the connection resize proportionally to the new environment dimensions.

To do that you can perform a reconnection against ThinRDP Server (mythinrdp.restart()) on the browser resize event, so that the remote screen size will be updated with the new browser size.

Here is a code example that can be placed on the $(document).ready :

 

 

var resizeTimeout = null;

var waitToResize = 1000; // 1000 = 1 second (-1 deactivates it)

 

 

if (waitToResize != -1) $(window).bind("resize", restartToNewSize);

 

function restartToNewSize() {

 

if (mythinrdp && mythinrdp.connected) {

 

if (resizeTimeout) window.clearTimeout(resizeTimeout);

resizeTimeout = window.setTimeout(function () { mythinrdp.restart();}, waitToResize);

 

}

 

}