C# bindings for the gtk4-layer-shell library for use with Gir.Core GTK
.idea/.idea.ZwlrLayerShell/.idea | ||
ZwlrLayerShell | ||
.gitignore | ||
LICENSE | ||
README.md | ||
ZwlrLayerShell.sln |
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);