Add layer shell window

This commit is contained in:
pancakes 2025-08-26 01:30:08 +10:00
parent 05321e7a91
commit 8de1c69dbb
Signed by: pancakes
SSH key fingerprint: SHA256:yrp4c4hhaPoPG07fb4QyQIgAdlbUdsJvUAydJEWnfTw

View file

@ -1,3 +1,28 @@
// See https://aka.ms/new-console-template for more information using Gio;
using Gtk;
using ZwlrLayerShell;
using Application = Gtk.Application;
Console.WriteLine("Hello, World!"); if (!LayerShell.IsSupported())
{
Console.WriteLine("You must be running on a Wayland compositor that supports zwlr_layer_shell_v1");
return 255;
}
var application = Application.New("gay.pancakes.deltatune_wls", Gio.ApplicationFlags.FlagsNone);
application.OnActivate += (sender, eventArgs) =>
{
var window = ApplicationWindow.New((Application)sender);
LayerShell.InitForWindow(window);
LayerShell.SetNamespace(window, "deltatune-wls");
LayerShell.SetLayer(window, Layer.Top);
LayerShell.SetAnchor(window, Edge.Left, true);
LayerShell.SetAnchor(window, Edge.Top, true);
LayerShell.SetMargin(window, 15);
window.Present();
};
return application.RunWithSynchronizationContext(null);