Add web app for broadway backend

This commit is contained in:
Rafostar
2020-12-12 21:56:35 +01:00
parent 660b5c6c48
commit 018a750fbc

36
clapper_src/webapp.js Normal file
View File

@@ -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);
}
});