mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUAC-810: Resize client display depending only on containing element, not entire window.
This commit is contained in:
@@ -115,6 +115,13 @@ angular.module('client').directive('guacClient', [function guacClient() {
|
|||||||
*/
|
*/
|
||||||
var main = $element[0];
|
var main = $element[0];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The element which functions as a detector for size changes.
|
||||||
|
*
|
||||||
|
* @type Element
|
||||||
|
*/
|
||||||
|
var resizeSensor = $element.find('.resize-sensor')[0];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Guacamole mouse event object, wrapped around the main client
|
* Guacamole mouse event object, wrapped around the main client
|
||||||
* display.
|
* display.
|
||||||
@@ -491,8 +498,8 @@ angular.module('client').directive('guacClient', [function guacClient() {
|
|||||||
$scope.clientProperties.scale = $scope.clientProperties.minScale;
|
$scope.clientProperties.scale = $scope.clientProperties.minScale;
|
||||||
});
|
});
|
||||||
|
|
||||||
// If the window is resized, attempt to resize client
|
// If the element is resized, attempt to resize client
|
||||||
$window.addEventListener('resize', function onResizeWindow() {
|
resizeSensor.contentWindow.addEventListener('resize', function mainElementResized() {
|
||||||
|
|
||||||
// Send new display size, if changed
|
// Send new display size, if changed
|
||||||
if (client && display) {
|
if (client && display) {
|
||||||
|
@@ -32,11 +32,21 @@
|
|||||||
|
|
||||||
div.main {
|
div.main {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
position: fixed;
|
width: 100%;
|
||||||
top: 0;
|
height: 100%;
|
||||||
bottom: 0;
|
position: relative;
|
||||||
right: 0;
|
}
|
||||||
|
|
||||||
|
.resize-sensor {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
border: none;
|
||||||
|
opacity: 0;
|
||||||
|
z-index: -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.displayOuter {
|
div.displayOuter {
|
||||||
|
22
guacamole/src/main/webapp/app/client/templates/blank.html
Normal file
22
guacamole/src/main/webapp/app/client/templates/blank.html
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<!--
|
||||||
|
Copyright (C) 2014 Glyptodon LLC
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
-->
|
||||||
|
<html><body></body></html>
|
@@ -21,6 +21,9 @@
|
|||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
<!-- Resize sensor -->
|
||||||
|
<iframe class="resize-sensor" src="app/client/templates/blank.html"></iframe>
|
||||||
|
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
<div class="displayOuter">
|
<div class="displayOuter">
|
||||||
<div class="displayMiddle">
|
<div class="displayMiddle">
|
||||||
|
Reference in New Issue
Block a user