From 018a750fbc0ef32474c7236c04d68f6960570f3b Mon Sep 17 00:00:00 2001 From: Rafostar <40623528+Rafostar@users.noreply.github.com> Date: Sat, 12 Dec 2020 21:56:35 +0100 Subject: [PATCH] Add web app for broadway backend --- clapper_src/webapp.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 clapper_src/webapp.js diff --git a/clapper_src/webapp.js b/clapper_src/webapp.js new file mode 100644 index 00000000..3c43933b --- /dev/null +++ b/clapper_src/webapp.js @@ -0,0 +1,36 @@ +const { Gio, GObject } = imports.gi; +const Debug = imports.clapper_src.debug; +const Misc = imports.clapper_src.misc; + +let { debug } = Debug; + +var WebApp = GObject.registerClass( +class ClapperWebApp extends Gio.SubprocessLauncher +{ + _init() + { + const flags = Gio.SubprocessFlags.STDOUT_SILENCE + | Gio.SubprocessFlags.STDERR_SILENCE; + + super._init(flags); + } + + startRemoteApp() + { + this.setenv('GDK_BACKEND', 'broadway', true); + this.setenv('BROADWAY_DISPLAY', '6', true); + + this.remoteApp = this.spawnv(Misc.appId); + this.remoteApp.wait_async(null, this._onRemoteClosed.bind(this)); + + debug('remote app started'); + } + + _onRemoteClosed(remoteApp, res) + { + debug('remote app closed'); + + this.setenv('GDK_BACKEND', '', true); + this.setenv('BROADWAY_DISPLAY', '', true); + } +});