2025-09-10 18:53:12 -07:00
|
|
|
#!/usr/bin/gjs -m
|
|
|
|
|
|
|
|
|
|
import System from 'system';
|
|
|
|
|
import GLib from 'gi://GLib';
|
|
|
|
|
import GObject from 'gi://GObject';
|
|
|
|
|
import Gtk from 'gi://Gtk?version=4.0';
|
|
|
|
|
import Casilda from 'gi://Casilda?version=1.0';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let CasildaApplication = GObject.registerClass({},
|
|
|
|
|
class CasildaApplication extends Gtk.Application {
|
|
|
|
|
constructor() {
|
|
|
|
|
super({
|
|
|
|
|
application_id: 'ar.xjuan.casilda.Gjs.Example'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
vfunc_activate() {
|
|
|
|
|
let compositor = new Casilda.Compositor();
|
|
|
|
|
|
|
|
|
|
let window = new Gtk.ApplicationWindow({
|
|
|
|
|
application: this,
|
|
|
|
|
title: 'Casilda Compositor',
|
2026-04-08 19:58:17 -04:00
|
|
|
default_width: 1024,
|
|
|
|
|
default_height: 768,
|
2025-09-10 18:53:12 -07:00
|
|
|
child: compositor
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
window.connect('close-request', () => {
|
|
|
|
|
this.quit();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
compositor.spawn_async (
|
|
|
|
|
null,
|
|
|
|
|
["/usr/bin/gtk4-demo"],
|
|
|
|
|
null,
|
|
|
|
|
GLib.SpawnFlags.DEFAULT,
|
|
|
|
|
null
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
window.present();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
let app = new CasildaApplication();
|
|
|
|
|
app.run([System.programInvocationName].concat(ARGV));
|