diff --git a/src/html5/css/client.css b/src/html5/css/client.css index bafaeec83f..edc9190a58 100644 --- a/src/html5/css/client.css +++ b/src/html5/css/client.css @@ -5,6 +5,11 @@ html, body { margin: 0; overflow: hidden; } + +body.desktop { + background-color: #555; +} + div#connect_form { display: none; } @@ -57,6 +62,11 @@ canvas { padding: 0; overflow: hidden; /* required for radius clip */ } +.window.desktop { + border-radius: 0; + box-shadow: none; +} + .window-NORMAL { border-radius: 6px; } diff --git a/src/html5/js/Client.js b/src/html5/js/Client.js index 7dc7c668ff..8e2864d57f 100644 --- a/src/html5/js/Client.js +++ b/src/html5/js/Client.js @@ -1624,6 +1624,9 @@ XpraClient.prototype._process_hello = function(packet, ctx) { } } ctx.server_is_desktop = Boolean(hello["desktop"]) || Boolean(hello["shadow"]); + if (ctx.server_is_desktop) { + jQuery("body").addClass("desktop"); + } ctx.remote_open_files = Boolean(hello["open-files"]); ctx.remote_file_transfer = Boolean(hello["file-transfer"]); diff --git a/src/html5/js/Window.js b/src/html5/js/Window.js index dbfee0325a..9d5fced566 100644 --- a/src/html5/js/Window.js +++ b/src/html5/js/Window.js @@ -113,6 +113,7 @@ function XpraWindow(client, canvas_state, wid, x, y, w, h, metadata, override_re } if (this.client.server_is_desktop) { + jQuery(this.div).addClass("desktop"); this.resizable = false; } else if(this.override_redirect) { @@ -273,6 +274,10 @@ XpraWindow.prototype.updateCanvasGeometry = function() { XpraWindow.prototype.updateCSSGeometry = function() { // set size of canvas this.updateCanvasGeometry(); + if (this.client.server_is_desktop) { + jQuery(this.div).position({of : jQuery("#screen")}); + return; + } // work out outer size this.outerH = this.h + this.topoffset + this.bottomoffset; this.outerW = this.w + this.leftoffset + this.rightoffset; @@ -325,6 +330,13 @@ XpraWindow.prototype.getMouse = function(e) { mbutton = Math.max(0, e.button)+1; //show("getmouse: button="+mbutton+", which="+e.which+", button="+e.button); + if (this.client.server_is_desktop) { + //substract window offset since the desktop's top-left corner should be at 0,0: + var pos = jQuery(this.div).position() + mx -= pos.left; + my -= pos.top; + } + // We return a simple javascript object (a hash) with x and y defined return {x: mx, y: my, button: mbutton}; }; @@ -425,7 +437,7 @@ XpraWindow.prototype.toString = function() { XpraWindow.prototype.update_zindex = function() { var z = 5000 + this.stacking_layer; - if (this.override_redirect) { + if (this.override_redirect || this.client.server_is_desktop) { z = 15000; } else if (this.windowtype=="DROPDOWN" || this.windowtype=="TOOLTIP" ||