Add layer shell window
This commit is contained in:
parent
05321e7a91
commit
8de1c69dbb
1 changed files with 27 additions and 2 deletions
|
@ -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);
|
Loading…
Add table
Reference in a new issue