42 lines
1 KiB
Vala
42 lines
1 KiB
Vala
using Deskcandy.Candy;
|
|
|
|
namespace Deskcandy {
|
|
|
|
[GtkTemplate(ui = "/moe/solarpunk/Deskcandy/desktop_window.ui")]
|
|
public class DesktopWindow : Gtk.Window {
|
|
private Gtk.Socket socket;
|
|
private Subprocess proc;
|
|
|
|
public DesktopWindow(Application app) {
|
|
Object(application: app);
|
|
Gdk.Rectangle rect = this.get_display().get_primary_monitor().get_geometry();
|
|
this.set_default_size(rect.width, rect.height);
|
|
this.set_keep_below(true);
|
|
|
|
app.initialized.connect(this.on_initialized);
|
|
}
|
|
|
|
public void refresh_socket(BaseCandy candy) {
|
|
if (this.socket != null) {
|
|
this.remove(this.socket);
|
|
this.proc.send_signal(15);
|
|
}
|
|
|
|
this.socket = new Gtk.Socket();
|
|
this.socket.set_visible(true);
|
|
this.add(this.socket);
|
|
|
|
try {
|
|
this.proc = candy.launch((uint)this.socket.get_id(), "abstractile");
|
|
} catch (Error e) {
|
|
error(e.message);
|
|
}
|
|
}
|
|
|
|
private void on_initialized(BaseCandy[] candies) {
|
|
this.present();
|
|
//this.refresh_socket(candy);
|
|
}
|
|
}
|
|
}
|