1
0
Fork
You've already forked ZwlrLayerShell
0
C# bindings for the gtk4-layer-shell library for use with Gir.Core GTK
  • C# 100%
2025年11月23日 19:26:25 +10:00
.idea/.idea.ZwlrLayerShell/.idea Initial commit 2025年08月25日 20:02:31 +10:00
ZwlrLayerShell Update RepositoryUrl 2025年11月23日 19:26:25 +10:00
.gitignore Initial commit 2025年08月25日 20:02:31 +10:00
LICENSE Add README.md and LICENSE 2025年08月25日 20:36:17 +10:00
README.md Add README.md and LICENSE 2025年08月25日 20:36:17 +10:00
ZwlrLayerShell.sln Initial commit 2025年08月25日 20:02:31 +10:00

ZwlrLayerShell

C# bindings for the gtk4-layer-shell library intended to be used with Gir.Core's GTK4 package. This package can be used to create applications such as panels and widgets through the zwlr_layer_shell_v1 protocol.

Usage

ZwlrLayerShell can be used the same way as gtk4-layer-shell is used in C. Please note that you need to link it before libwayland-client to function correctly. The following example uses the LayerShell.IsSupported() function to make sure it is linked beforehand.

using Gtk;
using ZwlrLayerShell;
if (!LayerShell.IsSupported())
{
 // Exit the program if the compositor doesn't support zwlr_layer_shell_v1
 return;
}
var application = Application.New("com.example.exampleapp", Gio.ApplicationFlags.FlagsNone);
application.OnActivate += (sender, eventArgs) =>
{
 var window = ApplicationWindow.New((Application)sender);
 // Window must be assigned the layer_surface role before being presented
 LayerShell.InitForWindow(window);
 LayerShell.SetNamespace(window, "exampleapp");
 LayerShell.SetLayer(window, Layer.Top);
 window.Present();
};
application.RunWithSynchronizationContext(null);