xpra icon
Bug tracker and wiki

Ticket #2705: 5 simplifications.patch

File 5 simplifications.patch, 10.3 KB (added by brief, 3 months ago)
  • src/html5/index.html

     
    659659                                                                        "video"                         : video,
    660660                                                                        "mediasource_video"     : mediasource_video,
    661661                                                                        "remote_logging"        : remote_logging,
    662                                                                         "insecure"                      : insecure,
    663662                                                                        "ignore_audio_blacklist" : ignore_audio_blacklist,
    664663                                                                        }
    665664                                                        for (var i=0, len=client.debug_categories.length; i < len; i++) {
  • src/html5/js/Client.js

     
    24542454                const snd = new Audio("data:audio/wav;base64,//uQRAAAAWMSLwUIYAAsYkXgoQwAEaYLWfkWgAI0wWs/ItAAAGDgYtAgAyN+QWaAAihwMWm4G8QQRDiMcCBcH3Cc+CDv/7xA4Tvh9Rz/y8QADBwMWgQAZG/ILNAARQ4GLTcDeIIIhxGOBAuD7hOfBB3/94gcJ3w+o5/5eIAIAAAVwWgQAVQ2ORaIQwEMAJiDg95G4nQL7mQVWI6GwRcfsZAcsKkJvxgxEjzFUgfHoSQ9Qq7KNwqHwuB13MA4a1q/DmBrHgPcmjiGoh//EwC5nGPEmS4RcfkVKOhJf+WOgoxJclFz3kgn//dBA+ya1GhurNn8zb//9NNutNuhz31f////9vt///z+IdAEAAAK4LQIAKobHItEIYCGAExBwe8jcToF9zIKrEdDYIuP2MgOWFSE34wYiR5iqQPj0JIeoVdlG4VD4XA67mAcNa1fhzA1jwHuTRxDUQ//iYBczjHiTJcIuPyKlHQkv/LHQUYkuSi57yQT//uggfZNajQ3Vmz+Zt//+mm3Wm3Q576v////+32///5/EOgAAADVghQAAAAA//uQZAUAB1WI0PZugAAAAAoQwAAAEk3nRd2qAAAAACiDgAAAAAAABCqEEQRLCgwpBGMlJkIz8jKhGvj4k6jzRnqasNKIeoh5gI7BJaC1A1AoNBjJgbyApVS4IDlZgDU5WUAxEKDNmmALHzZp0Fkz1FMTmGFl1FMEyodIavcCAUHDWrKAIA4aa2oCgILEBupZgHvAhEBcZ6joQBxS76AgccrFlcz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9aaaZTGMuj9mpu9Mpio1dXrr5HERTZSmqU36A3CumzN/9Robv/Xx4v9ijkSRSNLQhAWumap82WRSBUqXStV/YcS+XVLnSS+WLDroqArFkMEsAS+eWmrUzrO0oEmE40RlMZ5+ODIkAyKAGUwZ3mVKmcamcJnMW26MRPgUw6j+LkhyHGVGYjSUUKNpuJUQoOIAyDvEyG8S5yfK6dhZc0Tx1KI/gviKL6qvvFs1+bWtaz58uUNnryq6kt5RzOCkPWlVqVX2a/EEBUdU1KrXLf40GoiiFXK///qpoiDXrOgqDR38JB0bw7SoL+ZB9o1RCkQjQ2CBYZKd/+VJxZRRZlqSkKiws0WFxUyCwsKiMy7hUVFhIaCrNQsKkTIsLivwKKigsj8XYlwt/WKi2N4d//uQRCSAAjURNIHpMZBGYiaQPSYyAAABLAAAAAAAACWAAAAApUF/Mg+0aohSIRobBAsMlO//Kk4soosy1JSFRYWaLC4qZBYWFRGZdwqKiwkNBVmoWFSJkWFxX4FFRQWR+LsS4W/rFRb/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////VEFHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAU291bmRib3kuZGUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMjAwNGh0dHA6Ly93d3cuc291bmRib3kuZGUAAAAAAAAAACU=");
    24552455                snd.play();
    24562456        }
    2457         return;
    24582457};
    24592458
    24602459/**
     
    25502549                const window = ctx.id_to_window[wid];
    25512550                window.reset_cursor();
    25522551        }
    2553         return;
    25542552};
    25552553
    25562554XpraClient.prototype._process_cursor = function(packet, ctx) {
     
    26312629                }
    26322630                // schedule a screen refresh if one is not already due:
    26332631                if (this.draw_pending==0) {
    2634                         const now = Utilities.monotonicTime();
    2635                         this.draw_pending = now;
     2632                        this.draw_pending = Utilities.monotonicTime();
    26362633                        const me = this;
    26372634                        window.requestAnimationFrame(function() {
    26382635                                me.debug("draw", "animation frame:", me.pending_redraw.length, "windows to paint, processing delay", Utilities.monotonicTime()-me.draw_pending, "ms");
  • src/html5/js/Keycodes.js

     
    16961696        144     : "Num_Lock",
    16971697        145     : "Scroll_Lock",
    16981698        160     : "dead_circumflex",
    1699         167 : "underscore",
    17001699        161     : "exclam",
    17011700        162     : "quotedbl",
    17021701        163     : "numbersign",
  • src/html5/js/Protocol.js

     
    529529
    530530
    531531// initialise LZ4 library
    532 const Buffer = require('buffer').Buffer;
    533532const LZ4 = require('lz4');
  • src/html5/js/Utilities.js

     
    246246                        isOpera = winNav.userAgent.includes("OPR"),
    247247                        isIEedge = winNav.userAgent.includes("Edge"),
    248248                        isIOSChrome = winNav.userAgent.match("CriOS");
    249                   if (isIOSChrome) {
    250                           return true;
    251                   }
    252                   else if (isChromium !== null && isChromium !== undefined && vendorName === "Google Inc." && isOpera === false && isIEedge === false) {
    253                           return true;
    254                   }
    255                   else {
    256                           return false;
    257                   }
    258         },
     249                if (isIOSChrome) {
     250                        return true;
     251                }
     252                return (isChromium!==null && isChromium!==undefined && vendorName==="Google Inc." && isOpera===false && isIEedge===false);
     253        }
     254        ,
    259255        isIE : function() {
    260256                return navigator.userAgent.includes("MSIE") || navigator.userAgent.includes("Trident/");
    261257        },
  • src/html5/js/Window.js

     
    318318                this.x = Math.min(oldx, ww - min_visible);
    319319        }
    320320        if(oldy <= min_visible) {
    321                 this.y = 0 + this.topoffset;
     321                this.y = parseInt(this.topoffset);
    322322        }
    323323        else if (oldy >= wh - min_visible) {
    324324                this.y = Math.min(oldy, wh - min_visible);
     
    749749        // in future we may have a taskbar for minimized windows
    750750        // which should be subtracted from screen size
    751751        const screen_size = this.client._get_desktop_size();
    752         this.x = 0 + this.leftoffset;
    753         this.y = 0 + this.topoffset;
     752        this.x = this.leftoffset;
     753        this.y = this.topoffset;
    754754        this.w = (screen_size[0] - this.leftoffset) - this.rightoffset;
    755755        this.h = (screen_size[1] - this.topoffset) - this.bottomoffset;
    756756        this.debug("geometry", "fill_screen() ", this.x, this.y, this.w, this.h);
     
    11941194                //push video under the canvas:
    11951195                this.video.style.zIndex = "-1";
    11961196                //copy video to canvas:
    1197                 const width = this.video.getAttribute("width");
    1198                 const height = this.video.getAttribute("height");
     1197                const width = parseInt(this.video.getAttribute("width"));
     1198                const height = parseInt(this.video.getAttribute("height"));
    11991199                this.offscreen_canvas_ctx.drawImage(this.video, 0, 0, width, height);
    12001200        }
    12011201};
     
    12471247
    12481248XpraWindow.prototype.get_jsmpeg_renderer = function get_jsmpeg_renderer() {
    12491249        if (this.jsmpeg_renderer==null) {
    1250                 const options = new Object();
     1250                const options = {};
    12511251                //webgl is still buggy
    12521252                //if (JSMpeg.Renderer.WebGL.IsSupported()) {
    12531253                //      this.jsmpeg_renderer = new JSMpeg.Renderer.WebGL(options);
     
    13081308                        //show("options="+(options).toSource());
    13091309                        if (options!=null && options["zlib"]>0) {
    13101310                                //show("decompressing "+img_data.length+" bytes of "+coding+"/zlib");
    1311                                 const inflated = new Zlib.Inflate(img_data).decompress();
    13121311                                //show("rgb32 data inflated from "+img_data.length+" to "+inflated.length+" bytes");
    1313                                 img_data = inflated;
     1312                                img_data = new Zlib.Inflate(img_data).decompress();
    13141313                        } else if (options!=null && options["lz4"]>0) {
    13151314                                // in future we need to make sure that we use typed arrays everywhere...
    13161315                                let d;
     
    13651364                else if (coding=="mpeg1") {
    13661365                        const frame = options["frame"] || 0;
    13671366                        if (frame==0 || this.jsmpeg_decoder==null) {
    1368                                 const options = new Object();
     1367                                const options = {};
    13691368                                options.streaming = true;
    13701369                                options.decodeFirstFrame = false;
    13711370                                this.jsmpeg_decoder = new JSMpeg.Decoder.MPEG1Video(options);
    13721371                                //TODO: instead of delegating, we should probably subclass the renderer
    13731372                                // (but which one! GL or not?):
    1374                                 const renderer = new Object();
     1373                                const renderer = {};
    13751374                                renderer.render = function render(Y, Cr, Cb) {
    13761375                                        const jsmpeg_renderer = me.get_jsmpeg_renderer();
    13771376                                        jsmpeg_renderer.render(Y, Cr, Cb);
     
    13851384                                };
    13861385                                this.jsmpeg_decoder.connect(renderer);
    13871386                        }
    1388                         const pts = frame;
    1389                         this.jsmpeg_decoder.write(pts, img_data);
     1387                        this.jsmpeg_decoder.write(frame, img_data);
    13901388                        const decoded = this.jsmpeg_decoder.decode();
    13911389                        this.debug("draw", coding, "frame", frame, "data len=", img_data.length, "decoded=", decoded);
    13921390                        //TODO: only call painted when we have actually painted the frame?